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.
This commit is contained in:
David Capello 2016-04-21 00:57:06 -03:00
parent 4be68ab5f0
commit 4198003446
2 changed files with 9 additions and 0 deletions

View File

@ -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());
}

View File

@ -240,6 +240,7 @@ namespace app {
private:
void setStateInternal(const EditorStatePtr& newState);
void updateQuicktool();
void updateContextBar();
void updateToolLoopModifiersIndicators();
bool isCurrentToolAffectedByRightClickMode();