mirror of
https://github.com/ckaczor/azuredatastudio.git
synced 2026-02-13 11:38:36 -05:00
Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c (#8525)
* Merge from vscode a5cf1da01d5db3d2557132be8d30f89c38019f6c * remove files we don't want * fix hygiene * update distro * update distro * fix hygiene * fix strict nulls * distro * distro * fix tests * fix tests * add another edit * fix viewlet icon * fix azure dialog * fix some padding * fix more padding issues
This commit is contained in:
@@ -5,7 +5,7 @@
|
||||
|
||||
import * as vscode from 'vscode';
|
||||
import * as nls from 'vscode-nls';
|
||||
import { Disposable } from './dispose';
|
||||
import { PreviewStatusBarEntry as OwnedStatusBarEntry } from './ownedStatusBarEntry';
|
||||
|
||||
const localize = nls.loadMessageBundle();
|
||||
|
||||
@@ -13,22 +13,18 @@ const selectZoomLevelCommandId = '_imagePreview.selectZoomLevel';
|
||||
|
||||
export type Scale = number | 'fit';
|
||||
|
||||
export class ZoomStatusBarEntry extends Disposable {
|
||||
private readonly _entry: vscode.StatusBarItem;
|
||||
export class ZoomStatusBarEntry extends OwnedStatusBarEntry {
|
||||
|
||||
private readonly _onDidChangeScale = this._register(new vscode.EventEmitter<{ scale: Scale }>());
|
||||
public readonly onDidChangeScale = this._onDidChangeScale.event;
|
||||
|
||||
private _showOwner: string | undefined;
|
||||
|
||||
constructor() {
|
||||
super();
|
||||
this._entry = this._register(vscode.window.createStatusBarItem({
|
||||
super({
|
||||
id: 'imagePreview.zoom',
|
||||
name: localize('zoomStatusBar.name', "Image Zoom"),
|
||||
alignment: vscode.StatusBarAlignment.Right,
|
||||
priority: 102 /* to the left of editor size entry (101) */,
|
||||
}));
|
||||
});
|
||||
|
||||
this._register(vscode.commands.registerCommand(selectZoomLevelCommandId, async () => {
|
||||
type MyPickItem = vscode.QuickPickItem & { scale: Scale };
|
||||
@@ -47,20 +43,11 @@ export class ZoomStatusBarEntry extends Disposable {
|
||||
}
|
||||
}));
|
||||
|
||||
this._entry.command = selectZoomLevelCommandId;
|
||||
this.entry.command = selectZoomLevelCommandId;
|
||||
}
|
||||
|
||||
public show(owner: string, scale: Scale) {
|
||||
this._showOwner = owner;
|
||||
this._entry.text = this.zoomLabel(scale);
|
||||
this._entry.show();
|
||||
}
|
||||
|
||||
public hide(owner: string) {
|
||||
if (owner === this._showOwner) {
|
||||
this._entry.hide();
|
||||
this._showOwner = undefined;
|
||||
}
|
||||
this.showItem(owner, this.zoomLabel(scale));
|
||||
}
|
||||
|
||||
private zoomLabel(scale: Scale): string {
|
||||
|
||||
Reference in New Issue
Block a user