summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ui/dialog/document-properties.cpp55
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp42
-rw-r--r--src/ui/dialog/objects.cpp68
-rw-r--r--src/ui/dialog/tags.cpp33
-rw-r--r--src/ui/dialog/tags.h2
-rw-r--r--src/ui/dialog/xml-tree.cpp16
-rw-r--r--src/ui/widget/addtoicon.cpp17
-rw-r--r--src/ui/widget/addtoicon.h2
-rw-r--r--src/widgets/gradient-selector.cpp37
9 files changed, 84 insertions, 188 deletions
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index af7ca678a..f324f285d 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -87,6 +87,13 @@ static Inkscape::XML::NodeEventVector const _repr_events = {
NULL // order_changed
};
+static void docprops_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);
+}
DocumentProperties& DocumentProperties::getInstance()
{
@@ -615,22 +622,10 @@ void DocumentProperties::build_cms()
label_avail->set_markup (_("<b>Available Color Profiles:</b>"));
_link_btn.set_tooltip_text(_("Link Profile"));
-#if WITH_GTKMM_3_10
- _link_btn.set_image_from_icon_name(INKSCAPE_ICON("list-add"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- Gtk::Image *image_link = Gtk::manage(new Gtk::Image());
- image_link->set_from_icon_name(INKSCAPE_ICON("list-add"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- _link_btn.set_image(*image_link);
-#endif
+ docprops_style_button(_link_btn, INKSCAPE_ICON("list-add"));
_unlink_btn.set_tooltip_text(_("Unlink Profile"));
-#if WITH_GTKMM_3_10
- _unlink_btn.set_image_from_icon_name(INKSCAPE_ICON("list-remove"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- Gtk::Image *image_unlink = Gtk::manage(new Gtk::Image());
- image_unlink->set_from_icon_name(INKSCAPE_ICON("list-remove"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- _unlink_btn.set_image(*image_unlink);
-#endif
+ docprops_style_button(_unlink_btn, INKSCAPE_ICON("list-remove"));
_page_cms->set_spacing(4);
gint row = 0;
@@ -752,22 +747,10 @@ void DocumentProperties::build_scripting()
label_external->set_markup (_("<b>External script files:</b>"));
_external_add_btn.set_tooltip_text(_("Add the current file name or browse for a file"));
-#if WITH_GTKMM_3_10
- _external_add_btn.set_image_from_icon_name(INKSCAPE_ICON("list-add"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- Gtk::Image *image_ext_add = Gtk::manage(new Gtk::Image());
- image_ext_add->set_from_icon_name(INKSCAPE_ICON("list-add"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- _external_add_btn.set_image(*image_ext_add);
-#endif
+ docprops_style_button(_external_add_btn, INKSCAPE_ICON("list-add"));
_external_remove_btn.set_tooltip_text(_("Remove"));
-#if WITH_GTKMM_3_10
- _external_remove_btn.set_image_from_icon_name(INKSCAPE_ICON("list-remove"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- Gtk::Image *image_ext_rm = Gtk::manage(new Gtk::Image());
- image_ext_rm->set_from_icon_name(INKSCAPE_ICON("list-remove"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- _external_remove_btn.set_image(*image_ext_rm);
-#endif
+ docprops_style_button(_external_remove_btn, INKSCAPE_ICON("list-remove"));
_page_external_scripts->set_spacing(4);
gint row = 0;
@@ -841,22 +824,10 @@ void DocumentProperties::build_scripting()
label_embedded->set_markup (_("<b>Embedded script files:</b>"));
_embed_new_btn.set_tooltip_text(_("New"));
-#if WITH_GTKMM_3_10
- _embed_new_btn.set_image_from_icon_name(INKSCAPE_ICON("list-add"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- Gtk::Image *image_embed_new = Gtk::manage(new Gtk::Image());
- image_embed_new->set_from_icon_name(INKSCAPE_ICON("list-add"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- _embed_new_btn.set_image(*image_embed_new);
-#endif
+ docprops_style_button(_embed_new_btn, INKSCAPE_ICON("list-add"));
_embed_remove_btn.set_tooltip_text(_("Remove"));
-#if WITH_GTKMM_3_10
- _embed_remove_btn.set_image_from_icon_name(INKSCAPE_ICON("list-remove"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- Gtk::Image *image_embed_rm = Gtk::manage(new Gtk::Image());
- image_embed_rm->set_from_icon_name(INKSCAPE_ICON("list-remove"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- _embed_remove_btn.set_image(*image_embed_rm);
-#endif
+ docprops_style_button(_embed_remove_btn, INKSCAPE_ICON("list-remove"));
#if !WITH_GTKMM_3_0
// TODO: This has been removed from Gtkmm 3.0. Check that
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
diff --git a/src/ui/dialog/objects.cpp b/src/ui/dialog/objects.cpp
index c95529a56..9db0285d7 100644
--- a/src/ui/dialog/objects.cpp
+++ b/src/ui/dialog/objects.cpp
@@ -231,15 +231,13 @@ public:
/**
* Stylizes a button using the given icon name and tooltip
*/
-void ObjectsPanel::_styleButton( Gtk::Button& btn, char const* iconName, char const* tooltip )
+void ObjectsPanel::_styleButton(Gtk::Button& btn, char const* iconName, char const* tooltip)
{
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);
-
btn.set_tooltip_text (tooltip);
-
}
/**
@@ -1799,29 +1797,14 @@ ObjectsPanel::ObjectsPanel() :
//Add object/layer
Gtk::Button* btn = Gtk::manage( new Gtk::Button() );
- btn->set_tooltip_text(_("Add layer..."));
-#if GTK_CHECK_VERSION(3,10,0)
- btn->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);
- btn->set_image(*image_add);
-#endif
+ _styleButton(*btn, INKSCAPE_ICON("list-add"), _("Add layer..."));
btn->set_relief(Gtk::RELIEF_NONE);
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_NEW) );
_buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK);
-
//Remove object
btn = Gtk::manage( new Gtk::Button() );
- btn->set_tooltip_text(_("Remove object"));
-#if GTK_CHECK_VERSION(3,10,0)
- btn->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);
- btn->set_image(*image_remove);
-#endif
+ _styleButton(*btn, INKSCAPE_ICON("list-remove"), _("Remove object"));
btn->set_relief(Gtk::RELIEF_NONE);
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_DELETE) );
_watching.push_back( btn );
@@ -1829,14 +1812,7 @@ ObjectsPanel::ObjectsPanel() :
//Move to bottom
btn = Gtk::manage( new Gtk::Button() );
- btn->set_tooltip_text(_("Move To Bottom"));
-#if GTK_CHECK_VERSION(3,10,0)
- btn->set_image_from_icon_name(INKSCAPE_ICON("go-bottom"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- image_remove = Gtk::manage(new Gtk::Image());
- image_remove->set_from_icon_name(INKSCAPE_ICON("go-bottom"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- btn->set_image(*image_remove);
-#endif
+ _styleButton(*btn, INKSCAPE_ICON("go-bottom"), _("Move To Bottom"));
btn->set_relief(Gtk::RELIEF_NONE);
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_BOTTOM) );
_watchingNonBottom.push_back( btn );
@@ -1844,14 +1820,7 @@ ObjectsPanel::ObjectsPanel() :
//Move down
btn = Gtk::manage( new Gtk::Button() );
- btn->set_tooltip_text(_("Move Down"));
-#if GTK_CHECK_VERSION(3,10,0)
- btn->set_image_from_icon_name(INKSCAPE_ICON("go-down"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- image_remove = Gtk::manage(new Gtk::Image());
- image_remove->set_from_icon_name(INKSCAPE_ICON("go-down"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- btn->set_image(*image_remove);
-#endif
+ _styleButton(*btn, INKSCAPE_ICON("go-down"), _("Move Down"));
btn->set_relief(Gtk::RELIEF_NONE);
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_DOWN) );
_watchingNonBottom.push_back( btn );
@@ -1859,14 +1828,7 @@ ObjectsPanel::ObjectsPanel() :
//Move up
btn = Gtk::manage( new Gtk::Button() );
- btn->set_tooltip_text(_("Move Up"));
-#if GTK_CHECK_VERSION(3,10,0)
- btn->set_image_from_icon_name(INKSCAPE_ICON("go-up"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- image_remove = Gtk::manage(new Gtk::Image());
- image_remove->set_from_icon_name(INKSCAPE_ICON("go-up"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- btn->set_image(*image_remove);
-#endif
+ _styleButton(*btn, INKSCAPE_ICON("go-up"), _("Move Up"));
btn->set_relief(Gtk::RELIEF_NONE);
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_UP) );
_watchingNonTop.push_back( btn );
@@ -1874,14 +1836,7 @@ ObjectsPanel::ObjectsPanel() :
//Move to top
btn = Gtk::manage( new Gtk::Button() );
- btn->set_tooltip_text(_("Move To Top"));
-#if GTK_CHECK_VERSION(3,10,0)
- btn->set_image_from_icon_name(INKSCAPE_ICON("go-top"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- image_remove = Gtk::manage(new Gtk::Image());
- image_remove->set_from_icon_name(INKSCAPE_ICON("go-top"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- btn->set_image(*image_remove);
-#endif
+ _styleButton(*btn, INKSCAPE_ICON("go-top"), _("Move To Top"));
btn->set_relief(Gtk::RELIEF_NONE);
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_TOP) );
_watchingNonTop.push_back( btn );
@@ -1889,14 +1844,7 @@ ObjectsPanel::ObjectsPanel() :
//Collapse all
btn = Gtk::manage( new Gtk::Button() );
- btn->set_tooltip_text(_("Collapse All"));
-#if GTK_CHECK_VERSION(3,10,0)
- btn->set_image_from_icon_name(INKSCAPE_ICON("gtk-unindent-ltr"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
-#else
- image_remove = Gtk::manage(new Gtk::Image());
- image_remove->set_from_icon_name(INKSCAPE_ICON("gtk-unindent-ltr"), Gtk::ICON_SIZE_SMALL_TOOLBAR);
- btn->set_image(*image_remove);
-#endif
+ _styleButton(*btn, INKSCAPE_ICON("format-indent-less"), _("Collapse All"));
btn->set_relief(Gtk::RELIEF_NONE);
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &ObjectsPanel::_takeAction), (int)BUTTON_COLLAPSE_ALL) );
_watchingNonBottom.push_back( btn );
diff --git a/src/ui/dialog/tags.cpp b/src/ui/dialog/tags.cpp
index 8a104d137..7d3edaffb 100644
--- a/src/ui/dialog/tags.cpp
+++ b/src/ui/dialog/tags.cpp
@@ -145,31 +145,12 @@ public:
int _actionCode;
};
-void TagsPanel::_styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned int code, char const* iconName, char const* tooltip )
+void TagsPanel::_styleButton(Gtk::Button& btn, char const* iconName, char const* tooltip)
{
- bool set = false;
-
- if ( iconName ) {
- GtkWidget *child = sp_icon_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, iconName );
- gtk_widget_show( child );
- btn.add( *manage(Glib::wrap(child)) );
- btn.set_relief(Gtk::RELIEF_NONE);
- set = true;
- }
-
- if ( desktop ) {
- Verb *verb = Verb::get( code );
- if ( verb ) {
- SPAction *action = verb->get_action(desktop);
- if ( !set && action && action->image ) {
- GtkWidget *child = sp_icon_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, action->image );
- gtk_widget_show( child );
- btn.add( *manage(Glib::wrap(child)) );
- set = true;
- }
- }
- }
-
+ GtkWidget *child = sp_icon_new(Inkscape::ICON_SIZE_SMALL_TOOLBAR, iconName);
+ gtk_widget_show(child);
+ btn.add(*manage(Glib::wrap(child)));
+ btn.set_relief(Gtk::RELIEF_NONE);
btn.set_tooltip_text (tooltip);
}
@@ -1013,7 +994,7 @@ TagsPanel::TagsPanel() :
SPDesktop* targetDesktop = getDesktop();
Gtk::Button* btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_TAG_NEW, GTK_STOCK_ADD, _("Add a new selection set") );
+ _styleButton(*btn, "list-add", _("Add a new selection set") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &TagsPanel::_takeAction), (int)BUTTON_NEW) );
_buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK);
@@ -1022,7 +1003,7 @@ TagsPanel::TagsPanel() :
// _buttonsRow.add( *btn );
btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_LAYER_DELETE, GTK_STOCK_REMOVE, _("Remove Item/Set") );
+ _styleButton( *btn, "list-remove", _("Remove Item/Set") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &TagsPanel::_takeAction), (int)BUTTON_DELETE) );
_watching.push_back( btn );
_buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK);
diff --git a/src/ui/dialog/tags.h b/src/ui/dialog/tags.h
index d35dfba01..3576bd111 100644
--- a/src/ui/dialog/tags.h
+++ b/src/ui/dialog/tags.h
@@ -62,7 +62,7 @@ private:
TagsPanel(TagsPanel const &); // no copy
TagsPanel &operator=(TagsPanel const &); // no assign
- void _styleButton( Gtk::Button& btn, SPDesktop *desktop, unsigned int code, char const* iconName, char const* tooltip );
+ void _styleButton( Gtk::Button& btn, char const* iconName, char const* tooltip );
void _fireAction( unsigned int code );
Gtk::MenuItem& _addPopupItem( SPDesktop *desktop, unsigned int code, char const* iconName, char const* fallback, int id );
diff --git a/src/ui/dialog/xml-tree.cpp b/src/ui/dialog/xml-tree.cpp
index c02520218..99a4acc69 100644
--- a/src/ui/dialog/xml-tree.cpp
+++ b/src/ui/dialog/xml-tree.cpp
@@ -71,10 +71,10 @@ XmlTree::XmlTree (void) :
xml_text_new_button ( _("New text node")),
xml_node_delete_button ( Q_("nodeAsInXMLdialogTooltip|Delete node")),
xml_node_duplicate_button ( _("Duplicate node")),
- unindent_node_button (Gtk::Stock::UNINDENT),
- indent_node_button (Gtk::Stock::INDENT),
- raise_node_button (Gtk::Stock::GO_UP),
- lower_node_button (Gtk::Stock::GO_DOWN),
+ unindent_node_button(),
+ indent_node_button(),
+ raise_node_button(),
+ lower_node_button(),
attr_toolbar(),
xml_attribute_delete_button (_("Delete attribute")),
text_container (),
@@ -149,21 +149,29 @@ XmlTree::XmlTree (void) :
tree_toolbar.add(separator2);
+ unindent_node_button.set_icon_widget(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_LARGE_TOOLBAR, INKSCAPE_ICON("format-indent-less")))));
unindent_node_button.set_label(_("Unindent node"));
unindent_node_button.set_tooltip_text(_("Unindent node"));
unindent_node_button.set_sensitive(false);
tree_toolbar.add(unindent_node_button);
+ indent_node_button.set_icon_widget(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_LARGE_TOOLBAR, INKSCAPE_ICON("format-indent-more")))));
indent_node_button.set_label(_("Indent node"));
indent_node_button.set_tooltip_text(_("Indent node"));
indent_node_button.set_sensitive(false);
tree_toolbar.add(indent_node_button);
+ raise_node_button.set_icon_widget(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_LARGE_TOOLBAR, INKSCAPE_ICON("go-up")))));
raise_node_button.set_label(_("Raise node"));
raise_node_button.set_tooltip_text(_("Raise node"));
raise_node_button.set_sensitive(false);
tree_toolbar.add(raise_node_button);
+ lower_node_button.set_icon_widget(*Gtk::manage(Glib::wrap(
+ sp_icon_new (Inkscape::ICON_SIZE_LARGE_TOOLBAR, INKSCAPE_ICON("go-down")))));
lower_node_button.set_label(_("Lower node"));
lower_node_button.set_tooltip_text(_("Lower node"));
lower_node_button.set_sensitive(false);
diff --git a/src/ui/widget/addtoicon.cpp b/src/ui/widget/addtoicon.cpp
index 0798d1c98..f15d7abf7 100644
--- a/src/ui/widget/addtoicon.cpp
+++ b/src/ui/widget/addtoicon.cpp
@@ -23,6 +23,7 @@
#include "widgets/icon.h"
#include "widgets/toolbox.h"
#include "ui/icon-names.h"
+#include "preferences.h"
#include "layertypeicon.h"
#include "addtoicon.h"
@@ -39,6 +40,7 @@ AddToIcon::AddToIcon() :
{
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
phys = sp_icon_get_phys_size((int)Inkscape::ICON_SIZE_BUTTON);
+
// Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
//
// if (!icon_theme->has_icon(_pixAddName)) {
@@ -50,7 +52,8 @@ AddToIcon::AddToIcon() :
//
// _property_pixbuf_add = Gtk::Widget::
- property_stock_id() = GTK_STOCK_ADD;
+ //property_stock_id() = GTK_STOCK_ADD;
+ set_pixbuf();
}
@@ -118,7 +121,7 @@ void AddToIcon::render_vfunc( const Glib::RefPtr<Gdk::Drawable>& window,
Gtk::CellRendererState flags )
#endif
{
- property_stock_id() = property_active().get_value() ? GTK_STOCK_ADD : GTK_STOCK_DELETE;
+ set_pixbuf();
#if WITH_GTKMM_3_0
Gtk::CellRendererPixbuf::render_vfunc( cr, widget, background_area, cell_area, flags );
@@ -137,6 +140,14 @@ bool AddToIcon::activate_vfunc(GdkEvent* /*event*/,
return false;
}
+void AddToIcon::set_pixbuf()
+{
+ bool active = property_active().get_value();
+
+ GdkPixbuf *pixbuf = sp_pixbuf_new(Inkscape::ICON_SIZE_BUTTON, active ? INKSCAPE_ICON("list-add") : INKSCAPE_ICON("edit-delete"));
+ property_pixbuf() = Glib::wrap(pixbuf);
+}
+
} // namespace Widget
} // namespace UI
@@ -152,5 +163,3 @@ bool AddToIcon::activate_vfunc(GdkEvent* /*event*/,
End:
*/
// vim: filetype=cpp:expandtab:shiftwidth=4:tabstop=8:softtabstop=4:fileencoding=utf-8:textwidth=99 :
-
-
diff --git a/src/ui/widget/addtoicon.h b/src/ui/widget/addtoicon.h
index 9c134d231..a8d900d1f 100644
--- a/src/ui/widget/addtoicon.h
+++ b/src/ui/widget/addtoicon.h
@@ -74,7 +74,7 @@ private:
Glib::Property<bool> _property_active;
// Glib::Property< Glib::RefPtr<Gdk::Pixbuf> > _property_pixbuf_add;
-
+ void set_pixbuf();
};
diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp
index a5e16aed2..42e59cbfe 100644
--- a/src/widgets/gradient-selector.cpp
+++ b/src/widgets/gradient-selector.cpp
@@ -30,6 +30,7 @@
#include "helper/action.h"
#include "helper/action-context.h"
#include "preferences.h"
+#include "widgets/icon.h"
#include <glibmm/i18n.h>
#include <xml/repr.h>
@@ -101,6 +102,15 @@ static void sp_gradient_selector_class_init(SPGradientSelectorClass *klass)
object_class->dispose = sp_gradient_selector_dispose;
}
+static void gradsel_style_button(GtkWidget *gtkbtn, char const *iconName)
+{
+ Gtk::Button *btn = Glib::wrap(GTK_BUTTON(gtkbtn));
+ GtkWidget *child = sp_icon_new(Inkscape::ICON_SIZE_SMALL_TOOLBAR, iconName);
+ gtk_widget_show(child);
+ btn->add(*manage(Glib::wrap(child)));
+ btn->set_relief(Gtk::RELIEF_NONE);
+}
+
static void sp_gradient_selector_init(SPGradientSelector *sel)
{
sel->safelyInit = true;
@@ -179,13 +189,8 @@ static void sp_gradient_selector_init(SPGradientSelector *sel)
//sel->nonsolid.push_back(hb);
gtk_box_pack_start( GTK_BOX(sel), hb, FALSE, FALSE, 0 );
-#if GTK_CHECK_VERSION(3,10,0)
- sel->add = gtk_button_new_from_icon_name(INKSCAPE_ICON("list-add"), GTK_ICON_SIZE_SMALL_TOOLBAR);
-#else
- sel->add = gtk_button_new ();
- GtkWidget *img = gtk_image_new_from_icon_name(INKSCAPE_ICON("list-add"), GTK_ICON_SIZE_SMALL_TOOLBAR);
- gtk_button_set_image(GTK_BUTTON(sel->add), img);
-#endif
+ sel->add = gtk_button_new();
+ gradsel_style_button(sel->add, INKSCAPE_ICON("list-add"));
sel->nonsolid.push_back(sel->add);
gtk_box_pack_start (GTK_BOX (hb), sel->add, FALSE, FALSE, 0);
@@ -196,13 +201,8 @@ static void sp_gradient_selector_init(SPGradientSelector *sel)
gtk_widget_set_tooltip_text( sel->add, _("Create a duplicate gradient"));
// FIXME: Probably better to either use something from the icon naming spec or ship our own "edit-gradient" icon
-#if GTK_CHECK_VERSION(3,10,0)
- sel->edit = gtk_button_new_from_icon_name(INKSCAPE_ICON("gtk-edit"), GTK_ICON_SIZE_SMALL_TOOLBAR);
-#else
- sel->edit = gtk_button_new ();
- img = gtk_image_new_from_icon_name(INKSCAPE_ICON("gtk-edit"), GTK_ICON_SIZE_SMALL_TOOLBAR);
- gtk_button_set_image(GTK_BUTTON(sel->edit), img);
-#endif
+ sel->edit = gtk_button_new();
+ gradsel_style_button(sel->edit, INKSCAPE_ICON("gtk-edit"));
sel->nonsolid.push_back(sel->edit);
gtk_box_pack_start (GTK_BOX (hb), sel->edit, FALSE, FALSE, 0);
@@ -211,13 +211,8 @@ static void sp_gradient_selector_init(SPGradientSelector *sel)
gtk_button_set_relief(GTK_BUTTON(sel->edit), GTK_RELIEF_NONE);
gtk_widget_set_tooltip_text( sel->edit, _("Edit gradient"));
-#if GTK_CHECK_VERSION(3,10,0)
- sel->del = gtk_button_new_from_icon_name(INKSCAPE_ICON("list-remove"), GTK_ICON_SIZE_SMALL_TOOLBAR);
-#else
sel->del = gtk_button_new ();
- img = gtk_image_new_from_icon_name(INKSCAPE_ICON("list-remove"), GTK_ICON_SIZE_SMALL_TOOLBAR);
- gtk_button_set_image(GTK_BUTTON(sel->del), img);
-#endif
+ gradsel_style_button(sel->del, INKSCAPE_ICON("list-remove"));
sel->swatch_widgets.push_back(sel->del);
gtk_box_pack_start (GTK_BOX (hb), sel->del, FALSE, FALSE, 0);
@@ -227,8 +222,6 @@ static void sp_gradient_selector_init(SPGradientSelector *sel)
gtk_widget_set_tooltip_text( sel->del, _("Delete swatch"));
gtk_widget_show_all(hb);
-
-
}
static void sp_gradient_selector_dispose(GObject *object)