浏览代码

Add current widget attribute to application shell.

Afshin Darian 8 年之前
父节点
当前提交
f65fa5aa26
共有 1 个文件被更改,包括 11 次插入1 次删除
  1. 11 1
      src/application/shell.ts

+ 11 - 1
src/application/shell.ts

@@ -165,7 +165,17 @@ class ApplicationShell extends Widget {
   /**
    * A signal emitted when main area's current focus changes.
    */
-  currentChanged: ISignal<this, FocusTracker.ICurrentChangedArgs<Widget>>;
+  readonly currentChanged: ISignal<this, FocusTracker.ICurrentChangedArgs<Widget>>;
+
+  /**
+   * The current widget in the shell's main area.
+   *
+   * #### Notes
+   * This property is read-only.
+   */
+  get currentWidget(): Widget {
+    return this._dockPanel.currentWidget;
+  }
 
   /**
    * Add a widget to the top content area.