From 987aad44c1dcee36f38359c364bfb895fa696b1f Mon Sep 17 00:00:00 2001 From: Ichthyostega Date: Fri, 17 Aug 2018 15:59:52 +0200 Subject: [PATCH] DockAccess: add ability to retrieve a panel via PanelManager (#1144) This is only a premature hack, since the whole structure of PanelManager is somewhat broken. Moreover, the ViewLocator is not really ready for use yet, so this hack at least allows us to "reach into" a top-level window and "grab" the pannel we need. --- src/gui/workspace/panel-manager.cpp | 9 +- src/gui/workspace/panel-manager.hpp | 3 +- wiki/thinkPad.ichthyo.mm | 180 ++++++++++++++++++++++++---- 3 files changed, 162 insertions(+), 30 deletions(-) diff --git a/src/gui/workspace/panel-manager.cpp b/src/gui/workspace/panel-manager.cpp index 9df74186c..6d5ab5bc9 100644 --- a/src/gui/workspace/panel-manager.cpp +++ b/src/gui/workspace/panel-manager.cpp @@ -136,7 +136,7 @@ namespace workspace { } - void + panel::Panel& PanelManager::showPanel (const int description_index) { // Try and find the panel and present it if possible @@ -149,9 +149,9 @@ namespace workspace { if (!panel->is_shown()) panel->show(); Gdl::DockItem &dock_item = panel->getDockItem(); - // ENSURE(dock_item); dock_item.present(dock_); - return; + ENSURE (panel); + return *panel; } } @@ -160,6 +160,9 @@ namespace workspace { // Dock the item dock_.add_item(new_panel->getDockItem(), Gdl::DOCK_FLOATING); + + ENSURE (new_panel); + return *new_panel; } diff --git a/src/gui/workspace/panel-manager.hpp b/src/gui/workspace/panel-manager.hpp index 3608618a5..e78a87716 100644 --- a/src/gui/workspace/panel-manager.hpp +++ b/src/gui/workspace/panel-manager.hpp @@ -114,8 +114,9 @@ namespace workspace { /** * Shows a panel given a description index. * @param description_index The index of the panel type to show. + * @return existing or new Panel, docked within the realm of this PanelManager. */ - void showPanel (const int description_index); + panel::Panel& showPanel (const int description_index); /** * Switches a panel from one type to another, diff --git a/wiki/thinkPad.ichthyo.mm b/wiki/thinkPad.ichthyo.mm index b4da59e58..7699076f0 100644 --- a/wiki/thinkPad.ichthyo.mm +++ b/wiki/thinkPad.ichthyo.mm @@ -1467,8 +1467,8 @@ - - + + @@ -1489,7 +1489,7 @@ - + @@ -1608,7 +1608,7 @@ - + @@ -1621,7 +1621,7 @@

- + @@ -1629,6 +1629,12 @@ + + + + + + @@ -1662,21 +1668,29 @@ + + + + + - + + + + - + - + @@ -1686,7 +1700,7 @@ - + @@ -1889,7 +1903,8 @@ - + + @@ -2219,7 +2234,7 @@ - + @@ -2248,7 +2263,7 @@ - + @@ -3345,14 +3360,15 @@ - + + - + @@ -3387,7 +3403,7 @@ - + @@ -3431,7 +3447,7 @@ - + @@ -13967,7 +13983,7 @@ - + @@ -14345,7 +14361,7 @@ - + @@ -14356,9 +14372,28 @@ - + + - + + + + + + + + + + + + + + + + + + + @@ -14606,7 +14641,7 @@ - + @@ -33201,7 +33236,7 @@ - + @@ -33226,6 +33261,7 @@ + @@ -33266,7 +33302,8 @@ - + + @@ -34225,7 +34262,7 @@ - + @@ -34276,7 +34313,98 @@ - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +

+ A dock item is a container widget that can be docked at different place. +

+

+ It accepts a single child and adds a grip allowing the user to click on it +

+

+ to drag and drop the widget. +

+

+ +

+

+ The grip is implemented as a GdlDockItemGrip +

+ + +
+
+
+ + + + +
+ + + + + + + + + + + @@ -34639,7 +34767,7 @@ - +