diff --git a/src/vs/base/browser/ui/actionbar/actionViewItems.ts b/src/vs/base/browser/ui/actionbar/actionViewItems.ts index a714411e3a2..fd7424b0f72 100644 --- a/src/vs/base/browser/ui/actionbar/actionViewItems.ts +++ b/src/vs/base/browser/ui/actionbar/actionViewItems.ts @@ -226,12 +226,17 @@ export class BaseActionViewItem extends Disposable implements IActionViewItem { const title = this.getTooltip() ?? ''; this.updateAriaLabel(); - if (!this.customHover) { - const hoverDelegate = this.options.hoverDelegate ?? getDefaultHoverDelegate('element'); - this.customHover = setupCustomHover(hoverDelegate, this.element, title); - this._store.add(this.customHover); + if (this.options.hoverDelegate?.showNativeHover) { + /* While custom hover is not supported with context view */ + this.element.title = title; } else { - this.customHover.update(title); + if (!this.customHover) { + const hoverDelegate = this.options.hoverDelegate ?? getDefaultHoverDelegate('element'); + this.customHover = setupCustomHover(hoverDelegate, this.element, title); + this._store.add(this.customHover); + } else { + this.customHover.update(title); + } } } diff --git a/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts b/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts index 45e898b8fc1..a444b099637 100644 --- a/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts +++ b/src/vs/workbench/contrib/languageStatus/browser/languageStatus.contribution.ts @@ -33,6 +33,7 @@ import { Categories } from 'vs/platform/action/common/actionCommonCategories'; import { IAccessibilityInformation } from 'vs/platform/accessibility/common/accessibility'; import { IEditorGroupsService } from 'vs/workbench/services/editor/common/editorGroupsService'; import { ServiceCollection } from 'vs/platform/instantiation/common/serviceCollection'; +import { nativeHoverDelegate } from 'vs/platform/hover/browser/hover'; class LanguageStatusViewModel { @@ -327,7 +328,7 @@ class LanguageStatus { } // -- pin - const actionBar = new ActionBar(right, {}); + const actionBar = new ActionBar(right, { hoverDelegate: nativeHoverDelegate }); store.add(actionBar); let action: Action; if (!isPinned) { diff --git a/src/vs/workbench/electron-sandbox/window.ts b/src/vs/workbench/electron-sandbox/window.ts index 6880e360e02..f207e15834f 100644 --- a/src/vs/workbench/electron-sandbox/window.ts +++ b/src/vs/workbench/electron-sandbox/window.ts @@ -79,6 +79,7 @@ import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar'; import { ThemeIcon } from 'vs/base/common/themables'; import { getWorkbenchContribution } from 'vs/workbench/common/contributions'; import { DynamicWorkbenchSecurityConfiguration } from 'vs/workbench/common/configuration'; +import { nativeHoverDelegate } from 'vs/platform/hover/browser/hover'; export class NativeWindow extends BaseWindow { @@ -1163,7 +1164,7 @@ class ZoomStatusEntry extends Disposable { this.zoomLevelLabel = zoomLevelLabel; disposables.add(toDisposable(() => this.zoomLevelLabel = undefined)); - const actionBarLeft = disposables.add(new ActionBar(left)); + const actionBarLeft = disposables.add(new ActionBar(left, { hoverDelegate: nativeHoverDelegate })); actionBarLeft.push(zoomOutAction, { icon: true, label: false, keybinding: this.keybindingService.lookupKeybinding(zoomOutAction.id)?.getLabel() }); actionBarLeft.push(this.zoomLevelLabel, { icon: false, label: true }); actionBarLeft.push(zoomInAction, { icon: true, label: false, keybinding: this.keybindingService.lookupKeybinding(zoomInAction.id)?.getLabel() }); @@ -1172,7 +1173,7 @@ class ZoomStatusEntry extends Disposable { right.classList.add('zoom-status-right'); container.appendChild(right); - const actionBarRight = disposables.add(new ActionBar(right)); + const actionBarRight = disposables.add(new ActionBar(right, { hoverDelegate: nativeHoverDelegate })); actionBarRight.push(zoomResetAction, { icon: false, label: true }); actionBarRight.push(zoomSettingsAction, { icon: true, label: false, keybinding: this.keybindingService.lookupKeybinding(zoomSettingsAction.id)?.getLabel() });