diff options
| author | Alexander Valavanis <valavanisalex@gmail.com> | 2019-02-03 17:36:54 +0000 |
|---|---|---|
| committer | Alexander Valavanis <valavanisalex@gmail.com> | 2019-02-03 17:36:54 +0000 |
| commit | 8308d8432292feea0baa950658d8c1b1eca5248f (patch) | |
| tree | ccf90b6d7709f401eea2aba0eedc2e4d48dd24e8 | |
| parent | TweakToolbar: GtkAction migration (diff) | |
| download | inkscape-8308d8432292feea0baa950658d8c1b1eca5248f.tar.gz inkscape-8308d8432292feea0baa950658d8c1b1eca5248f.zip | |
MeasureToolbar: GtkAction migration
| -rw-r--r-- | share/ui/select-toolbar.ui | 21 | ||||
| -rw-r--r-- | src/display/canvas-temporary-item.h | 7 | ||||
| -rw-r--r-- | src/ui/toolbar/dropper-toolbar.cpp | 2 | ||||
| -rw-r--r-- | src/ui/toolbar/measure-toolbar.cpp | 547 | ||||
| -rw-r--r-- | src/ui/toolbar/measure-toolbar.h | 26 | ||||
| -rw-r--r-- | src/widgets/CMakeLists.txt | 2 | ||||
| -rw-r--r-- | src/widgets/ege-output-action.cpp | 259 | ||||
| -rw-r--r-- | src/widgets/ege-output-action.h | 121 | ||||
| -rw-r--r-- | src/widgets/toolbox.cpp | 2 |
9 files changed, 280 insertions, 707 deletions
diff --git a/share/ui/select-toolbar.ui b/share/ui/select-toolbar.ui index 0fe7e7ce7..ebc5aec0b 100644 --- a/share/ui/select-toolbar.ui +++ b/share/ui/select-toolbar.ui @@ -69,27 +69,6 @@ <toolitem action='SprayPickCenterAction' /> </toolbar> - <toolbar name='MeasureToolbar'> - <toolitem action='MeasureFontSizeAction' /> - <toolitem action='MeasurePrecisionAction' /> - <toolitem action='MeasureScaleAction' /> - <toolitem action='measure_units_label' /> - <toolitem action='MeasureUnitsAction' /> - <separator /> - <toolitem action='MeasureOnlySelected' /> - <toolitem action='MeasureIgnore1stAndLast' /> - <toolitem action='MeasureInBettween' /> - <toolitem action='MeasureShowHidden' /> - <toolitem action='MeasureAllLayers' /> - <separator /> - <toolitem action='MeasureReverse' /> - <toolitem action='MeasureToPhantom' /> - <toolitem action='MeasureToGuides' /> - <toolitem action='MeasureToItem' /> - <toolitem action='MeasureMarkDimension' /> - <toolitem action='MeasureOffsetAction' /> - </toolbar> - <toolbar name='PenToolbar'> <toolitem action='FreehandModeActionPen' /> <separator /> diff --git a/src/display/canvas-temporary-item.h b/src/display/canvas-temporary-item.h index b18ab0588..4e60e4333 100644 --- a/src/display/canvas-temporary-item.h +++ b/src/display/canvas-temporary-item.h @@ -27,6 +27,9 @@ public: TemporaryItem(SPCanvasItem *item, unsigned int lifetime, bool destroy_on_deselect = false); virtual ~TemporaryItem(); + TemporaryItem(const TemporaryItem&) = delete; + TemporaryItem& operator=(const TemporaryItem&) = delete; + sigc::signal<void, TemporaryItem *> signal_timeout; protected: @@ -37,10 +40,6 @@ protected: bool destroy_on_deselect; // only destroy when parent item is deselected, not when mouse leaves static int _timeout(void* data); ///< callback for when lifetime expired - -private: - TemporaryItem(const TemporaryItem&) = delete; - TemporaryItem& operator=(const TemporaryItem&) = delete; }; } //namespace Display diff --git a/src/ui/toolbar/dropper-toolbar.cpp b/src/ui/toolbar/dropper-toolbar.cpp index de247b5bd..3d6c4f972 100644 --- a/src/ui/toolbar/dropper-toolbar.cpp +++ b/src/ui/toolbar/dropper-toolbar.cpp @@ -29,8 +29,6 @@ #include "dropper-toolbar.h" #include "document-undo.h" -#include "widgets/ege-output-action.h" -#include "widgets/ink-toggle-action.h" #include "preferences.h" #include "widgets/spinbutton-events.h" diff --git a/src/ui/toolbar/measure-toolbar.cpp b/src/ui/toolbar/measure-toolbar.cpp index 9fb2c4d7c..9e04a4dc7 100644 --- a/src/ui/toolbar/measure-toolbar.cpp +++ b/src/ui/toolbar/measure-toolbar.cpp @@ -29,32 +29,25 @@ #include <glibmm/i18n.h> +#include <gtkmm/separatortoolitem.h> + #include "desktop.h" #include "document-undo.h" -#include "widgets/ink-action.h" -#include "widgets/ink-toggle-action.h" -#include "widgets/toolbox.h" #include "inkscape.h" #include "message-stack.h" #include "ui/icon-names.h" #include "ui/tools/measure-tool.h" #include "ui/widget/ink-select-one-action.h" +#include "ui/widget/label-tool-item.h" +#include "ui/widget/spin-button-tool-item.h" #include "ui/widget/unit-tracker.h" -#include "widgets/ege-adjustment-action.h" -#include "widgets/ege-output-action.h" - using Inkscape::UI::Widget::UnitTracker; using Inkscape::Util::Unit; using Inkscape::DocumentUndo; -using Inkscape::UI::ToolboxFactory; using Inkscape::UI::Tools::MeasureTool; -//######################## -//## Measure Toolbox ## -//######################## - /** Temporary hack: Returns the node tool in the active desktop. * Will go away during tool refactoring. */ static MeasureTool *get_measure_tool() @@ -71,342 +64,178 @@ static MeasureTool *get_measure_tool() - -static void -sp_toggle_ignore_1st_and_last( GtkToggleAction* act, gpointer data ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gboolean active = gtk_toggle_action_get_active(act); - prefs->setBool("/tools/measure/ignore_1st_and_last", active); - SPDesktop *desktop = static_cast<SPDesktop *>(data); - if ( active ) { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Start and end measures inactive.")); - } else { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Start and end measures active.")); - } - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->showCanvasItems(); - } -} - -static void -sp_toggle_only_selected( GtkToggleAction* act, gpointer data ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gboolean active = gtk_toggle_action_get_active(act); - prefs->setBool("/tools/measure/only_selected", active); - SPDesktop *desktop = static_cast<SPDesktop *>(data); - if ( active ) { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Measures only selected.")); - } else { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Measure all.")); - } - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->showCanvasItems(); - } -} - -static void -sp_toggle_show_hidden( GtkToggleAction* act, gpointer data ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gboolean active = gtk_toggle_action_get_active(act); - prefs->setBool("/tools/measure/show_hidden", active); - SPDesktop *desktop = static_cast<SPDesktop *>(data); - if ( active ) { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Show all crossings.")); - } else { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Show visible crossings.")); - } - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->showCanvasItems(); - } -} - -static void -sp_toggle_all_layers( GtkToggleAction* act, gpointer data ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gboolean active = gtk_toggle_action_get_active(act); - prefs->setBool("/tools/measure/all_layers", active); - SPDesktop *desktop = static_cast<SPDesktop *>(data); - if ( active ) { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Use all layers in the measure.")); - } else { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Use current layer in the measure.")); - } - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->showCanvasItems(); - } -} - -static void -sp_toggle_show_in_between( GtkToggleAction* act, gpointer data ) -{ - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - gboolean active = gtk_toggle_action_get_active(act); - prefs->setBool("/tools/measure/show_in_between", active); - SPDesktop *desktop = static_cast<SPDesktop *>(data); - if ( active ) { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Compute all elements.")); - } else { - desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Compute max length.")); - } - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->showCanvasItems(); - } -} -static void -sp_reverse_knots(){ - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->reverseKnots(); - } -} - -static void -sp_to_mark_dimension(){ - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->toMarkDimension(); - } -} - -static void -sp_to_guides(){ - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->toGuides(); - } -} - -static void -sp_to_phantom(){ - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->toPhantom(); - } -} - -static void -sp_to_item(){ - MeasureTool *mt = get_measure_tool(); - if (mt) { - mt->toItem(); - } -} - namespace Inkscape { namespace UI { namespace Toolbar { MeasureToolbar::MeasureToolbar(SPDesktop *desktop) : Toolbar(desktop), _tracker(new UnitTracker(Inkscape::Util::UNIT_TYPE_LINEAR)) -{} - -GtkWidget * -MeasureToolbar::prep(SPDesktop * desktop, GtkActionGroup* mainActions) { - auto holder = new MeasureToolbar(desktop); - - Inkscape::Preferences *prefs = Inkscape::Preferences::get(); - holder->_tracker->setActiveUnitByAbbr(prefs->getString("/tools/measure/unit").c_str()); - - EgeAdjustmentAction *eact = nullptr; - GtkIconSize secondarySize = ToolboxFactory::prefToSize("/toolbox/secondary", 1); + auto prefs = Inkscape::Preferences::get(); + _tracker->setActiveUnitByAbbr(prefs->getString("/tools/measure/unit").c_str()); /* Font Size */ { - eact = create_adjustment_action( "MeasureFontSizeAction", - _("Font Size"), _("Font Size:"), - _("The font size to be used in the measurement labels"), - "/tools/measure/fontsize", 10.0, - FALSE, nullptr, - 1.0, 36.0, 1.0, 4.0, - nullptr, nullptr, 0, - nullptr, 0 , 2); - ege_adjustment_action_set_focuswidget(eact, GTK_WIDGET(desktop->canvas)); - holder->_font_size_adj = Glib::wrap(ege_adjustment_action_get_adjustment(eact)); - holder->_font_size_adj->signal_value_changed().connect(sigc::mem_fun(*holder, &MeasureToolbar::fontsize_value_changed)); - gtk_action_group_add_action( mainActions, GTK_ACTION(eact)); + auto font_size_val = prefs->getDouble("/tools/measure/fontsize", 10.0); + _font_size_adj = Gtk::Adjustment::create(font_size_val, 1.0, 36.0, 1.0, 4.0); + auto font_size_item = Gtk::manage(new UI::Widget::SpinButtonToolItem("measure-fontsize", _("Font Size:"), _font_size_adj, 0, 2)); + font_size_item->set_tooltip_text(_("The font size to be used in the measurement labels")); + font_size_item->set_focus_widget(Glib::wrap(GTK_WIDGET(desktop->canvas))); + _font_size_adj->signal_value_changed().connect(sigc::mem_fun(*this, &MeasureToolbar::fontsize_value_changed)); + add(*font_size_item); } - /* units label */ + /* Precision */ { - EgeOutputAction* act = ege_output_action_new( "measure_units_label", _("Units:"), _("The units to be used for the measurements"), nullptr ); - ege_output_action_set_use_markup( act, TRUE ); - g_object_set( act, "visible-overflown", FALSE, NULL ); - gtk_action_group_add_action( mainActions, GTK_ACTION( act ) ); + auto precision_val = prefs->getDouble("/tools/measure/precision", 2); + _precision_adj = Gtk::Adjustment::create(precision_val, 0, 10, 1, 0); + auto precision_item = Gtk::manage(new UI::Widget::SpinButtonToolItem("measure-precision", _("Precision:"), _precision_adj, 0, 0)); + precision_item->set_tooltip_text(_("Decimal precision of measure")); + precision_item->set_focus_widget(Glib::wrap(GTK_WIDGET(desktop->canvas))); + _precision_adj->signal_value_changed().connect(sigc::mem_fun(*this, &MeasureToolbar::precision_value_changed)); + add(*precision_item); } - /* units menu */ + /* Scale */ { - InkSelectOneAction* act = holder->_tracker->createAction( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements") ); - act->signal_changed_after().connect(sigc::mem_fun(*holder, &MeasureToolbar::unit_changed)); - gtk_action_group_add_action( mainActions, act->gobj() ); + auto scale_val = prefs->getDouble("/tools/measure/scale", 100.0); + _scale_adj = Gtk::Adjustment::create(scale_val, 0.0, 90000.0, 1.0, 4.0); + auto scale_item = Gtk::manage(new UI::Widget::SpinButtonToolItem("measure-scale", _("Scale %:"), _scale_adj, 0, 3)); + scale_item->set_tooltip_text(_("Scale the results")); + scale_item->set_focus_widget(Glib::wrap(GTK_WIDGET(desktop->canvas))); + _scale_adj->signal_value_changed().connect(sigc::mem_fun(*this, &MeasureToolbar::scale_value_changed)); + add(*scale_item); } - /* Precision */ + /* units label */ { - eact = create_adjustment_action( "MeasurePrecisionAction", - _("Precision"), _("Precision:"), - _("Decimal precision of measure"), - "/tools/measure/precision", 2, - FALSE, nullptr, - 0, 10, 1, 0, - nullptr, nullptr, 0, - nullptr, 0 ,0); - ege_adjustment_action_set_focuswidget(eact, GTK_WIDGET(desktop->canvas)); - holder->_precision_adj = Glib::wrap(ege_adjustment_action_get_adjustment(eact)); - holder->_precision_adj->signal_value_changed().connect(sigc::mem_fun(*holder, &MeasureToolbar::precision_value_changed)); - gtk_action_group_add_action( mainActions, GTK_ACTION(eact)); + auto unit_label = Gtk::manage(new UI::Widget::LabelToolItem(_("Units:"))); + unit_label->set_tooltip_text(_("The units to be used for the measurements")); + unit_label->set_use_markup(true); + add(*unit_label); } - /* Scale */ + /* units menu */ { - eact = create_adjustment_action( "MeasureScaleAction", - _("Scale %"), _("Scale %:"), - _("Scale the results"), - "/tools/measure/scale", 100.0, - FALSE, nullptr, - 0.0, 90000.0, 1.0, 4.0, - nullptr, nullptr, 0, - nullptr, 0 , 3); - ege_adjustment_action_set_focuswidget(eact, GTK_WIDGET(desktop->canvas)); - holder->_scale_adj = Glib::wrap(ege_adjustment_action_get_adjustment(eact)); - holder->_scale_adj->signal_value_changed().connect(sigc::mem_fun(*holder, &MeasureToolbar::scale_value_changed)); - gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); + auto act = _tracker->createAction( "MeasureUnitsAction", _("Units:"), _("The units to be used for the measurements") ); + act->signal_changed_after().connect(sigc::mem_fun(*this, &MeasureToolbar::unit_changed)); + auto ti = act->create_tool_item(); + add(*ti); } - /* Offset */ - { - eact = create_adjustment_action( "MeasureOffsetAction", - _("Offset"), _("Offset:"), - _("Mark dimension offset"), - "/tools/measure/offset", 5.0, - FALSE, nullptr, - 0.0, 90000.0, 1.0, 4.0, - nullptr, nullptr, 0, - nullptr, 0 , 2); - ege_adjustment_action_set_focuswidget(eact, GTK_WIDGET(desktop->canvas)); - holder->_offset_adj = Glib::wrap(ege_adjustment_action_get_adjustment(eact)); - holder->_offset_adj->signal_value_changed().connect(sigc::mem_fun(*holder, &MeasureToolbar::offset_value_changed)); - gtk_action_group_add_action( mainActions, GTK_ACTION(eact) ); - } + add(*Gtk::manage(new Gtk::SeparatorToolItem())); /* measure only selected */ { - InkToggleAction* act = ink_toggle_action_new( "MeasureOnlySelected", - _("Measure only selected"), - _("Measure only selected"), - INKSCAPE_ICON("snap-bounding-box-center"), - secondarySize ); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/only_selected", false) ); - g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_only_selected), desktop) ; - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + _only_selected_item = add_toggle_button(_("Measure only selected"), + _("Measure only selected")); + _only_selected_item->set_icon_name(INKSCAPE_ICON("snap-bounding-box-center")); + _only_selected_item->set_active(prefs->getBool("/tools/measure/only_selected", false)); + _only_selected_item->signal_toggled().connect(sigc::mem_fun(*this, &MeasureToolbar::toggle_only_selected)); } /* ignore_1st_and_last */ { - InkToggleAction* act = ink_toggle_action_new( "MeasureIgnore1stAndLast", - _("Ignore first and last"), - _("Ignore first and last"), - INKSCAPE_ICON("draw-geometry-line-segment"), - secondarySize ); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/ignore_1st_and_last", true) ); - g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_ignore_1st_and_last), desktop) ; - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + _ignore_1st_and_last_item = add_toggle_button(_("Ignore first and last"), + _("Ignore first and last")); + _ignore_1st_and_last_item->set_icon_name(INKSCAPE_ICON("draw-geometry-line-segment")); + _ignore_1st_and_last_item->set_active(prefs->getBool("/tools/measure/ignore_1st_and_last", true)); + _ignore_1st_and_last_item->signal_toggled().connect(sigc::mem_fun(*this, &MeasureToolbar::toggle_ignore_1st_and_last)); } - /* only visible */ + + /* measure in betweens */ { - InkToggleAction* act = ink_toggle_action_new( "MeasureShowHidden", - _("Show hidden intersections"), - _("Show hidden intersections"), - INKSCAPE_ICON("object-hidden"), - secondarySize ); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/show_hidden", true) ); - g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_show_hidden), desktop) ; - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); - } - /* measure imbetweens */ + _inbetween_item = add_toggle_button(_("Show measures between items"), + _("Show measures between items")); + _inbetween_item->set_icon_name(INKSCAPE_ICON("distribute-randomize")); + _inbetween_item->set_active(prefs->getBool("/tools/measure/show_in_between", true)); + _inbetween_item->signal_toggled().connect(sigc::mem_fun(*this, &MeasureToolbar::toggle_show_in_between)); + } + + /* only visible */ { - InkToggleAction* act = ink_toggle_action_new( "MeasureInBettween", - _("Show measures between items"), - _("Show measures between items"), - INKSCAPE_ICON("distribute-randomize"), - secondarySize ); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/show_in_between", true) ); - g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_show_in_between), desktop) ; - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + _show_hidden_item = add_toggle_button(_("Show hidden intersections"), + _("Show hidden intersections")); + _show_hidden_item->set_icon_name(INKSCAPE_ICON("object-hidden")); + _show_hidden_item->set_active(prefs->getBool("/tools/measure/show_hidden", true)); + _show_hidden_item->signal_toggled().connect(sigc::mem_fun(*this, &MeasureToolbar::toggle_show_hidden)) ; } + /* measure only current layer */ { - InkToggleAction* act = ink_toggle_action_new( "MeasureAllLayers", - _("Measure all layers"), - _("Measure all layers"), - INKSCAPE_ICON("dialog-layers"), - secondarySize ); - gtk_toggle_action_set_active( GTK_TOGGLE_ACTION(act), prefs->getBool("/tools/measure/all_layers", true) ); - g_signal_connect_after( G_OBJECT(act), "toggled", G_CALLBACK(sp_toggle_all_layers), desktop) ; - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + _all_layers_item = add_toggle_button(_("Measure all layers"), + _("Measure all layers")); + _all_layers_item->set_icon_name(INKSCAPE_ICON("dialog-layers")); + _all_layers_item->set_active(prefs->getBool("/tools/measure/all_layers", true)); + _all_layers_item->signal_toggled().connect(sigc::mem_fun(*this, &MeasureToolbar::toggle_all_layers)); } + + add(* Gtk::manage(new Gtk::SeparatorToolItem())); + /* toggle start end */ { - InkAction* act = ink_action_new( "MeasureReverse", - _("Reverse measure"), - _("Reverse measure"), - INKSCAPE_ICON("draw-geometry-mirror"), - secondarySize ); - g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_reverse_knots), 0 ); - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + _reverse_item = Gtk::manage(new Gtk::ToolButton(_("Reverse measure"))); + _reverse_item->set_tooltip_text(_("Reverse measure")); + _reverse_item->set_icon_name(INKSCAPE_ICON("draw-geometry-mirror")); + _reverse_item->signal_clicked().connect(sigc::mem_fun(*this, &MeasureToolbar::reverse_knots)); + add(*_reverse_item); } + /* phantom measure */ { - InkAction* act = ink_action_new( "MeasureToPhantom", - _("Phantom measure"), - _("Phantom measure"), - INKSCAPE_ICON("selection-make-bitmap-copy"), - secondarySize ); - g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_to_phantom), 0 ); - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + _to_phantom_item = Gtk::manage(new Gtk::ToolButton(_("Phantom measure"))); + _to_phantom_item->set_tooltip_text(_("Phantom measure")); + _to_phantom_item->set_icon_name(INKSCAPE_ICON("selection-make-bitmap-copy")); + _to_phantom_item->signal_clicked().connect(sigc::mem_fun(*this, &MeasureToolbar::to_phantom)); + add(*_to_phantom_item); } + /* to guides */ { - InkAction* act = ink_action_new( "MeasureToGuides", - _("To guides"), - _("To guides"), - INKSCAPE_ICON("guides"), - secondarySize ); - g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_to_guides), 0 ); - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + _to_guides_item = Gtk::manage(new Gtk::ToolButton(_("To guides"))); + _to_guides_item->set_tooltip_text(_("To guides")); + _to_guides_item->set_icon_name(INKSCAPE_ICON("guides")); + _to_guides_item->signal_clicked().connect(sigc::mem_fun(*this, &MeasureToolbar::to_guides)); + add(*_to_guides_item); + } + + /* to item */ + { + _to_item_item = Gtk::manage(new Gtk::ToolButton(_("Convert to item"))); + _to_item_item->set_tooltip_text(_("Convert to item")); + _to_item_item->set_icon_name(INKSCAPE_ICON("path-reverse")); + _to_item_item->signal_clicked().connect(sigc::mem_fun(*this, &MeasureToolbar::to_item)); + add(*_to_item_item); } + /* to mark dimensions */ { - InkAction* act = ink_action_new( "MeasureMarkDimension", - _("Mark Dimension"), - _("Mark Dimension"), - INKSCAPE_ICON("tool-pointer"), - secondarySize ); - g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_to_mark_dimension), 0 ); - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + _mark_dimension_item = Gtk::manage(new Gtk::ToolButton(_("Mark Dimension"))); + _mark_dimension_item->set_tooltip_text(_("Mark Dimension")); + _mark_dimension_item->set_icon_name(INKSCAPE_ICON("tool-pointer")); + _mark_dimension_item->signal_clicked().connect(sigc::mem_fun(*this, &MeasureToolbar::to_mark_dimension)); + add(*_mark_dimension_item); } - /* to item */ + + /* Offset */ { - InkAction* act = ink_action_new( "MeasureToItem", - _("Convert to item"), - _("Convert to item"), - INKSCAPE_ICON("path-reverse"), - secondarySize ); - g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_to_item), 0 ); - gtk_action_group_add_action( mainActions, GTK_ACTION(act) ); + auto offset_val = prefs->getDouble("/tools/measure/offset", 5.0); + _offset_adj = Gtk::Adjustment::create(offset_val, 0.0, 90000.0, 1.0, 4.0); + auto offset_item = Gtk::manage(new UI::Widget::SpinButtonToolItem("measure-offset", _("Offset:"), _offset_adj, 0, 2)); + offset_item->set_tooltip_text(_("Mark dimension offset")); + offset_item->set_focus_widget(Glib::wrap(GTK_WIDGET(desktop->canvas))); + _offset_adj->signal_value_changed().connect(sigc::mem_fun(*this, &MeasureToolbar::offset_value_changed)); + add(*offset_item); } - return GTK_WIDGET(holder->gobj()); + show_all(); +} + +GtkWidget * +MeasureToolbar::create(SPDesktop * desktop) +{ + auto toolbar = new MeasureToolbar(desktop); + return GTK_WIDGET(toolbar->gobj()); } // MeasureToolbar::prep() void @@ -477,6 +306,136 @@ MeasureToolbar::offset_value_changed() } } +void +MeasureToolbar::toggle_only_selected() +{ + auto prefs = Inkscape::Preferences::get(); + bool active = _only_selected_item->get_active(); + prefs->setBool("/tools/measure/only_selected", active); + if ( active ) { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Measures only selected.")); + } else { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Measure all.")); + } + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->showCanvasItems(); + } +} + +void +MeasureToolbar::toggle_ignore_1st_and_last() +{ + auto prefs = Inkscape::Preferences::get(); + bool active = _ignore_1st_and_last_item->get_active(); + prefs->setBool("/tools/measure/ignore_1st_and_last", active); + if ( active ) { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Start and end measures inactive.")); + } else { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Start and end measures active.")); + } + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->showCanvasItems(); + } +} + +void +MeasureToolbar::toggle_show_in_between() +{ + auto prefs = Inkscape::Preferences::get(); + bool active = _inbetween_item->get_active(); + prefs->setBool("/tools/measure/show_in_between", active); + if ( active ) { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Compute all elements.")); + } else { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Compute max length.")); + } + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->showCanvasItems(); + } +} + +void +MeasureToolbar::toggle_show_hidden() +{ + auto prefs = Inkscape::Preferences::get(); + bool active = _show_hidden_item->get_active(); + prefs->setBool("/tools/measure/show_hidden", active); + if ( active ) { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Show all crossings.")); + } else { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Show visible crossings.")); + } + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->showCanvasItems(); + } +} + +void +MeasureToolbar::toggle_all_layers() +{ + auto prefs = Inkscape::Preferences::get(); + bool active = _all_layers_item->get_active(); + prefs->setBool("/tools/measure/all_layers", active); + if ( active ) { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Use all layers in the measure.")); + } else { + _desktop->messageStack()->flash(Inkscape::INFORMATION_MESSAGE, _("Use current layer in the measure.")); + } + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->showCanvasItems(); + } +} + +void +MeasureToolbar::reverse_knots() +{ + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->reverseKnots(); + } +} + +void +MeasureToolbar::to_phantom() +{ + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->toPhantom(); + } +} + +void +MeasureToolbar::to_guides() +{ + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->toGuides(); + } +} + +void +MeasureToolbar::to_item() +{ + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->toItem(); + } +} + +void +MeasureToolbar::to_mark_dimension() +{ + MeasureTool *mt = get_measure_tool(); + if (mt) { + mt->toMarkDimension(); + } +} + } } } diff --git a/src/ui/toolbar/measure-toolbar.h b/src/ui/toolbar/measure-toolbar.h index fd11ab425..a922fa15e 100644 --- a/src/ui/toolbar/measure-toolbar.h +++ b/src/ui/toolbar/measure-toolbar.h @@ -34,8 +34,6 @@ class SPDesktop; -typedef struct _GtkActionGroup GtkActionGroup; - namespace Inkscape { namespace UI { namespace Widget { @@ -51,17 +49,39 @@ private: Glib::RefPtr<Gtk::Adjustment> _scale_adj; Glib::RefPtr<Gtk::Adjustment> _offset_adj; + Gtk::ToggleToolButton *_only_selected_item; + Gtk::ToggleToolButton *_ignore_1st_and_last_item; + Gtk::ToggleToolButton *_inbetween_item; + Gtk::ToggleToolButton *_show_hidden_item; + Gtk::ToggleToolButton *_all_layers_item; + + Gtk::ToolButton *_reverse_item; + Gtk::ToolButton *_to_phantom_item; + Gtk::ToolButton *_to_guides_item; + Gtk::ToolButton *_to_item_item; + Gtk::ToolButton *_mark_dimension_item; + void fontsize_value_changed(); void unit_changed(int notUsed); void precision_value_changed(); void scale_value_changed(); void offset_value_changed(); + void toggle_only_selected(); + void toggle_ignore_1st_and_last(); + void toggle_show_hidden(); + void toggle_show_in_between(); + void toggle_all_layers(); + void reverse_knots(); + void to_phantom(); + void to_guides(); + void to_item(); + void to_mark_dimension(); protected: MeasureToolbar(SPDesktop *desktop); public: - static GtkWidget * prep(SPDesktop *desktop, GtkActionGroup* mainActions); + static GtkWidget * create(SPDesktop *desktop); }; } diff --git a/src/widgets/CMakeLists.txt b/src/widgets/CMakeLists.txt index c41fcdb03..0102d1085 100644 --- a/src/widgets/CMakeLists.txt +++ b/src/widgets/CMakeLists.txt @@ -4,7 +4,6 @@ add_subdirectory(gimp) set(widgets_SRC desktop-widget.cpp ege-adjustment-action.cpp - ege-output-action.cpp ege-paint-def.cpp fill-style.cpp gradient-image.cpp @@ -30,7 +29,6 @@ set(widgets_SRC # Headers desktop-widget.h ege-adjustment-action.h - ege-output-action.h ege-paint-def.h fill-n-stroke-factory.h fill-style.h diff --git a/src/widgets/ege-output-action.cpp b/src/widgets/ege-output-action.cpp deleted file mode 100644 index 773629468..000000000 --- a/src/widgets/ege-output-action.cpp +++ /dev/null @@ -1,259 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MPL-1.1 OR LGPL-2.1-or-later -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is EGE Output Action. - * - * The Initial Developer of the Original Code is - * Jon A. Cruz. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/* Note: this file should be kept compilable as both .cpp and .c */ - -#include <cstring> - -#include <gtk/gtk.h> -#include <gtkmm/container.h> -#include <gtkmm/label.h> - -#include "widgets/ege-output-action.h" - - -static void ege_output_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec ); -static void ege_output_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec ); -static void fixup_labels( GObject *gobject, GParamSpec *arg1, gpointer user_data ); - -/* static GtkWidget* create_menu_item( GtkAction* action ); */ -static GtkWidget* create_tool_item( GtkAction* action ); - -typedef struct { - gboolean useMarkup; -} EgeOutputActionPrivate; - -#define EGE_OUTPUT_ACTION_GET_PRIVATE( o ) \ - reinterpret_cast<EgeOutputActionPrivate *>(ege_output_action_get_instance_private (o)) - -enum { - PROP_USE_MARKUP = 1, -}; - -G_DEFINE_TYPE_WITH_PRIVATE(EgeOutputAction, ege_output_action, GTK_TYPE_ACTION); - -void ege_output_action_class_init( EgeOutputActionClass* klass ) -{ - if ( klass ) { - GObjectClass* objClass = G_OBJECT_CLASS( klass ); - - objClass->get_property = ege_output_action_get_property; - objClass->set_property = ege_output_action_set_property; - -/* klass->parent_class.create_menu_item = create_menu_item; */ - klass->parent_class.create_tool_item = create_tool_item; - - g_object_class_install_property( objClass, - PROP_USE_MARKUP, - g_param_spec_boolean( "use-markup", - "UseMarkup", - "If markup should be used", - FALSE, - (GParamFlags)(G_PARAM_READABLE | G_PARAM_WRITABLE | G_PARAM_CONSTRUCT) ) ); - } -} - - -void ege_output_action_init( EgeOutputAction* action ) -{ - auto priv = EGE_OUTPUT_ACTION_GET_PRIVATE( action ); - priv->useMarkup = FALSE; - - g_signal_connect( action, "notify", G_CALLBACK( fixup_labels ), NULL ); -} - -EgeOutputAction* ege_output_action_new( const gchar *name, - const gchar *label, - const gchar *tooltip, - const gchar *stock_id ) -{ - GObject* obj = (GObject*)g_object_new( EGE_OUTPUT_ACTION_TYPE, - "name", name, - "label", label, - "tooltip", tooltip, - "stock_id", stock_id, - "use-markup", FALSE, - NULL ); - - EgeOutputAction* action = EGE_OUTPUT_ACTION( obj ); - - return action; -} - -gboolean ege_output_action_get_use_markup( EgeOutputAction* action ) -{ - g_return_val_if_fail( IS_EGE_OUTPUT_ACTION(action), FALSE ); - auto priv = EGE_OUTPUT_ACTION_GET_PRIVATE( action ); - - return priv->useMarkup; -} - -void ege_output_action_set_use_markup( EgeOutputAction* action, gboolean setting ) -{ - g_object_set( G_OBJECT(action), "use-markup", setting, NULL ); -} - -void ege_output_action_get_property( GObject* obj, guint propId, GValue* value, GParamSpec * pspec ) -{ - EgeOutputAction* action = EGE_OUTPUT_ACTION( obj ); - auto priv = EGE_OUTPUT_ACTION_GET_PRIVATE( action ); - switch ( propId ) { - case PROP_USE_MARKUP: - g_value_set_boolean( value, priv->useMarkup ); - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID( obj, propId, pspec ); - } -} - -void ege_output_action_set_property( GObject* obj, guint propId, const GValue *value, GParamSpec* pspec ) -{ - EgeOutputAction* action = EGE_OUTPUT_ACTION( obj ); - auto priv = EGE_OUTPUT_ACTION_GET_PRIVATE( action ); - switch ( propId ) { - case PROP_USE_MARKUP: - { - priv->useMarkup = g_value_get_boolean( value ); - } - break; - - default: - G_OBJECT_WARN_INVALID_PROPERTY_ID( obj, propId, pspec ); - } -} - - -/* static GtkWidget* create_menu_item( GtkAction* action ) */ - -GtkWidget* create_tool_item( GtkAction* action ) -{ - GtkWidget* item = nullptr; - - if ( IS_EGE_OUTPUT_ACTION(action) ) - { - auto act = EGE_OUTPUT_ACTION (action); - auto priv = EGE_OUTPUT_ACTION_GET_PRIVATE( act ); - GValue value; - auto hb = gtk_box_new(GTK_ORIENTATION_HORIZONTAL, 5); - gtk_box_set_homogeneous(GTK_BOX(hb), FALSE); - GtkWidget* lbl = nullptr; - memset( &value, 0, sizeof(value) ); - - g_value_init( &value, G_TYPE_STRING ); - g_object_get_property( G_OBJECT(action), "short_label", &value ); - const gchar* sss = g_value_get_string( &value ); - - item = GTK_WIDGET( gtk_tool_item_new() ); - - lbl = gtk_label_new( " " ); - gtk_container_add( GTK_CONTAINER(hb), lbl ); - - if ( priv->useMarkup ) { - lbl = gtk_label_new(nullptr); - gtk_label_set_markup( GTK_LABEL(lbl), sss ? sss : " " ); - } else { - lbl = gtk_label_new( sss ? sss : " " ); - } - gtk_container_add( GTK_CONTAINER(hb), lbl ); - - lbl = gtk_label_new( " " ); - gtk_container_add( GTK_CONTAINER(hb), lbl ); - - gtk_container_add( GTK_CONTAINER(item), hb ); - - gtk_widget_show_all( item ); - - g_value_unset( &value ); - } else { - item = GTK_ACTION_CLASS(ege_output_action_parent_class)->create_tool_item( action ); - } - - return item; -} - -void fixup_labels( GObject *gobject, GParamSpec *arg1, gpointer user_data ) -{ - /* TODO: handle 'use-markup' getting changed also */ - - if ( arg1 && arg1->name && (strcmp("label", arg1->name) == 0) ) { - GSList* proxies = gtk_action_get_proxies( GTK_ACTION(gobject) ); - gchar* str = nullptr; - g_object_get( gobject, "label", &str, NULL ); - Glib::ustring str2(str); - (void)user_data; - while ( proxies ) { - if ( GTK_IS_TOOL_ITEM(proxies->data) ) { - /* Search for the things we built up in create_tool_item() */ - std::vector<Gtk::Widget*> children = Glib::wrap(GTK_CONTAINER(proxies->data))->get_children(); - if ( !children.empty() ) { - if ( GTK_IS_BOX(children[0]->gobj()) ) { - children = dynamic_cast<Gtk::Container *>(children[0])->get_children(); - if ( children.size()>1 ) { - Gtk::Widget *child = children[1]; - if ( GTK_IS_LABEL(child->gobj()) ) { - Gtk::Label* lbl = dynamic_cast<Gtk::Label *>(child); - auto action = EGE_OUTPUT_ACTION(gobject); - auto priv = EGE_OUTPUT_ACTION_GET_PRIVATE( action ); - if ( priv->useMarkup ) { - lbl->set_markup(str2); - } else { - lbl->set_text(str2); - } - } - } - } - } - } - proxies = g_slist_next( proxies ); - } - g_free( str ); - } -} -/* - Local Variables: - mode:c++ - c-file-style:"stroustrup" - c-file-offsets:((innamespace . 0)(inline-open . 0)(case-label . +)) - indent-tabs-mode:nil - fill-column:99 - End: -*/ -// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 : diff --git a/src/widgets/ege-output-action.h b/src/widgets/ege-output-action.h deleted file mode 100644 index 47acad0db..000000000 --- a/src/widgets/ege-output-action.h +++ /dev/null @@ -1,121 +0,0 @@ -// SPDX-License-Identifier: GPL-2.0-or-later OR MPL-1.1 OR LGPL-2.1-or-later -#ifndef SEEN_EGE_OUTPUT_ACTION -#define SEEN_EGE_OUTPUT_ACTION -/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- - * - */ -/* ***** BEGIN LICENSE BLOCK ***** - * Version: MPL 1.1/GPL 2.0/LGPL 2.1 - * - * The contents of this file are subject to the Mozilla Public License Version - * 1.1 (the "License"); you may not use this file except in compliance with - * the License. You may obtain a copy of the License at - * http://www.mozilla.org/MPL/ - * - * Software distributed under the License is distributed on an "AS IS" basis, - * WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License - * for the specific language governing rights and limitations under the - * License. - * - * The Original Code is EGE Output Action. - * - * The Initial Developer of the Original Code is - * Jon A. Cruz. - * Portions created by the Initial Developer are Copyright (C) 2007 - * the Initial Developer. All Rights Reserved. - * - * Contributor(s): - * - * Alternatively, the contents of this file may be used under the terms of - * either the GNU General Public License Version 2 or later (the "GPL"), or - * the GNU Lesser General Public License Version 2.1 or later (the "LGPL"), - * in which case the provisions of the GPL or the LGPL are applicable instead - * of those above. If you wish to allow use of your version of this file only - * under the terms of either the GPL or the LGPL, and not to allow others to - * use your version of this file under the terms of the MPL, indicate your - * decision by deleting the provisions above and replace them with the notice - * and other provisions required by the GPL or the LGPL. If you do not delete - * the provisions above, a recipient may use your version of this file under - * the terms of any one of the MPL, the GPL or the LGPL. - * - * ***** END LICENSE BLOCK ***** */ - -/** \file - * GtkAction subclass that represents a string for output. - */ - -/* Note: this file should be kept compilable as both .cpp and .c */ - -#include <gtk/gtk.h> - -G_BEGIN_DECLS - - -#define EGE_OUTPUT_ACTION_TYPE ( ege_output_action_get_type() ) -#define EGE_OUTPUT_ACTION( obj ) ( G_TYPE_CHECK_INSTANCE_CAST( (obj), EGE_OUTPUT_ACTION_TYPE, EgeOutputAction) ) -#define EGE_OUTPUT_ACTION_CLASS( klass ) ( G_TYPE_CHECK_CLASS_CAST( (klass), EGE_OUTPUT_ACTION_TYPE, EgeOutputActionClass) ) -#define IS_EGE_OUTPUT_ACTION( obj ) ( G_TYPE_CHECK_INSTANCE_TYPE( (obj), EGE_OUTPUT_ACTION_TYPE) ) -#define IS_EGE_OUTPUT_ACTION_CLASS( klass ) ( G_TYPE_CHECK_CLASS_TYPE( (klass), EGE_OUTPUT_ACTION_TYPE) ) -#define EGE_OUTPUT_ACTION_GET_CLASS( obj ) ( G_TYPE_INSTANCE_GET_CLASS( (obj), EGE_OUTPUT_ACTION_TYPE, EgeOutputActionClass) ) - -typedef struct _EgeOutputAction EgeOutputAction; -typedef struct _EgeOutputActionClass EgeOutputActionClass; - -/** - * Instance structure of EgeOutputAction. - */ -struct _EgeOutputAction -{ - /** Parent instance structure. */ - GtkAction action; -}; - -/** - * Class structure of EgeOutputAction. - */ -struct _EgeOutputActionClass -{ - /** Parent class structure. */ - GtkActionClass parent_class; -}; - -/** Standard Gtk type function */ -GType ege_output_action_get_type( void ); - -/** - * Creates a new EgeOutputAction instance. - * This is a GtkAction subclass that displays a string. - * - * @param name Functional name for the action. - * @param label Display label for the action. - * @param tooltip Tooltip for the action. - * @param stock_id Icon id to use. - * - * @deprecated GtkActions are deprecated. Use a GtkLabel inside a GtkToolItem instead. - * The Inkscape::UI::Toolbar::Toolbar base class provides an add_label function - * to simplify this. - */ -EgeOutputAction* ege_output_action_new( const gchar *name, - const gchar *label, - const gchar *tooltip, - const gchar *stock_id ); - -/** - * Return whether or not the displayed text is interpreted as markup. - * - * @param action The action to fetch the markup state for. - * @return True if the text is to be interpreted as markup, false otherwise. - */ -gboolean ege_output_action_get_use_markup( EgeOutputAction* action ); - -/** - * Sets whether or not the displayed text is interpreted as markup. - * - * @param action The action to set the markup state for. - * @param setting True if the text is to be interpreted as markup, false otherwise. - */ -void ege_output_action_set_use_markup( EgeOutputAction* action, gboolean setting ); - -G_END_DECLS - -#endif /* SEEN_EGE_OUTPUT_ACTION */ diff --git a/src/widgets/toolbox.cpp b/src/widgets/toolbox.cpp index dda7d2eae..f4ffbbaf0 100644 --- a/src/widgets/toolbox.cpp +++ b/src/widgets/toolbox.cpp @@ -199,7 +199,7 @@ static struct { SP_VERB_INVALID, nullptr, nullptr}, { "/tools/zoom", "zoom_toolbox", Inkscape::UI::Toolbar::ZoomToolbar::create, nullptr, "ZoomToolbar", SP_VERB_INVALID, nullptr, nullptr}, - { "/tools/measure", "measure_toolbox", nullptr, Inkscape::UI::Toolbar::MeasureToolbar::prep, "MeasureToolbar", + { "/tools/measure", "measure_toolbox", Inkscape::UI::Toolbar::MeasureToolbar::create, nullptr, "MeasureToolbar", SP_VERB_INVALID, nullptr, nullptr}, { "/tools/shapes/star", "star_toolbox", Inkscape::UI::Toolbar::StarToolbar::create, nullptr, "StarToolbar", SP_VERB_CONTEXT_STAR_PREFS, "/tools/shapes/star", N_("Style of new stars")}, |
