From dd208ebe5dfbd2dee7fb90bfad91e002af1c80fb Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D8=AF=D8=A7=D9=86=D8=AA=D9=8A=20=D8=A8=D8=A7=D9=88=D9=84?= =?UTF-8?q?=D8=A7?= <38820379+Liebranca@users.noreply.github.com> Date: Thu, 29 Aug 2024 10:45:52 -0300 Subject: [PATCH] Use right click action with shading ink (fix #4520) (#4615) --- src/app/tools/active_tool.cpp | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/app/tools/active_tool.cpp b/src/app/tools/active_tool.cpp index ea09997b3..d43a7f961 100644 --- a/src/app/tools/active_tool.cpp +++ b/src/app/tools/active_tool.cpp @@ -11,6 +11,7 @@ #include "app/tools/active_tool.h" +#include "app/app.h" #include "app/color.h" #include "app/pref/preferences.h" #include "app/tools/active_tool_observer.h" @@ -18,6 +19,7 @@ #include "app/tools/pointer.h" #include "app/tools/tool_box.h" #include "app/ui/color_bar.h" +#include "app/ui/context_bar.h" namespace app { namespace tools { @@ -236,7 +238,14 @@ void ActiveToolManager::setSelectedTool(Tool* tool) // static bool ActiveToolManager::isToolAffectedByRightClickMode(Tool* tool) { + +#if ENABLE_UI + bool shadingMode = ((Preferences::instance().tool(tool).ink() == InkType::SHADING) && + (App::instance()->contextBar()->getShade().size() >= 2)); +#else bool shadingMode = (Preferences::instance().tool(tool).ink() == InkType::SHADING); +#endif + return ((tool->getInk(0)->isPaint() && !shadingMode) || (tool->getInk(0)->isEffect())) &&