Skip to content

Commit 5dbdf85

Browse files
committed
Fix IHoverDelegateOptions to use new options format
Fixes microsoft#199070
1 parent 92772dc commit 5dbdf85

File tree

4 files changed

+37
-21
lines changed

4 files changed

+37
-21
lines changed

src/vs/base/browser/ui/iconLabel/iconHoverDelegate.ts

Lines changed: 22 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -26,28 +26,35 @@ export interface IHoverDelegateOptions extends IUpdatableHoverOptions {
2626
* dispose method is required.
2727
*/
2828
target: IHoverDelegateTarget | HTMLElement;
29-
/**
30-
* Position of the hover. The default is to show above the target. This option will be ignored
31-
* if there is not enough room to layout the hover in the specified position, unless the
32-
* forcePosition option is set.
33-
*/
34-
hoverPosition?: HoverPosition;
35-
/**
36-
* Whether to show the hover pointer
37-
*/
38-
showPointer?: boolean;
39-
/**
40-
* Whether to skip the fade in animation, this should be used when hovering from one hover to
41-
* another in the same group so it looks like the hover is moving from one element to the other.
42-
*/
43-
skipFadeInAnimation?: boolean;
4429
/**
4530
* The container to pass to {@link IContextViewProvider.showContextView} which renders the hover
4631
* in. This is particularly useful for more natural tab focusing behavior, where the hover is
4732
* created as the next tab index after the element being hovered and/or to workaround the
4833
* element's container hiding on `focusout`.
4934
*/
5035
container?: HTMLElement;
36+
/**
37+
* Options that defines where the hover is positioned.
38+
*/
39+
position?: {
40+
/**
41+
* Position of the hover. The default is to show above the target. This option will be ignored
42+
* if there is not enough room to layout the hover in the specified position, unless the
43+
* forcePosition option is set.
44+
*/
45+
hoverPosition?: HoverPosition;
46+
};
47+
appearance?: {
48+
/**
49+
* Whether to show the hover pointer
50+
*/
51+
showPointer?: boolean;
52+
/**
53+
* Whether to skip the fade in animation, this should be used when hovering from one hover to
54+
* another in the same group so it looks like the hover is moving from one element to the other.
55+
*/
56+
skipFadeInAnimation?: boolean;
57+
};
5158
}
5259

5360
export interface IHoverDelegate {

src/vs/base/browser/ui/iconLabel/iconLabelHover.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -124,9 +124,13 @@ class UpdatableHoverWidget implements IDisposable {
124124
const hoverOptions: IHoverDelegateOptions = {
125125
content,
126126
target: this.target,
127-
showPointer: this.hoverDelegate.placement === 'element',
128-
hoverPosition: HoverPosition.BELOW,
129-
skipFadeInAnimation: !this.fadeInAnimation || !!oldHoverWidget, // do not fade in if the hover is already showing
127+
appearance: {
128+
showPointer: this.hoverDelegate.placement === 'element',
129+
skipFadeInAnimation: !this.fadeInAnimation || !!oldHoverWidget, // do not fade in if the hover is already showing
130+
},
131+
position: {
132+
hoverPosition: HoverPosition.BELOW,
133+
},
130134
...options
131135
};
132136

src/vs/platform/quickinput/browser/quickInputList.ts

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -860,9 +860,13 @@ export class QuickInputList {
860860
linkHandler: (url) => {
861861
this.options.linkOpenerDelegate(url);
862862
},
863-
showPointer: true,
863+
appearance: {
864+
showPointer: true,
865+
},
864866
container: this.container,
865-
hoverPosition: HoverPosition.RIGHT
867+
position: {
868+
hoverPosition: HoverPosition.RIGHT
869+
}
866870
}, false);
867871
}
868872

src/vs/workbench/contrib/notebook/browser/view/cellParts/cellStatusPart.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,8 @@ export class CellEditorStatusBar extends CellContentPart {
7777
private _lastHoverHideTime: number = 0;
7878

7979
readonly showHover = (options: IHoverDelegateOptions) => {
80-
options.hoverPosition = HoverPosition.ABOVE;
80+
options.position = options.position ?? {};
81+
options.position.hoverPosition = HoverPosition.ABOVE;
8182
return hoverService.showHover(options);
8283
};
8384

0 commit comments

Comments
 (0)