From c36a1de9d1b762355bbed31ab9b6672dc90aec43 Mon Sep 17 00:00:00 2001 From: Alexander Valavanis Date: Tue, 28 May 2019 15:08:01 +0100 Subject: Hackfest2019: Get rid of deprecated InkSelectOneAction --- src/ui/tools/spray-tool.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) (limited to 'src/ui/tools/spray-tool.cpp') diff --git a/src/ui/tools/spray-tool.cpp b/src/ui/tools/spray-tool.cpp index 28990bd2d..5fed9e806 100644 --- a/src/ui/tools/spray-tool.cpp +++ b/src/ui/tools/spray-tool.cpp @@ -62,6 +62,7 @@ #include "svg/svg.h" #include "svg/svg-color.h" +#include "ui/toolbar/spray-toolbar.h" #include "ui/tools/spray-tool.h" #include "ui/dialog/dialog-manager.h" @@ -1210,7 +1211,14 @@ static void sp_spray_update_area(SprayTool *tc) static void sp_spray_switch_mode(SprayTool *tc, gint mode, bool with_shift) { // Select the button mode - SP_EVENT_CONTEXT(tc)->desktop->setToolboxSelectOneValue("spray_tool_mode", mode); + auto tb = dynamic_cast(SP_EVENT_CONTEXT(tc)->desktop->get_toolbar_by_name("SprayToolbar")); + + if(tb) { + tb->set_mode(mode); + } else { + std::cerr << "Could not access Spray toolbar" << std::endl; + } + // Need to set explicitly, because the prefs may not have changed by the previous tc->mode = mode; tc->update_cursor(with_shift); -- cgit v1.2.3