mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
Fix hiding of image preview status bar items (#161278)
This commit is contained in:
parent
8b7180cbba
commit
a5f5a730d6
|
@ -119,6 +119,12 @@ class ImagePreview extends MediaPreview {
|
|||
this.webviewEditor.webview.postMessage({ type: 'setActive', value: this.webviewEditor.active });
|
||||
}
|
||||
|
||||
public override dispose(): void {
|
||||
super.dispose();
|
||||
this.sizeStatusBarEntry.hide(this);
|
||||
this.zoomStatusBarEntry.hide(this);
|
||||
}
|
||||
|
||||
public zoomIn() {
|
||||
if (this.previewState === PreviewState.Active) {
|
||||
this.webviewEditor.webview.postMessage({ type: 'zoomIn' });
|
||||
|
|
|
@ -48,10 +48,8 @@ export abstract class MediaPreview extends Disposable {
|
|||
}));
|
||||
|
||||
this._register(webviewEditor.onDidDispose(() => {
|
||||
if (this.previewState === PreviewState.Active) {
|
||||
this.binarySizeStatusBarEntry.hide(this);
|
||||
}
|
||||
this.previewState = PreviewState.Disposed;
|
||||
this.dispose();
|
||||
}));
|
||||
|
||||
const watcher = this._register(vscode.workspace.createFileSystemWatcher(new vscode.RelativePattern(resource, '*')));
|
||||
|
@ -69,6 +67,11 @@ export abstract class MediaPreview extends Disposable {
|
|||
}));
|
||||
}
|
||||
|
||||
public override dispose() {
|
||||
super.dispose();
|
||||
this.binarySizeStatusBarEntry.hide(this);
|
||||
}
|
||||
|
||||
protected updateBinarySize() {
|
||||
vscode.workspace.fs.stat(this.resource).then(({ size }) => {
|
||||
this._binarySize = size;
|
||||
|
|
Loading…
Reference in a new issue