mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-07-08 11:56:36 +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,22 +1,35 @@
|
|||||||
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> {
|
||||||
const tracker = (this as any).tracker as FocusTracker<Widget>;
|
if (this.editorMode.proMode) {
|
||||||
tracker.add(widget);
|
super.track(widget);
|
||||||
this.disableClose(Saveable.apply(widget));
|
} else {
|
||||||
if (ApplicationShell.TrackableWidgetProvider.is(widget)) {
|
const tracker = (this as any).tracker as FocusTracker<Widget>;
|
||||||
for (const toTrack of await widget.getTrackableWidgets()) {
|
tracker.add(widget);
|
||||||
tracker.add(toTrack);
|
this.disableClose(Saveable.apply(widget));
|
||||||
this.disableClose(Saveable.apply(toTrack));
|
if (ApplicationShell.TrackableWidgetProvider.is(widget)) {
|
||||||
}
|
for (const toTrack of await widget.getTrackableWidgets()) {
|
||||||
if (widget.onDidChangeTrackableWidgets) {
|
tracker.add(toTrack);
|
||||||
widget.onDidChangeTrackableWidgets(widgets => widgets.forEach(w => this.track(w)));
|
this.disableClose(Saveable.apply(toTrack));
|
||||||
|
}
|
||||||
|
if (widget.onDidChangeTrackableWidgets) {
|
||||||
|
widget.onDidChangeTrackableWidgets(widgets => widgets.forEach(w => this.track(w)));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user