mirror of
https://github.com/Microsoft/vscode
synced 2024-08-25 03:56:03 +00:00
Move statusBarItem onto new hoverService.setupUpdatableHover
This commit is contained in:
parent
815dcf06b5
commit
f93eb1c974
|
@ -187,6 +187,8 @@ export class HoverService extends Disposable implements IHoverService {
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: Investigate performance of this function. There seems to be a lot of content created
|
||||
// and thrown away on start up
|
||||
setupUpdatableHover(hoverDelegate: IHoverDelegate, htmlElement: HTMLElement, content: IUpdatableHoverContentOrFactory, options?: IUpdatableHoverOptions | undefined): IUpdatableHover {
|
||||
|
||||
htmlElement.setAttribute('custom-hover', 'true');
|
||||
|
|
|
@ -21,11 +21,11 @@ import { StandardKeyboardEvent } from 'vs/base/browser/keyboardEvent';
|
|||
import { KeyCode } from 'vs/base/common/keyCodes';
|
||||
import { renderIcon, renderLabelWithIcons } from 'vs/base/browser/ui/iconLabel/iconLabels';
|
||||
import { spinningLoading, syncing } from 'vs/platform/theme/common/iconRegistry';
|
||||
import { setupCustomHover } from 'vs/base/browser/ui/hover/updatableHoverWidget';
|
||||
import { isMarkdownString, markdownStringEqual } from 'vs/base/common/htmlContent';
|
||||
import { IHoverDelegate } from 'vs/base/browser/ui/hover/hoverDelegate';
|
||||
import { Gesture, EventType as TouchEventType } from 'vs/base/browser/touch';
|
||||
import type { IUpdatableHover } from 'vs/base/browser/ui/hover/hover';
|
||||
import { IHoverService } from 'vs/platform/hover/browser/hover';
|
||||
|
||||
export class StatusbarEntryItem extends Disposable {
|
||||
|
||||
|
@ -60,6 +60,7 @@ export class StatusbarEntryItem extends Disposable {
|
|||
entry: IStatusbarEntry,
|
||||
private readonly hoverDelegate: IHoverDelegate,
|
||||
@ICommandService private readonly commandService: ICommandService,
|
||||
@IHoverService private readonly hoverService: IHoverService,
|
||||
@INotificationService private readonly notificationService: INotificationService,
|
||||
@ITelemetryService private readonly telemetryService: ITelemetryService,
|
||||
@IThemeService private readonly themeService: IThemeService
|
||||
|
@ -121,7 +122,7 @@ export class StatusbarEntryItem extends Disposable {
|
|||
if (this.hover) {
|
||||
this.hover.update(hoverContents);
|
||||
} else {
|
||||
this.hover = this._register(setupCustomHover(this.hoverDelegate, this.container, hoverContents));
|
||||
this.hover = this._register(this.hoverService.setupUpdatableHover(this.hoverDelegate, this.container, hoverContents));
|
||||
}
|
||||
if (entry.command !== ShowTooltipCommand /* prevents flicker on click */) {
|
||||
this.focusListener.value = addDisposableListener(this.labelContainer, EventType.FOCUS, e => {
|
||||
|
|
Loading…
Reference in a new issue