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/widgets/desktop-widget.cpp | 26 ++++++++++++++++---------- 1 file changed, 16 insertions(+), 10 deletions(-) (limited to 'src/widgets/desktop-widget.cpp') diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index c48d6fbd5..2b5abd0b6 100644 --- a/src/widgets/desktop-widget.cpp +++ b/src/widgets/desktop-widget.cpp @@ -60,7 +60,6 @@ #include "ui/uxmanager.h" #include "ui/widget/button.h" #include "ui/widget/dock.h" -#include "ui/widget/ink-select-one-action.h" #include "ui/widget/layer-selector.h" #include "ui/widget/selected-style.h" #include "ui/widget/spin-button-tool-item.h" @@ -1513,6 +1512,22 @@ void SPDesktopWidget::layoutWidgets() } } +Gtk::Toolbar * +SPDesktopWidget::get_toolbar_by_name(const Glib::ustring& name) +{ + // The name is actually attached to the GtkGrid that contains + // the toolbar, so we need to get the grid first + auto widget = sp_search_by_name_recursive(Glib::wrap(aux_toolbox), name); + auto grid = dynamic_cast(widget); + + if (!grid) return nullptr; + + auto child = grid->get_child_at(0,0); + auto tb = dynamic_cast(child); + + return tb; +} + void SPDesktopWidget::setToolboxFocusTo (const gchar* label) { @@ -1551,15 +1566,6 @@ SPDesktopWidget::setToolboxAdjustmentValue (gchar const *id, double value) else g_warning ("Could not find GtkAdjustment for %s\n", id); } -void -SPDesktopWidget::setToolboxSelectOneValue (gchar const *id, int value) -{ - gpointer hb = sp_search_by_data_recursive(aux_toolbox, (gpointer) id); - if (static_cast(hb)) { - static_cast(hb)->set_active( value ); - } -} - bool SPDesktopWidget::isToolboxButtonActive (const gchar* id) -- cgit v1.2.3