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).
This commit is contained in:
David Capello 2014-02-02 21:22:50 -03:00
parent 78e5ab356a
commit 20393c8aaa

View File

@ -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<DocumentView*>(m_workspace->getActiveView())) {
UIContext::instance()->setActiveView(docView);
m_contextBar->updateFromTool(UIContext::instance()
->getSettings()->getCurrentTool());
m_contextBar->setVisible(true);
}
else {