@@ -13,6 +13,8 @@ import { IContextMenuService } from 'vs/platform/contextview/browser/contextView
13
13
import { IKeybindingService } from 'vs/platform/keybinding/common/keybinding' ;
14
14
import { IThemeService } from 'vs/platform/theme/common/themeService' ;
15
15
import { ThemeIcon } from 'vs/base/common/themables' ;
16
+ import { ICustomHover , setupCustomHover } from 'vs/base/browser/ui/iconLabel/iconLabelHover' ;
17
+ import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate' ;
16
18
17
19
export class CodiconActionViewItem extends MenuEntryActionViewItem {
18
20
@@ -38,12 +40,12 @@ export class ActionViewWithLabel extends MenuEntryActionViewItem {
38
40
if ( this . _actionLabel ) {
39
41
this . _actionLabel . classList . add ( 'notebook-label' ) ;
40
42
this . _actionLabel . innerText = this . _action . label ;
41
- this . _actionLabel . title = this . _action . tooltip . length ? this . _action . tooltip : this . _action . label ;
42
43
}
43
44
}
44
45
}
45
46
export class UnifiedSubmenuActionView extends SubmenuEntryActionViewItem {
46
47
private _actionLabel ?: HTMLAnchorElement ;
48
+ private _hover ?: ICustomHover ;
47
49
48
50
constructor (
49
51
action : SubmenuItemAction ,
@@ -63,6 +65,10 @@ export class UnifiedSubmenuActionView extends SubmenuEntryActionViewItem {
63
65
container . classList . add ( 'notebook-action-view-item' ) ;
64
66
this . _actionLabel = document . createElement ( 'a' ) ;
65
67
container . appendChild ( this . _actionLabel ) ;
68
+
69
+ const hoverDelegate = this . options . hoverDelegate ?? getDefaultHoverDelegate ( 'element' ) ;
70
+ this . _hover = this . _register ( setupCustomHover ( hoverDelegate , this . _actionLabel , '' ) ) ;
71
+
66
72
this . updateLabel ( ) ;
67
73
}
68
74
@@ -88,13 +94,13 @@ export class UnifiedSubmenuActionView extends SubmenuEntryActionViewItem {
88
94
if ( this . renderLabel ) {
89
95
this . _actionLabel . classList . add ( 'notebook-label' ) ;
90
96
this . _actionLabel . innerText = this . _action . label ;
91
- this . _actionLabel . title = primaryAction . tooltip . length ? primaryAction . tooltip : primaryAction . label ;
97
+ this . _hover ?. update ( primaryAction . tooltip . length ? primaryAction . tooltip : primaryAction . label ) ;
92
98
}
93
99
} else {
94
100
if ( this . renderLabel ) {
95
101
this . _actionLabel . classList . add ( 'notebook-label' ) ;
96
102
this . _actionLabel . innerText = this . _action . label ;
97
- this . _actionLabel . title = this . _action . tooltip . length ? this . _action . tooltip : this . _action . label ;
103
+ this . _hover ?. update ( this . _action . tooltip . length ? this . _action . tooltip : this . _action . label ) ;
98
104
}
99
105
}
100
106
}
0 commit comments