mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-09 12:26:34 +00:00
Made the editors closeable in pro
mode.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
parent
a2a9cbb02e
commit
4e683b237d
@ -1,12 +1,24 @@
|
|||||||
import { ApplicationShell, Widget, Saveable, FocusTracker, Message } from '@theia/core/lib/browser';
|
import { ApplicationShell, Widget, Saveable, FocusTracker, Message } from '@theia/core/lib/browser';
|
||||||
import { EditorWidget } from '@theia/editor/lib/browser';
|
import { EditorWidget } from '@theia/editor/lib/browser';
|
||||||
|
import { injectable, inject } from 'inversify';
|
||||||
|
import { EditorMode } from '../editor-mode';
|
||||||
|
|
||||||
|
@injectable()
|
||||||
export class ArduinoApplicationShell extends ApplicationShell {
|
export class ArduinoApplicationShell extends ApplicationShell {
|
||||||
|
|
||||||
|
@inject(EditorMode)
|
||||||
|
protected readonly editorMode: EditorMode;
|
||||||
|
|
||||||
protected refreshBottomPanelToggleButton() {
|
protected refreshBottomPanelToggleButton() {
|
||||||
|
if (this.editorMode.proMode) {
|
||||||
|
super.refreshBottomPanelToggleButton();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected async track(widget: Widget): Promise<void> {
|
protected async track(widget: Widget): Promise<void> {
|
||||||
|
if (this.editorMode.proMode) {
|
||||||
|
super.track(widget);
|
||||||
|
} else {
|
||||||
const tracker = (this as any).tracker as FocusTracker<Widget>;
|
const tracker = (this as any).tracker as FocusTracker<Widget>;
|
||||||
tracker.add(widget);
|
tracker.add(widget);
|
||||||
this.disableClose(Saveable.apply(widget));
|
this.disableClose(Saveable.apply(widget));
|
||||||
@ -20,6 +32,7 @@ export class ArduinoApplicationShell extends ApplicationShell {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
private disableClose(widget: Widget | undefined): void {
|
private disableClose(widget: Widget | undefined): void {
|
||||||
if (widget instanceof EditorWidget) {
|
if (widget instanceof EditorWidget) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user