Remove hover from elements using context view (#205586)

fix #205526
This commit is contained in:
Benjamin Christopher Simmonds
2024-02-19 21:54:02 +01:00
committed by GitHub
parent 232e9a2bef
commit 047cf8cc51
3 changed files with 15 additions and 8 deletions
@@ -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);
}
}
}
@@ -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) {
+3 -2
View File
@@ -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() });