mirror of
https://github.com/Microsoft/vscode
synced 2024-11-05 18:29:38 +00:00
adding opacity transition variable
This commit is contained in:
parent
bb0a1b185b
commit
4e1b2aeb4a
3 changed files with 18 additions and 2 deletions
|
@ -749,7 +749,7 @@
|
|||
"--vscode-sash-size",
|
||||
"--vscode-editorStickyScroll-cursorOutsideHover",
|
||||
"--vscode-editorStickyScroll-opacityOutsideHover",
|
||||
"--vscode-editorStickyScroll-transitionOpacity",
|
||||
"--vscode-editorStickyScroll-opacityTransition",
|
||||
"--vscode-editorStickyScroll-scrollableWidth",
|
||||
"--window-border-color",
|
||||
"--workspace-trust-check-color",
|
||||
|
|
|
@ -39,6 +39,7 @@
|
|||
float: right;
|
||||
cursor: var(--vscode-editorStickyScroll-cursorOutsideHover, 'default');
|
||||
opacity: var(--vscode-editorStickyScroll-opacityOutsideHover, '0');
|
||||
transition: var(--vscode-editorStickyScroll-opacityTransition, 'opacity 0s');
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -176,11 +176,25 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
|
|||
if (showFoldingControls !== 'mouseover') {
|
||||
return;
|
||||
}
|
||||
this._foldingIconStore.add(dom.addDisposableListener(this._lineNumbersDomNode, dom.EventType.MOUSE_ENTER, () => {
|
||||
this._foldingIconStore.add(dom.addDisposableListener(this._lineNumbersDomNode, dom.EventType.MOUSE_ENTER, (e) => {
|
||||
let insideOfStickyScroll = false;
|
||||
if ('fromElement' in e && (e.fromElement instanceof HTMLElement)) {
|
||||
if (e.fromElement.classList.contains('codicon')) {
|
||||
insideOfStickyScroll = true;
|
||||
}
|
||||
}
|
||||
for (const line of this._stickyLines) {
|
||||
const lineNumberDomNode = line.lineNumberDomNode;
|
||||
if (insideOfStickyScroll) {
|
||||
lineNumberDomNode.style.setProperty('--vscode-editorStickyScroll-opacityTransition', 'opacity 0s');
|
||||
}
|
||||
lineNumberDomNode.style.setProperty('--vscode-editorStickyScroll-cursorOutsideHover', `pointer`);
|
||||
lineNumberDomNode.style.setProperty('--vscode-editorStickyScroll-opacityOutsideHover', `1`);
|
||||
if (insideOfStickyScroll) {
|
||||
setTimeout(() => {
|
||||
lineNumberDomNode.style.setProperty('--vscode-editorStickyScroll-opacityTransition', 'opacity 0.5s');
|
||||
}, 300);
|
||||
}
|
||||
}
|
||||
}));
|
||||
this._foldingIconStore.add(dom.addDisposableListener(this._lineNumbersDomNode, dom.EventType.MOUSE_LEAVE, () => {
|
||||
|
@ -312,6 +326,7 @@ export class StickyScrollWidget extends Disposable implements IOverlayWidget {
|
|||
container.style.setProperty('--vscode-editorStickyScroll-cursorOutsideHover', showFoldingControls === `mouseover` ? `default` : `pointer`);
|
||||
container.style.setProperty('--vscode-editorStickyScroll-opacityOutsideHover', showFoldingControls === `mouseover` ? `0` : `1`);
|
||||
}
|
||||
container.style.setProperty('--vscode-editorStickyScroll-opacityTransition', 'opacity 0.5s');
|
||||
|
||||
// Setting the click listener
|
||||
this._foldingIconStore.add(dom.addDisposableListener(foldingIcon, dom.EventType.CLICK, () => {
|
||||
|
|
Loading…
Reference in a new issue