|
1 | 1 | import { ApplicationShell, Widget, Saveable, FocusTracker, Message } from '@theia/core/lib/browser';
|
2 | 2 | import { EditorWidget } from '@theia/editor/lib/browser';
|
| 3 | +import { injectable, inject } from 'inversify'; |
| 4 | +import { EditorMode } from '../editor-mode'; |
3 | 5 |
|
| 6 | +@injectable() |
4 | 7 | export class ArduinoApplicationShell extends ApplicationShell {
|
5 | 8 |
|
| 9 | + @inject(EditorMode) |
| 10 | + protected readonly editorMode: EditorMode; |
| 11 | + |
6 | 12 | protected refreshBottomPanelToggleButton() {
|
| 13 | + if (this.editorMode.proMode) { |
| 14 | + super.refreshBottomPanelToggleButton(); |
| 15 | + } |
7 | 16 | }
|
8 | 17 |
|
9 | 18 | 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 | + } |
20 | 33 | }
|
21 | 34 | }
|
22 | 35 | }
|
|
0 commit comments