Skip to content

Commit 4e683b2

Browse files
author
Akos Kitta
committed
Made the editors closeable in pro mode.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
1 parent a2a9cbb commit 4e683b2

File tree

1 file changed

+23
-10
lines changed

1 file changed

+23
-10
lines changed

arduino-ide-extension/src/browser/customization/arduino-application-shell.ts

+23-10
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,35 @@
11
import { ApplicationShell, Widget, Saveable, FocusTracker, Message } from '@theia/core/lib/browser';
22
import { EditorWidget } from '@theia/editor/lib/browser';
3+
import { injectable, inject } from 'inversify';
4+
import { EditorMode } from '../editor-mode';
35

6+
@injectable()
47
export class ArduinoApplicationShell extends ApplicationShell {
58

9+
@inject(EditorMode)
10+
protected readonly editorMode: EditorMode;
11+
612
protected refreshBottomPanelToggleButton() {
13+
if (this.editorMode.proMode) {
14+
super.refreshBottomPanelToggleButton();
15+
}
716
}
817

918
protected async track(widget: Widget): Promise<void> {
10-
const tracker = (this as any).tracker as FocusTracker<Widget>;
11-
tracker.add(widget);
12-
this.disableClose(Saveable.apply(widget));
13-
if (ApplicationShell.TrackableWidgetProvider.is(widget)) {
14-
for (const toTrack of await widget.getTrackableWidgets()) {
15-
tracker.add(toTrack);
16-
this.disableClose(Saveable.apply(toTrack));
17-
}
18-
if (widget.onDidChangeTrackableWidgets) {
19-
widget.onDidChangeTrackableWidgets(widgets => widgets.forEach(w => this.track(w)));
19+
if (this.editorMode.proMode) {
20+
super.track(widget);
21+
} else {
22+
const tracker = (this as any).tracker as FocusTracker<Widget>;
23+
tracker.add(widget);
24+
this.disableClose(Saveable.apply(widget));
25+
if (ApplicationShell.TrackableWidgetProvider.is(widget)) {
26+
for (const toTrack of await widget.getTrackableWidgets()) {
27+
tracker.add(toTrack);
28+
this.disableClose(Saveable.apply(toTrack));
29+
}
30+
if (widget.onDidChangeTrackableWidgets) {
31+
widget.onDidChangeTrackableWidgets(widgets => widgets.forEach(w => this.track(w)));
32+
}
2033
}
2134
}
2235
}

0 commit comments

Comments
 (0)