From 41980034469ee0985561d2ab93e899eb3eeb5fb3 Mon Sep 17 00:00:00 2001 From: David Capello Date: Thu, 21 Apr 2016 00:57:06 -0300 Subject: [PATCH] Update context bar correctly when right-click changes the current tool E.g. When right-click is configured with the Eraser tool, we must update the context bar with the Eraser options in the context bar. --- src/app/ui/editor/editor.cpp | 8 ++++++++ src/app/ui/editor/editor.h | 1 + 2 files changed, 9 insertions(+) diff --git a/src/app/ui/editor/editor.cpp b/src/app/ui/editor/editor.cpp index 13030bf39..b44666ab5 100644 --- a/src/app/ui/editor/editor.cpp +++ b/src/app/ui/editor/editor.cpp @@ -1157,6 +1157,12 @@ void Editor::updateQuicktool() } } +void Editor::updateContextBar() +{ + App::instance()->getMainWindow()->getContextBar() + ->updateForTool(getCurrentEditorTool()); +} + void Editor::updateToolLoopModifiersIndicators() { int modifiers = int(tools::ToolLoopModifiers::kNone); @@ -1281,6 +1287,7 @@ bool Editor::onProcessMessage(Message* msg) m_secondaryButton = mouseMsg->right(); updateQuicktool(); + updateContextBar(); updateToolLoopModifiersIndicators(); setCursor(mouseMsg->position()); } @@ -1307,6 +1314,7 @@ bool Editor::onProcessMessage(Message* msg) m_secondaryButton = false; updateQuicktool(); + updateContextBar(); updateToolLoopModifiersIndicators(); setCursor(mouseMsg->position()); } diff --git a/src/app/ui/editor/editor.h b/src/app/ui/editor/editor.h index ba04e359f..adfce02f1 100644 --- a/src/app/ui/editor/editor.h +++ b/src/app/ui/editor/editor.h @@ -240,6 +240,7 @@ namespace app { private: void setStateInternal(const EditorStatePtr& newState); void updateQuicktool(); + void updateContextBar(); void updateToolLoopModifiersIndicators(); bool isCurrentToolAffectedByRightClickMode();