|
@@ -8,6 +8,10 @@ import {
|
|
|
Vector
|
|
|
} from 'phosphor/lib/collections/vector';
|
|
|
|
|
|
+import {
|
|
|
+ defineSignal, ISignal
|
|
|
+} from 'phosphor/lib/core/signaling';
|
|
|
+
|
|
|
import {
|
|
|
BoxLayout, BoxPanel
|
|
|
} from 'phosphor/lib/ui/boxpanel';
|
|
@@ -20,6 +24,10 @@ import {
|
|
|
each
|
|
|
} from 'phosphor/lib/algorithm/iteration';
|
|
|
|
|
|
+import {
|
|
|
+ FocusTracker
|
|
|
+} from 'phosphor/lib/ui/focustracker';
|
|
|
+
|
|
|
import {
|
|
|
Panel
|
|
|
} from 'phosphor/lib/ui/panel';
|
|
@@ -142,6 +150,7 @@ class ApplicationShell extends Widget {
|
|
|
this.layout = rootLayout;
|
|
|
|
|
|
this._dockPanel.currentChanged.connect((sender, args) => {
|
|
|
+ this.currentChanged.emit(args);
|
|
|
if (args.newValue) {
|
|
|
args.newValue.title.className += ` ${CURRENT_CLASS}`;
|
|
|
}
|
|
@@ -153,6 +162,11 @@ class ApplicationShell extends Widget {
|
|
|
});
|
|
|
}
|
|
|
|
|
|
+ /**
|
|
|
+ * A signal emitted when main area's current focus changes.
|
|
|
+ */
|
|
|
+ currentChanged: ISignal<this, FocusTracker.ICurrentChangedArgs<Widget>>;
|
|
|
+
|
|
|
/**
|
|
|
* Add a widget to the top content area.
|
|
|
*
|
|
@@ -268,6 +282,10 @@ class ApplicationShell extends Widget {
|
|
|
}
|
|
|
|
|
|
|
|
|
+// Define the signals for the `ApplicationShell` class.
|
|
|
+defineSignal(ApplicationShell.prototype, 'currentChanged');
|
|
|
+
|
|
|
+
|
|
|
/**
|
|
|
* A class which manages a side bar and related stacked panel.
|
|
|
*/
|