diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2019-06-05 19:34:19 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2019-06-05 19:34:19 +0000 |
| commit | 346e764345e1fbf877307313cd4779874dfd3ed9 (patch) | |
| tree | d5c326e85f752a1cd54301bc19592d90d9445e51 /src/widgets/desktop-widget.cpp | |
| parent | Merge changes (diff) | |
| parent | Finish TextToolbar migration (diff) | |
| download | inkscape-346e764345e1fbf877307313cd4779874dfd3ed9.tar.gz inkscape-346e764345e1fbf877307313cd4779874dfd3ed9.zip | |
Merge branch 'text-toolbar-migration'
Diffstat (limited to 'src/widgets/desktop-widget.cpp')
| -rw-r--r-- | src/widgets/desktop-widget.cpp | 26 |
1 files changed, 16 insertions, 10 deletions
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp index e94448e2c..8bf236972 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" @@ -1527,6 +1526,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<Gtk::Grid*>(widget); + + if (!grid) return nullptr; + + auto child = grid->get_child_at(0,0); + auto tb = dynamic_cast<Gtk::Toolbar*>(child); + + return tb; +} + void SPDesktopWidget::setToolboxFocusTo (const gchar* label) { @@ -1565,15 +1580,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<InkSelectOneAction*>(hb)) { - static_cast<InkSelectOneAction*>(hb)->set_active( value ); - } -} - bool SPDesktopWidget::isToolboxButtonActive (const gchar* id) |
