diff options
Diffstat (limited to 'src/ui/dialog/livepatheffect-editor.cpp')
| -rw-r--r-- | src/ui/dialog/livepatheffect-editor.cpp | 42 |
1 files changed, 14 insertions, 28 deletions
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp index 3b87597c8..422ec10ae 100644 --- a/src/ui/dialog/livepatheffect-editor.cpp +++ b/src/ui/dialog/livepatheffect-editor.cpp @@ -27,6 +27,7 @@ #include "document.h" #include "document-undo.h" #include "gtkmm/widget.h" +#include "helper/action.h" #include "inkscape.h" #include "live_effects/effect.h" #include "live_effects/lpeobject.h" @@ -44,6 +45,7 @@ #include "ui/icon-names.h" #include "ui/widget/imagetoggler.h" #include "verbs.h" +#include "widgets/icon.h" #include "xml/node.h" #include "livepatheffect-add.h" @@ -68,6 +70,14 @@ static void lpeeditor_selection_modified (Inkscape::Selection * selection, guint lpeeditor->onSelectionChanged(selection); } +static void lpe_style_button(Gtk::Button& btn, char const* iconName) +{ + GtkWidget *child = sp_icon_new(Inkscape::ICON_SIZE_SMALL_TOOLBAR, iconName); + gtk_widget_show( child ); + btn.add(*Gtk::manage(Glib::wrap(child))); + btn.set_relief(Gtk::RELIEF_NONE); +} + /* * LivePathEffectEditor @@ -107,43 +117,19 @@ LivePathEffectEditor::LivePathEffectEditor() effectcontrol_frame.add(effectcontrol_vbox); button_add.set_tooltip_text(_("Add path effect")); -#if WITH_GTKMM_3_10 - button_add.set_image_from_icon_name(INKSCAPE_ICON("list-add"), Gtk::ICON_SIZE_SMALL_TOOLBAR); -#else - Gtk::Image *image_add = Gtk::manage(new Gtk::Image()); - image_add->set_from_icon_name(INKSCAPE_ICON("list-add"), Gtk::ICON_SIZE_SMALL_TOOLBAR); - button_add.set_image(*image_add); -#endif + lpe_style_button(button_add, INKSCAPE_ICON("list-add")); button_add.set_relief(Gtk::RELIEF_NONE); button_remove.set_tooltip_text(_("Delete current path effect")); -#if WITH_GTKMM_3_10 - button_remove.set_image_from_icon_name(INKSCAPE_ICON("list-remove"), Gtk::ICON_SIZE_SMALL_TOOLBAR); -#else - Gtk::Image *image_remove = Gtk::manage(new Gtk::Image()); - image_remove->set_from_icon_name(INKSCAPE_ICON("list-remove"), Gtk::ICON_SIZE_SMALL_TOOLBAR); - button_remove.set_image(*image_remove); -#endif + lpe_style_button(button_remove, INKSCAPE_ICON("list-remove")); button_remove.set_relief(Gtk::RELIEF_NONE); button_up.set_tooltip_text(_("Raise the current path effect")); -#if WITH_GTKMM_3_10 - button_up.set_image_from_icon_name(INKSCAPE_ICON("go-up"), Gtk::ICON_SIZE_SMALL_TOOLBAR); -#else - Gtk::Image *image_up = Gtk::manage(new Gtk::Image()); - image_up->set_from_icon_name(INKSCAPE_ICON("go-up"), Gtk::ICON_SIZE_SMALL_TOOLBAR); - button_up.set_image(*image_up); -#endif + lpe_style_button(button_up, INKSCAPE_ICON("go-up")); button_up.set_relief(Gtk::RELIEF_NONE); button_down.set_tooltip_text(_("Lower the current path effect")); -#if WITH_GTKMM_3_10 - button_down.set_image_from_icon_name(INKSCAPE_ICON("go-down"), Gtk::ICON_SIZE_SMALL_TOOLBAR); -#else - Gtk::Image *image_down = Gtk::manage(new Gtk::Image()); - image_down->set_from_icon_name(INKSCAPE_ICON("go-down"), Gtk::ICON_SIZE_SMALL_TOOLBAR); - button_down.set_image(*image_down); -#endif + lpe_style_button(button_down, INKSCAPE_ICON("go-down")); button_down.set_relief(Gtk::RELIEF_NONE); // Add toolbar items to toolbar |
