mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 12:06:27 +00:00
Remove all usage of setupCustomHover from base/
This commit is contained in:
parent
21cf21eb43
commit
89e578da7a
|
@ -11,7 +11,6 @@ import { renderMarkdown, renderStringAsPlaintext } from 'vs/base/browser/markdow
|
|||
import { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
import { Action, IAction, IActionRunner } from 'vs/base/common/actions';
|
||||
import { Codicon } from 'vs/base/common/codicons';
|
||||
|
@ -24,6 +23,7 @@ import { ThemeIcon } from 'vs/base/common/themables';
|
|||
import 'vs/css!./button';
|
||||
import { localize } from 'vs/nls';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
|
||||
export interface IButtonOptions extends Partial<IButtonStyles> {
|
||||
readonly title?: boolean | string;
|
||||
|
@ -305,7 +305,7 @@ export class Button extends Disposable implements IButton {
|
|||
|
||||
private setTitle(title: string) {
|
||||
if (!this._hover && title !== '') {
|
||||
this._hover = this._register(setupCustomHover(this.options.hoverDelegate ?? getDefaultHoverDelegate('mouse'), this._element, title));
|
||||
this._hover = this._register(getBaseLayerHoverDelegate().setupUpdatableHover(this.options.hoverDelegate ?? getDefaultHoverDelegate('mouse'), this._element, title));
|
||||
} else if (this._hover) {
|
||||
this._hover.update(title);
|
||||
}
|
||||
|
@ -369,7 +369,7 @@ export class ButtonWithDropdown extends Disposable implements IButton {
|
|||
this.separator.style.backgroundColor = options.buttonSeparator ?? '';
|
||||
|
||||
this.dropdownButton = this._register(new Button(this.element, { ...options, title: false, supportIcons: true }));
|
||||
this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), this.dropdownButton.element, localize("button dropdown more actions", 'More Actions...')));
|
||||
this._register(getBaseLayerHoverDelegate().setupUpdatableHover(getDefaultHoverDelegate('mouse'), this.dropdownButton.element, localize("button dropdown more actions", 'More Actions...')));
|
||||
this.dropdownButton.element.setAttribute('aria-haspopup', 'true');
|
||||
this.dropdownButton.element.setAttribute('aria-expanded', 'false');
|
||||
this.dropdownButton.element.classList.add('monaco-dropdown-button');
|
||||
|
|
|
@ -9,8 +9,8 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
|||
import { EventType as GestureEventType, Gesture } from 'vs/base/browser/touch';
|
||||
import { AnchorAlignment } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { IMenuOptions } from 'vs/base/browser/ui/menu/menu';
|
||||
import { ActionRunner, IAction } from 'vs/base/common/actions';
|
||||
import { Emitter } from 'vs/base/common/event';
|
||||
|
@ -107,7 +107,7 @@ class BaseDropdown extends ActionRunner {
|
|||
set tooltip(tooltip: string) {
|
||||
if (this._label) {
|
||||
if (!this.hover && tooltip !== '') {
|
||||
this.hover = this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), this._label, tooltip));
|
||||
this.hover = this._register(getBaseLayerHoverDelegate().setupUpdatableHover(getDefaultHoverDelegate('mouse'), this._label, tooltip));
|
||||
} else if (this.hover) {
|
||||
this.hover.update(tooltip);
|
||||
}
|
||||
|
|
|
@ -19,8 +19,8 @@ import { KeyCode } from 'vs/base/common/keyCodes';
|
|||
import { ResolvedKeybinding } from 'vs/base/common/keybindings';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
import 'vs/css!./dropdown';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
|
||||
export interface IKeybindingProvider {
|
||||
(action: IAction): ResolvedKeybinding | undefined;
|
||||
|
@ -93,7 +93,7 @@ export class DropdownMenuActionViewItem extends BaseActionViewItem {
|
|||
this.element.setAttribute('aria-haspopup', 'true');
|
||||
this.element.setAttribute('aria-expanded', 'false');
|
||||
if (this._action.label) {
|
||||
this._register(setupCustomHover(this.options.hoverDelegate ?? getDefaultHoverDelegate('mouse'), this.element, this._action.label));
|
||||
this._register(getBaseLayerHoverDelegate().setupUpdatableHover(this.options.hoverDelegate ?? getDefaultHoverDelegate('mouse'), this.element, this._action.label));
|
||||
}
|
||||
this.element.ariaLabel = this._action.label || '';
|
||||
|
||||
|
|
|
@ -6,8 +6,8 @@
|
|||
import * as dom from 'vs/base/browser/dom';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
import * as objects from 'vs/base/common/objects';
|
||||
|
@ -141,7 +141,7 @@ export class HighlightedLabel extends Disposable {
|
|||
} else {
|
||||
if (!this.customHover && this.title !== '') {
|
||||
const hoverDelegate = this.options?.hoverDelegate ?? getDefaultHoverDelegate('mouse');
|
||||
this.customHover = this._register(setupCustomHover(hoverDelegate, this.domNode, this.title));
|
||||
this.customHover = this._register(getBaseLayerHoverDelegate().setupUpdatableHover(hoverDelegate, this.domNode, this.title));
|
||||
} else if (this.customHover) {
|
||||
this.customHover.update(this.title);
|
||||
}
|
||||
|
|
|
@ -7,13 +7,14 @@ import 'vs/css!./iconlabel';
|
|||
import * as dom from 'vs/base/browser/dom';
|
||||
import { HighlightedLabel } from 'vs/base/browser/ui/highlightedlabel/highlightedLabel';
|
||||
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
|
||||
import { setupCustomHover, setupNativeHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { setupNativeHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { IMatch } from 'vs/base/common/filters';
|
||||
import { Disposable, IDisposable } from 'vs/base/common/lifecycle';
|
||||
import { equals } from 'vs/base/common/objects';
|
||||
import { Range } from 'vs/base/common/range';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import type { IUpdatableHoverTooltipMarkdownString } from 'vs/base/browser/ui/hover/hover';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
|
||||
export interface IIconLabelCreationOptions {
|
||||
readonly supportHighlights?: boolean;
|
||||
|
@ -191,7 +192,7 @@ export class IconLabel extends Disposable {
|
|||
if (this.hoverDelegate.showNativeHover) {
|
||||
setupNativeHover(htmlElement, tooltip);
|
||||
} else {
|
||||
const hoverDisposable = setupCustomHover(this.hoverDelegate, htmlElement, tooltip);
|
||||
const hoverDisposable = getBaseLayerHoverDelegate().setupUpdatableHover(this.hoverDelegate, htmlElement, tooltip);
|
||||
if (hoverDisposable) {
|
||||
this.customHovers.set(htmlElement, hoverDisposable);
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
import { reset } from 'vs/base/browser/dom';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
import { IDisposable } from 'vs/base/common/lifecycle';
|
||||
|
||||
|
@ -24,7 +24,7 @@ export class SimpleIconLabel implements IDisposable {
|
|||
|
||||
set title(title: string) {
|
||||
if (!this.hover && title) {
|
||||
this.hover = setupCustomHover(getDefaultHoverDelegate('mouse'), this._container, title);
|
||||
this.hover = getBaseLayerHoverDelegate().setupUpdatableHover(getDefaultHoverDelegate('mouse'), this._container, title);
|
||||
} else if (this.hover) {
|
||||
this.hover.update(title);
|
||||
}
|
||||
|
|
|
@ -12,8 +12,8 @@ import { ActionBar } from 'vs/base/browser/ui/actionbar/actionbar';
|
|||
import * as aria from 'vs/base/browser/ui/aria/aria';
|
||||
import { AnchorAlignment, IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { ScrollableElement } from 'vs/base/browser/ui/scrollbar/scrollableElement';
|
||||
import { Widget } from 'vs/base/browser/ui/widget';
|
||||
import { IAction } from 'vs/base/common/actions';
|
||||
|
@ -235,7 +235,7 @@ export class InputBox extends Widget {
|
|||
public setTooltip(tooltip: string): void {
|
||||
this.tooltip = tooltip;
|
||||
if (!this.hover) {
|
||||
this.hover = this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), this.input, tooltip));
|
||||
this.hover = this._register(getBaseLayerHoverDelegate().setupUpdatableHover(getDefaultHoverDelegate('mouse'), this.input, tooltip));
|
||||
} else {
|
||||
this.hover.update(tooltip);
|
||||
}
|
||||
|
|
|
@ -5,8 +5,8 @@
|
|||
|
||||
import * as dom from 'vs/base/browser/dom';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { UILabelProvider } from 'vs/base/common/keybindingLabels';
|
||||
import { ResolvedKeybinding, ResolvedChord } from 'vs/base/common/keybindings';
|
||||
import { Disposable } from 'vs/base/common/lifecycle';
|
||||
|
@ -78,7 +78,7 @@ export class KeybindingLabel extends Disposable {
|
|||
this.domNode.style.color = labelForeground;
|
||||
}
|
||||
|
||||
this.hover = this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), this.domNode, ''));
|
||||
this.hover = this._register(getBaseLayerHoverDelegate().setupUpdatableHover(getDefaultHoverDelegate('mouse'), this.domNode, ''));
|
||||
|
||||
this.didEverRender = false;
|
||||
container.appendChild(this.domNode);
|
||||
|
|
|
@ -10,8 +10,8 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
|||
import { renderMarkdown } from 'vs/base/browser/markdownRenderer';
|
||||
import { AnchorPosition, IContextViewProvider } from 'vs/base/browser/ui/contextview/contextview';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { IListEvent, IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
|
||||
import { List } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { ISelectBoxDelegate, ISelectBoxOptions, ISelectBoxStyles, ISelectData, ISelectOptionItem } from 'vs/base/browser/ui/selectBox/selectBox';
|
||||
|
@ -153,7 +153,7 @@ export class SelectBoxList extends Disposable implements ISelectBoxDelegate, ILi
|
|||
|
||||
private setTitle(title: string): void {
|
||||
if (!this._hover && title) {
|
||||
this._hover = this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), this.selectElement, title));
|
||||
this._hover = this._register(getBaseLayerHoverDelegate().setupUpdatableHover(getDefaultHoverDelegate('mouse'), this.selectElement, title));
|
||||
} else if (this._hover) {
|
||||
this._hover.update(title);
|
||||
}
|
||||
|
|
|
@ -4,8 +4,8 @@
|
|||
*--------------------------------------------------------------------------------------------*/
|
||||
|
||||
import { $, append, clearNode, createStyleSheet, getContentHeight, getContentWidth } from 'vs/base/browser/dom';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { IListRenderer, IListVirtualDelegate } from 'vs/base/browser/ui/list/list';
|
||||
import { IListOptions, IListOptionsUpdate, IListStyles, List, unthemedListStyles } from 'vs/base/browser/ui/list/listWidget';
|
||||
import { ISplitViewDescriptor, IView, Orientation, SplitView } from 'vs/base/browser/ui/splitview/splitview';
|
||||
|
@ -134,7 +134,7 @@ class ColumnHeader<TRow, TCell> extends Disposable implements IView {
|
|||
this.element = $('.monaco-table-th', { 'data-col-index': index }, column.label);
|
||||
|
||||
if (column.tooltip) {
|
||||
this._register(setupCustomHover(getDefaultHoverDelegate('mouse'), this.element, column.tooltip));
|
||||
this._register(getBaseLayerHoverDelegate().setupUpdatableHover(getDefaultHoverDelegate('mouse'), this.element, column.tooltip));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -13,10 +13,10 @@ import { Emitter, Event } from 'vs/base/common/event';
|
|||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import 'vs/css!./toggle';
|
||||
import { isActiveElement, $, addDisposableListener, EventType } from 'vs/base/browser/dom';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { getDefaultHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegateFactory';
|
||||
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { getBaseLayerHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate2';
|
||||
|
||||
export interface IToggleOpts extends IToggleStyles {
|
||||
readonly actionClassName?: string;
|
||||
|
@ -134,7 +134,7 @@ export class Toggle extends Widget {
|
|||
}
|
||||
|
||||
this.domNode = document.createElement('div');
|
||||
this._hover = this._register(setupCustomHover(opts.hoverDelegate ?? getDefaultHoverDelegate('mouse'), this.domNode, this._opts.title));
|
||||
this._hover = this._register(getBaseLayerHoverDelegate().setupUpdatableHover(opts.hoverDelegate ?? getDefaultHoverDelegate('mouse'), this.domNode, this._opts.title));
|
||||
this.domNode.classList.add(...classes);
|
||||
if (!this._opts.notFocusable) {
|
||||
this.domNode.tabIndex = 0;
|
||||
|
|
Loading…
Reference in a new issue