From 20393c8aaa2fb80c5a31b0bd0267d402f293655c Mon Sep 17 00:00:00 2001 From: David Capello Date: Sun, 2 Feb 2014 21:22:50 -0300 Subject: [PATCH] Fix bug with empty ContextBar when Ctrl+W is used to close a sprite and then a new sprite is created This happens because Ctrl key activates the Hand/Move quick-tool, so the ContextBar is updated to shows controls for this tool (an empty context bar at the moment). Then, as Ctrl+W is pressed, the document is closed, (we lost the Editor), and we willn't receive a ContextBar::onCurrentToolChange() event (which should be generated by releasing Ctrl key). --- src/app/ui/main_window.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/app/ui/main_window.cpp b/src/app/ui/main_window.cpp index 52d32eee4..d0ccb9703 100644 --- a/src/app/ui/main_window.cpp +++ b/src/app/ui/main_window.cpp @@ -28,6 +28,7 @@ #include "app/ini_file.h" #include "app/load_widget.h" #include "app/modules/editors.h" +#include "app/settings/settings.h" #include "app/ui/color_bar.h" #include "app/ui/context_bar.h" #include "app/ui/document_view.h" @@ -229,6 +230,8 @@ void MainWindow::onActiveViewChange() if (DocumentView* docView = dynamic_cast(m_workspace->getActiveView())) { UIContext::instance()->setActiveView(docView); + m_contextBar->updateFromTool(UIContext::instance() + ->getSettings()->getCurrentTool()); m_contextBar->setVisible(true); } else {