Skip to content

Commit ffae04a

Browse files
committed
Better match native hover delay in custom tree hovers
Fixes microsoft#106102
1 parent 7bbd494 commit ffae04a

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

src/vs/workbench/contrib/views/browser/treeView.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,7 @@ import { SIDE_BAR_BACKGROUND, PANEL_BACKGROUND } from 'vs/workbench/common/theme
4141
import { IHoverService, IHoverOptions, IHoverTarget } from 'vs/workbench/services/hover/browser/hover';
4242
import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';
4343
import { IMarkdownString } from 'vs/base/common/htmlContent';
44+
import { isMacintosh } from 'vs/base/common/platform';
4445

4546
class Root implements ITreeItem {
4647
label = { label: 'root' };
@@ -809,7 +810,9 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
809810

810811
private setupHovers(node: ITreeItem, htmlElement: HTMLElement, disposableStore: DisposableStore, label: string | undefined): void {
811812
const hoverService = this.hoverService;
812-
const hoverDelay = this.hoverDelay;
813+
// Testing has indicated that on Windows and Linux 500 ms matches the native hovers most closely.
814+
// On Mac, the delay is 1500.
815+
const hoverDelay = isMacintosh ? 1500 : 500;
813816
let hoverOptions: IHoverOptions | undefined;
814817
let mouseX: number | undefined;
815818
function mouseOver(this: HTMLElement, e: MouseEvent): any {

0 commit comments

Comments
 (0)