Tidied PanelManager
This commit is contained in:
parent
a4fbcfec49
commit
12ecb634b6
2 changed files with 8 additions and 9 deletions
|
|
@ -121,10 +121,10 @@ PanelManager::get_workspace_window()
|
|||
}
|
||||
|
||||
void PanelManager::switch_panel(panels::Panel &old_panel,
|
||||
int new_panel_description_index)
|
||||
const int description_index)
|
||||
{
|
||||
REQUIRE(new_panel_description_index >= 0 &&
|
||||
new_panel_description_index < get_panel_description_count());
|
||||
REQUIRE(description_index >= 0 &&
|
||||
description_index < get_panel_description_count());
|
||||
|
||||
// Get the dock item
|
||||
GdlDockItem *dock_item = old_panel.get_dock_item();
|
||||
|
|
@ -143,8 +143,7 @@ void PanelManager::switch_panel(panels::Panel &old_panel,
|
|||
|
||||
// Create the new panel
|
||||
shared_ptr<panels::Panel> new_panel(
|
||||
panelDescriptionList[new_panel_description_index].create(
|
||||
*this, dock_item));
|
||||
panelDescriptionList[description_index].create(*this, dock_item));
|
||||
g_object_unref(dock_item);
|
||||
|
||||
panels.push_back(new_panel);
|
||||
|
|
|
|||
|
|
@ -86,11 +86,11 @@ public:
|
|||
* Switches a panel from one type to another, without touching the
|
||||
* underlying GdlDockItem.
|
||||
* @param old_panel The panel which will be transofrmed to a new type.
|
||||
* @param new_panel_description_index The index of the panel
|
||||
* description that will be instantiated.
|
||||
* @param description_index The index of the panel description that
|
||||
* will be instantiated.
|
||||
**/
|
||||
void switch_panel(panels::Panel &old_panel,
|
||||
int new_panel_description_index);
|
||||
const int description_index);
|
||||
|
||||
/**
|
||||
* Splits a panel into two panels of the same type.
|
||||
|
|
@ -112,7 +112,7 @@ public:
|
|||
* @param index The index of the panel to retrieve.
|
||||
* @return Returns the stock id of a panel at this index.
|
||||
**/
|
||||
static const gchar* get_panel_stock_id(int index);
|
||||
static const gchar* get_panel_stock_id(const int index);
|
||||
|
||||
private:
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue