From 08fd135a9845baa658143d2b2067f80a66352113 Mon Sep 17 00:00:00 2001 From: Joel Holdsworth Date: Wed, 15 Apr 2009 18:27:07 +0100 Subject: [PATCH] Allowed show_panel to lift a panel to view if it's hidden --- src/gui/workspace/panel-manager.cpp | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/src/gui/workspace/panel-manager.cpp b/src/gui/workspace/panel-manager.cpp index b40eb8d04..a038b3a8c 100644 --- a/src/gui/workspace/panel-manager.cpp +++ b/src/gui/workspace/panel-manager.cpp @@ -123,6 +123,20 @@ PanelManager::get_workspace_window() void PanelManager::show_panel(const int description_index) { + // Try and find the panel and present it if possible + list< boost::shared_ptr >::iterator i; + for(i = panels.begin(); i != panels.end(); i++) + { + const shared_ptr panel = *i; + if(get_panel_type(panel.get()) == description_index) + { + GdlDockItem *dock_item = panel->get_dock_item(); + ENSURE(dock_item); + gdl_dock_object_present(GDL_DOCK_OBJECT(dock_item), NULL); + return; + } + } + // Create the new panel shared_ptr new_panel = create_panel_by_index(description_index);