diff options
Diffstat (limited to 'SidebarManager.cpp')
-rw-r--r-- | SidebarManager.cpp | 17 |
1 files changed, 5 insertions, 12 deletions
diff --git a/SidebarManager.cpp b/SidebarManager.cpp index 0eb1f7b..393d748 100644 --- a/SidebarManager.cpp +++ b/SidebarManager.cpp @@ -3,10 +3,9 @@ SidebarManager::SidebarManager(Window *window) - : sidebarToolbox(window), sidebarView(&window->getEditManager()), - sidebarAdd(&window->getEditManager()), toolAddPolygon(&window->getEditManager()) + : sidebarToolbox(window), toolAddPolygon(&window->getEditManager()) { - this->editor = &window->getEditManager(); + this->window = window; activeSidebar = NULL; sidebar = gtk_vbox_new(FALSE, 0); @@ -16,7 +15,7 @@ SidebarManager::SidebarManager(Window *window) gtk_box_pack_start(GTK_BOX(sidebar), gtk_hseparator_new(), FALSE, FALSE, 5); - toolLabel = gtk_label_new(sidebarToolbox.getActiveTool()->getName()); + toolLabel = gtk_label_new(sidebarToolbox.getActiveTool().getName()); gtk_box_pack_start(GTK_BOX(sidebar), toolLabel, FALSE, FALSE, 0); @@ -40,13 +39,7 @@ SidebarManager::~SidebarManager() { void SidebarManager::update() { Sidebar *newSidebar = activeSidebar; - switch(editor->getMode()) { - case EditManager::VIEW: - newSidebar = &sidebarView; - break; - case EditManager::ADD: - newSidebar = &sidebarAdd; - } + newSidebar = window->getActiveTool()->getSidebar(); if(activeSidebar != newSidebar) { if(activeSidebar) @@ -57,7 +50,7 @@ void SidebarManager::update() { activeSidebar = newSidebar; } - gtk_label_set_text(GTK_LABEL(toolLabel), sidebarToolbox.getActiveTool()->getName()); + gtk_label_set_text(GTK_LABEL(toolLabel), sidebarToolbox.getActiveTool().getName()); sidebarToolbox.update(); activeSidebar->update(); |