summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorAlex Valavanis <valavanisalex@gmail.com>2014-01-02 17:34:58 +0000
committerAlex Valavanis <valavanisalex@gmail.com>2014-01-02 17:34:58 +0000
commitc862d2996b29dcace346d6c2e746672fd9d1949d (patch)
tree57f451ad381bb67b10a2b3e21419278a9c0c1400 /src
parentmemory leak fix (doc_title) + code readability (diff)
downloadinkscape-c862d2996b29dcace346d6c2e746672fd9d1949d.tar.gz
inkscape-c862d2996b29dcace346d6c2e746672fd9d1949d.zip
Fix Gtk+ 3.10 warnings: GtkStockItem is deprecated
(bzr r12868)
Diffstat (limited to 'src')
-rw-r--r--src/ege-adjustment-action.cpp21
-rw-r--r--src/ink-comboboxentry-action.cpp20
-rw-r--r--src/inkview.cpp38
-rw-r--r--src/interface.cpp2
-rw-r--r--src/live_effects/parameter/originalpath.cpp3
-rw-r--r--src/live_effects/parameter/path.cpp9
-rw-r--r--src/ui/dialog/document-properties.cpp50
-rw-r--r--src/ui/dialog/export.cpp4
-rw-r--r--src/ui/dialog/layers.cpp16
-rw-r--r--src/ui/dialog/livepatheffect-editor.cpp32
-rw-r--r--src/ui/dialog/ocaldialogs.cpp9
-rw-r--r--src/ui/dialog/text-edit.cpp10
-rw-r--r--src/verbs.cpp56
-rw-r--r--src/widgets/calligraphy-toolbar.cpp2
-rw-r--r--src/widgets/desktop-widget.cpp6
-rw-r--r--src/widgets/gradient-selector.cpp23
-rw-r--r--src/widgets/icon.cpp53
-rw-r--r--src/widgets/paintbucket-toolbar.cpp2
-rw-r--r--src/widgets/pencil-toolbar.cpp2
-rw-r--r--src/widgets/spiral-toolbar.cpp2
-rw-r--r--src/widgets/star-toolbar.cpp2
-rw-r--r--src/widgets/text-toolbar.cpp12
22 files changed, 229 insertions, 145 deletions
diff --git a/src/ege-adjustment-action.cpp b/src/ege-adjustment-action.cpp
index 7f844ec4b..7e92c1bec 100644
--- a/src/ege-adjustment-action.cpp
+++ b/src/ege-adjustment-action.cpp
@@ -48,6 +48,7 @@
#include "icon-size.h"
#include "ege-adjustment-action.h"
#include "ui/widget/gimpspinscale.h"
+#include "ui/icon-names.h"
static void ege_adjustment_action_finalize( GObject* object );
@@ -81,11 +82,11 @@ enum {
/* TODO need to have appropriate icons setup for these: */
static const gchar *floogles[] = {
- GTK_STOCK_REMOVE,
- GTK_STOCK_ADD,
- GTK_STOCK_GO_DOWN,
- GTK_STOCK_ABOUT,
- GTK_STOCK_GO_UP,
+ INKSCAPE_ICON("list-remove"),
+ INKSCAPE_ICON("list-add"),
+ INKSCAPE_ICON("go-down"),
+ INKSCAPE_ICON("help-about"),
+ INKSCAPE_ICON("go-up"),
0};
typedef struct _EgeAdjustmentDescr EgeAdjustmentDescr;
@@ -1100,3 +1101,13 @@ gboolean keypress_cb( GtkWidget *widget, GdkEventKey *event, gpointer data )
return wasConsumed;
}
+/*
+ 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/ink-comboboxentry-action.cpp b/src/ink-comboboxentry-action.cpp
index 320472347..06ccc3739 100644
--- a/src/ink-comboboxentry-action.cpp
+++ b/src/ink-comboboxentry-action.cpp
@@ -31,6 +31,7 @@
#include <gdk/gdkkeysyms.h>
#include "ink-comboboxentry-action.h"
+#include "ui/icon-names.h"
// Must handle both tool and menu items!
static GtkWidget* create_tool_item( GtkAction* action );
@@ -535,18 +536,9 @@ gboolean ink_comboboxentry_action_set_active_text( Ink_ComboBoxEntry_Action* act
if( action->warning != NULL ) {
Glib::ustring missing = check_comma_separated_text( action );
if( !missing.empty() ) {
-
- GtkStockItem item;
- gboolean isStock = gtk_stock_lookup( GTK_STOCK_DIALOG_WARNING, &item );
- if (isStock) {
- gtk_entry_set_icon_from_stock( action->entry,
- GTK_ENTRY_ICON_SECONDARY,
- GTK_STOCK_DIALOG_WARNING );
- } else {
gtk_entry_set_icon_from_icon_name( action->entry,
GTK_ENTRY_ICON_SECONDARY,
- GTK_STOCK_DIALOG_WARNING );
- }
+ INKSCAPE_ICON("dialog-warning") );
// Can't add tooltip until icon set
Glib::ustring warning = action->warning;
warning += ": ";
@@ -579,10 +571,7 @@ gboolean ink_comboboxentry_action_set_active_text( Ink_ComboBoxEntry_Action* act
if( !set && action->info != NULL ) {
gtk_entry_set_icon_from_icon_name( GTK_ENTRY(action->entry),
GTK_ENTRY_ICON_SECONDARY,
- GTK_STOCK_SELECT_ALL );
- gtk_entry_set_icon_from_stock( GTK_ENTRY(action->entry),
- GTK_ENTRY_ICON_SECONDARY,
- GTK_STOCK_SELECT_ALL );
+ INKSCAPE_ICON("edit-select-all") );
gtk_entry_set_icon_tooltip_text( action->entry,
GTK_ENTRY_ICON_SECONDARY,
action->info );
@@ -610,9 +599,6 @@ gboolean ink_comboboxentry_action_set_active_text( Ink_ComboBoxEntry_Action* act
gtk_entry_set_icon_from_icon_name( GTK_ENTRY(action->entry),
GTK_ENTRY_ICON_SECONDARY,
NULL );
- gtk_entry_set_icon_from_stock( GTK_ENTRY(action->entry),
- GTK_ENTRY_ICON_SECONDARY,
- NULL );
}
}
diff --git a/src/inkview.cpp b/src/inkview.cpp
index e65638df6..82bd08e34 100644
--- a/src/inkview.cpp
+++ b/src/inkview.cpp
@@ -70,6 +70,8 @@ Inkscape::Application *inkscape;
#define bind_textdomain_codeset(p,c)
#endif
+#include "ui/icon-names.h"
+
extern char *optarg;
extern int optind, opterr;
@@ -353,16 +355,44 @@ static GtkWidget* sp_svgview_control_show(struct SPSlideShow *ss)
#endif
gtk_container_add(GTK_CONTAINER(ctrlwin), t);
- GtkWidget *b = gtk_button_new_from_stock(GTK_STOCK_GOTO_FIRST);
+
+#if GTK_CHECK_VERSION(3,10,0)
+ GtkWidget *b = gtk_button_new_from_icon_name(INKSCAPE_ICON("go-first"), GTK_ICON_SIZE_BUTTON);
+#else
+ GtkWidget *b = gtk_button_new();
+ GtkWidget *img = gtk_image_new_from_icon_name(INKSCAPE_ICON("go-first"), GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image(GTK_BUTTON(b), img);
+#endif
gtk_container_add(GTK_CONTAINER(t), b);
+
g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_goto_first_cb, ss);
- b = gtk_button_new_from_stock(GTK_STOCK_GO_BACK);
+#if GTK_CHECK_VERSION(3,10,0)
+ b = gtk_button_new_from_icon_name(INKSCAPE_ICON("go-previous"), GTK_ICON_SIZE_BUTTON);
+#else
+ b = gtk_button_new();
+ img = gtk_image_new_from_icon_name(INKSCAPE_ICON("go-previous"), GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image(GTK_BUTTON(b), img);
+#endif
gtk_container_add(GTK_CONTAINER(t), b);
+
g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_prev_cb, ss);
- b = gtk_button_new_from_stock(GTK_STOCK_GO_FORWARD);
+#if GTK_CHECK_VERSION(3,10,0)
+ b = gtk_button_new_from_icon_name(INKSCAPE_ICON("go-next"), GTK_ICON_SIZE_BUTTON);
+#else
+ b = gtk_button_new();
+ img = gtk_image_new_from_icon_name(INKSCAPE_ICON("go-next"), GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image(GTK_BUTTON(b), img);
+#endif
gtk_container_add(GTK_CONTAINER(t), b);
+
g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_show_next_cb, ss);
- b = gtk_button_new_from_stock(GTK_STOCK_GOTO_LAST);
+#if GTK_CHECK_VERSION(3,10,0)
+ b = gtk_button_new_from_icon_name(INKSCAPE_ICON("go-last"), GTK_ICON_SIZE_BUTTON);
+#else
+ b = gtk_button_new();
+ img = gtk_image_new_from_icon_name(INKSCAPE_ICON("go-last"), GTK_ICON_SIZE_BUTTON);
+ gtk_button_set_image(GTK_BUTTON(b), img);
+#endif
gtk_container_add(GTK_CONTAINER(t), b);
g_signal_connect(G_OBJECT(b), "clicked", (GCallback) sp_svgview_goto_last_cb, ss);
gtk_widget_show_all(ctrlwin);
diff --git a/src/interface.cpp b/src/interface.cpp
index 5d4022e7b..881dbbc0c 100644
--- a/src/interface.cpp
+++ b/src/interface.cpp
@@ -1392,7 +1392,7 @@ sp_ui_overwrite_file(gchar const *filename)
dirName
);
gtk_dialog_add_buttons( GTK_DIALOG(dialog),
- GTK_STOCK_CANCEL, GTK_RESPONSE_NO,
+ _("_Cancel"), GTK_RESPONSE_NO,
_("Replace"), GTK_RESPONSE_YES,
NULL );
gtk_dialog_set_default_response( GTK_DIALOG(dialog), GTK_RESPONSE_YES );
diff --git a/src/live_effects/parameter/originalpath.cpp b/src/live_effects/parameter/originalpath.cpp
index 6e1d9476d..6c4f2a100 100644
--- a/src/live_effects/parameter/originalpath.cpp
+++ b/src/live_effects/parameter/originalpath.cpp
@@ -29,6 +29,7 @@
#include "inkscape.h"
#include "desktop-handles.h"
#include "selection.h"
+#include "ui/icon-names.h"
namespace Inkscape {
@@ -59,7 +60,7 @@ OriginalPathParam::param_newWidget()
}
{ // Paste path to link button
- Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon( GTK_STOCK_PASTE, Inkscape::ICON_SIZE_BUTTON) );
+ Gtk::Widget *pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) );
Gtk::Button *pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
diff --git a/src/live_effects/parameter/path.cpp b/src/live_effects/parameter/path.cpp
index 77f7eabcc..cdbbef1db 100644
--- a/src/live_effects/parameter/path.cpp
+++ b/src/live_effects/parameter/path.cpp
@@ -46,6 +46,7 @@
#include <gtkmm/button.h>
#include <gtkmm/label.h>
+#include "ui/icon-names.h"
namespace Inkscape {
@@ -153,7 +154,7 @@ PathParam::param_newWidget()
static_cast<Gtk::HBox*>(_widget)->pack_start(*pLabel, true, true);
pLabel->set_tooltip_text(param_tooltip);
- Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( "tool-node-editor", Inkscape::ICON_SIZE_BUTTON) );
+ Gtk::Widget* pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("tool-node-editor"), Inkscape::ICON_SIZE_BUTTON) );
Gtk::Button * pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
@@ -163,7 +164,7 @@ PathParam::param_newWidget()
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Edit on-canvas"));
- pIcon = Gtk::manage( sp_icon_get_icon( GTK_STOCK_COPY, Inkscape::ICON_SIZE_BUTTON) );
+ pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-copy"), Inkscape::ICON_SIZE_BUTTON) );
pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
@@ -173,7 +174,7 @@ PathParam::param_newWidget()
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Copy path"));
- pIcon = Gtk::manage( sp_icon_get_icon( GTK_STOCK_PASTE, Inkscape::ICON_SIZE_BUTTON) );
+ pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-paste"), Inkscape::ICON_SIZE_BUTTON) );
pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
@@ -183,7 +184,7 @@ PathParam::param_newWidget()
static_cast<Gtk::HBox*>(_widget)->pack_start(*pButton, true, true);
pButton->set_tooltip_text(_("Paste path"));
- pIcon = Gtk::manage( sp_icon_get_icon( "edit-clone", Inkscape::ICON_SIZE_BUTTON) );
+ pIcon = Gtk::manage( sp_icon_get_icon( INKSCAPE_ICON("edit-clone"), Inkscape::ICON_SIZE_BUTTON) );
pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();
diff --git a/src/ui/dialog/document-properties.cpp b/src/ui/dialog/document-properties.cpp
index 32f23d55f..d324d2d1b 100644
--- a/src/ui/dialog/document-properties.cpp
+++ b/src/ui/dialog/document-properties.cpp
@@ -57,6 +57,7 @@
#include <gtkmm/table.h>
#include <2geom/transforms.h>
+#include "ui/icon-names.h"
using std::pair;
@@ -609,10 +610,22 @@ void DocumentProperties::build_cms()
label_avail->set_markup (_("<b>Available Color Profiles:</b>"));
_link_btn.set_tooltip_text(_("Link Profile"));
- _link_btn.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_ADD, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ _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
_unlink_btn.set_tooltip_text(_("Unlink Profile"));
- _unlink_btn.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ _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
_page_cms->set_spacing(4);
gint row = 0;
@@ -734,11 +747,22 @@ 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"));
- _external_add_btn.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_ADD, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ _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
_external_remove_btn.set_tooltip_text(_("Remove"));
- _external_remove_btn.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
-
+#if GTK_CHECK_VERSION(3,10,0)
+ _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
_page_external_scripts->set_spacing(4);
gint row = 0;
@@ -812,10 +836,22 @@ void DocumentProperties::build_scripting()
label_embedded->set_markup (_("<b>Embedded script files:</b>"));
_embed_new_btn.set_tooltip_text(_("New"));
- _embed_new_btn.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_ADD, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ _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
_embed_remove_btn.set_tooltip_text(_("Remove"));
- _embed_remove_btn.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ _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
#if !WITH_GTKMM_3_0
// TODO: This has been removed from Gtkmm 3.0. Check that
diff --git a/src/ui/dialog/export.cpp b/src/ui/dialog/export.cpp
index 2cfdacb3d..e896b9840 100644
--- a/src/ui/dialog/export.cpp
+++ b/src/ui/dialog/export.cpp
@@ -1295,8 +1295,8 @@ void Export::onBrowse ()
fs = gtk_file_chooser_dialog_new (_("Select a filename for exporting"),
(GtkWindow*)desktop->getToplevel(),
GTK_FILE_CHOOSER_ACTION_SAVE,
- GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL,
- GTK_STOCK_SAVE, GTK_RESPONSE_ACCEPT,
+ _("_Cancel"), GTK_RESPONSE_CANCEL,
+ _("_Save"), GTK_RESPONSE_ACCEPT,
NULL );
#ifdef WITH_GNOME_VFS
diff --git a/src/ui/dialog/layers.cpp b/src/ui/dialog/layers.cpp
index 12fdf6b7d..381810f1e 100644
--- a/src/ui/dialog/layers.cpp
+++ b/src/ui/dialog/layers.cpp
@@ -881,30 +881,30 @@ LayersPanel::LayersPanel() :
SPDesktop* targetDesktop = getDesktop();
Gtk::Button* btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_LAYER_NEW, GTK_STOCK_ADD, C_("Layers", "New") );
+ _styleButton( *btn, targetDesktop, SP_VERB_LAYER_NEW, INKSCAPE_ICON("list-add"), C_("Layers", "New") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_NEW) );
_buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK);
btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_BOTTOM, GTK_STOCK_GOTO_BOTTOM, C_("Layers", "Bot") );
+ _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_BOTTOM, INKSCAPE_ICON("go-bottom"), C_("Layers", "Bot") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_BOTTOM) );
_watchingNonBottom.push_back( btn );
_buttonsPrimary.pack_end(*btn, Gtk::PACK_SHRINK);
btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_LAYER_LOWER, GTK_STOCK_GO_DOWN, C_("Layers", "Dn") );
+ _styleButton( *btn, targetDesktop, SP_VERB_LAYER_LOWER, INKSCAPE_ICON("go-down"), C_("Layers", "Dn") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_DOWN) );
_watchingNonBottom.push_back( btn );
_buttonsPrimary.pack_end(*btn, Gtk::PACK_SHRINK);
btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_LAYER_RAISE, GTK_STOCK_GO_UP, C_("Layers", "Up") );
+ _styleButton( *btn, targetDesktop, SP_VERB_LAYER_RAISE, INKSCAPE_ICON("go-up"), C_("Layers", "Up") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_UP) );
_watchingNonTop.push_back( btn );
_buttonsPrimary.pack_end(*btn, Gtk::PACK_SHRINK);
btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, GTK_STOCK_GOTO_TOP, C_("Layers", "Top") );
+ _styleButton( *btn, targetDesktop, SP_VERB_LAYER_TO_TOP, INKSCAPE_ICON("go-top"), C_("Layers", "Top") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_TOP) );
_watchingNonTop.push_back( btn );
_buttonsPrimary.pack_end(*btn, Gtk::PACK_SHRINK);
@@ -914,7 +914,7 @@ LayersPanel::LayersPanel() :
// _buttonsRow.add( *btn );
btn = manage( new Gtk::Button() );
- _styleButton( *btn, targetDesktop, SP_VERB_LAYER_DELETE, GTK_STOCK_REMOVE, _("X") );
+ _styleButton( *btn, targetDesktop, SP_VERB_LAYER_DELETE, INKSCAPE_ICON("list-remove"), _("X") );
btn->signal_clicked().connect( sigc::bind( sigc::mem_fun(*this, &LayersPanel::_takeAction), (int)BUTTON_DELETE) );
_watching.push_back( btn );
_buttonsSecondary.pack_start(*btn, Gtk::PACK_SHRINK);
@@ -944,8 +944,8 @@ LayersPanel::LayersPanel() :
_popupMenu.append(*manage(new Gtk::SeparatorMenuItem()));
- _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RAISE, GTK_STOCK_GO_UP, "Up", (int)BUTTON_UP ) );
- _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOWER, GTK_STOCK_GO_DOWN, "Down", (int)BUTTON_DOWN ) );
+ _watchingNonTop.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_RAISE, INKSCAPE_ICON("go-up"), "Up", (int)BUTTON_UP ) );
+ _watchingNonBottom.push_back( &_addPopupItem( targetDesktop, SP_VERB_LAYER_LOWER, INKSCAPE_ICON("go-down"), "Down", (int)BUTTON_DOWN ) );
_popupMenu.show_all_children();
}
diff --git a/src/ui/dialog/livepatheffect-editor.cpp b/src/ui/dialog/livepatheffect-editor.cpp
index 30b16cee0..b81b300e2 100644
--- a/src/ui/dialog/livepatheffect-editor.cpp
+++ b/src/ui/dialog/livepatheffect-editor.cpp
@@ -107,19 +107,43 @@ LivePathEffectEditor::LivePathEffectEditor()
effectcontrol_frame.add(effectcontrol_vbox);
button_add.set_tooltip_text(_("Add path effect"));
- button_add.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_ADD, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ 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
button_add.set_relief(Gtk::RELIEF_NONE);
button_remove.set_tooltip_text(_("Delete current path effect"));
- button_remove.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ 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
button_remove.set_relief(Gtk::RELIEF_NONE);
button_up.set_tooltip_text(_("Raise the current path effect"));
- button_up.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_GO_UP, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ 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
button_up.set_relief(Gtk::RELIEF_NONE);
button_down.set_tooltip_text(_("Lower the current path effect"));
- button_down.set_image(*manage(Glib::wrap(gtk_image_new_from_stock ( GTK_STOCK_GO_DOWN, GTK_ICON_SIZE_SMALL_TOOLBAR ) )));
+#if GTK_CHECK_VERSION(3,10,0)
+ 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
button_down.set_relief(Gtk::RELIEF_NONE);
// Add toolbar items to toolbar
diff --git a/src/ui/dialog/ocaldialogs.cpp b/src/ui/dialog/ocaldialogs.cpp
index 417df9a27..93fcab863 100644
--- a/src/ui/dialog/ocaldialogs.cpp
+++ b/src/ui/dialog/ocaldialogs.cpp
@@ -43,6 +43,7 @@
#include <glibmm/main.h>
#include <glibmm/markup.h>
#include <glibmm/miscutils.h>
+#include "ui/icon-names.h"
namespace Inkscape
{
@@ -578,8 +579,8 @@ SearchEntry::SearchEntry() : Gtk::Entry()
signal_changed().connect(sigc::mem_fun(*this, &SearchEntry::_on_changed));
signal_icon_press().connect(sigc::mem_fun(*this, &SearchEntry::_on_icon_pressed));
- set_icon_from_stock(Gtk::Stock::FIND, Gtk::ENTRY_ICON_PRIMARY);
- gtk_entry_set_icon_from_stock(gobj(), GTK_ENTRY_ICON_SECONDARY, NULL);
+ set_icon_from_icon_name(INKSCAPE_ICON("edit-find"), Gtk::ENTRY_ICON_PRIMARY);
+ gtk_entry_set_icon_from_icon_name(gobj(), GTK_ENTRY_ICON_SECONDARY, NULL);
}
void SearchEntry::_on_icon_pressed(Gtk::EntryIconPosition icon_position, const GdkEventButton* /*event*/)
@@ -596,9 +597,9 @@ void SearchEntry::_on_icon_pressed(Gtk::EntryIconPosition icon_position, const G
void SearchEntry::_on_changed()
{
if (get_text().empty()) {
- gtk_entry_set_icon_from_stock(gobj(), GTK_ENTRY_ICON_SECONDARY, NULL);
+ gtk_entry_set_icon_from_icon_name(gobj(), GTK_ENTRY_ICON_SECONDARY, NULL);
} else {
- set_icon_from_stock(Gtk::Stock::CLEAR, Gtk::ENTRY_ICON_SECONDARY);
+ set_icon_from_icon_name(INKSCAPE_ICON("edit-clear"), Gtk::ENTRY_ICON_SECONDARY);
}
}
#endif
diff --git a/src/ui/dialog/text-edit.cpp b/src/ui/dialog/text-edit.cpp
index 9124681a0..17c29c69f 100644
--- a/src/ui/dialog/text-edit.cpp
+++ b/src/ui/dialog/text-edit.cpp
@@ -94,10 +94,10 @@ TextEdit::TextEdit()
fontsel_hbox.pack_start(*Gtk::manage(Glib::wrap(fontsel)), true, true);
/* Align buttons */
- styleButton(&align_left, _("Align left"), GTK_STOCK_JUSTIFY_LEFT, NULL);
- styleButton(&align_center, _("Align center"), GTK_STOCK_JUSTIFY_CENTER, &align_left);
- styleButton(&align_right, _("Align right"), GTK_STOCK_JUSTIFY_RIGHT, &align_left);
- styleButton(&align_justify, _("Justify (only flowed text)"), GTK_STOCK_JUSTIFY_FILL, &align_left);
+ styleButton(&align_left, _("Align left"), INKSCAPE_ICON("format-justify-left"), NULL);
+ styleButton(&align_center, _("Align center"), INKSCAPE_ICON("format-justify-center"), &align_left);
+ styleButton(&align_right, _("Align right"), INKSCAPE_ICON("format-justify-right"), &align_left);
+ styleButton(&align_justify, _("Justify (only flowed text)"), INKSCAPE_ICON("format-justify-fill"), &align_left);
#if WITH_GTKMM_3_0
align_sep.set_orientation(Gtk::ORIENTATION_VERTICAL);
@@ -237,7 +237,7 @@ void TextEdit::styleButton(Gtk::RadioButton *button, gchar const *tooltip, gchar
{
GtkWidget *icon = sp_icon_new( Inkscape::ICON_SIZE_SMALL_TOOLBAR, icon_name );
if (!GTK_IS_IMAGE(icon)) {
- icon = gtk_image_new_from_stock ( icon_name, GTK_ICON_SIZE_SMALL_TOOLBAR );
+ icon = gtk_image_new_from_icon_name ( icon_name, GTK_ICON_SIZE_SMALL_TOOLBAR );
}
if (group_button) {
diff --git a/src/verbs.cpp b/src/verbs.cpp
index 329e63115..8b333383f 100644
--- a/src/verbs.cpp
+++ b/src/verbs.cpp
@@ -2353,19 +2353,19 @@ Verb *Verb::_base_verbs[] = {
// File
new FileVerb(SP_VERB_FILE_NEW, "FileNew", N_("Default"), N_("Create new document from the default template"),
- GTK_STOCK_NEW ),
+ INKSCAPE_ICON("document-new")),
new FileVerb(SP_VERB_FILE_OPEN, "FileOpen", N_("_Open..."),
- N_("Open an existing document"), GTK_STOCK_OPEN ),
+ N_("Open an existing document"), INKSCAPE_ICON("document-open")),
new FileVerb(SP_VERB_FILE_REVERT, "FileRevert", N_("Re_vert"),
- N_("Revert to the last saved version of document (changes will be lost)"), GTK_STOCK_REVERT_TO_SAVED ),
+ N_("Revert to the last saved version of document (changes will be lost)"), INKSCAPE_ICON("document-revert")),
new FileVerb(SP_VERB_FILE_SAVE, "FileSave", N_("_Save"), N_("Save document"),
- GTK_STOCK_SAVE ),
+ INKSCAPE_ICON("document-save")),
new FileVerb(SP_VERB_FILE_SAVE_AS, "FileSaveAs", N_("Save _As..."),
- N_("Save document under a new name"), GTK_STOCK_SAVE_AS ),
+ N_("Save document under a new name"), INKSCAPE_ICON("document-save-as")),
new FileVerb(SP_VERB_FILE_SAVE_A_COPY, "FileSaveACopy", N_("Save a Cop_y..."),
N_("Save a copy of the document under a new name"), NULL ),
new FileVerb(SP_VERB_FILE_PRINT, "FilePrint", N_("_Print..."), N_("Print document"),
- GTK_STOCK_PRINT ),
+ INKSCAPE_ICON("document-print")),
// TRANSLATORS: "Vacuum Defs" means "Clean up defs" (so as to remove unused definitions)
new FileVerb(SP_VERB_FILE_VACUUM, "FileVacuum", N_("Clean _up document"), N_("Remove unused definitions (such as gradients or clipping paths) from the &lt;defs&gt; of the document"),
INKSCAPE_ICON("document-cleanup") ),
@@ -2381,22 +2381,22 @@ Verb *Verb::_base_verbs[] = {
new FileVerb(SP_VERB_FILE_PREV_DESKTOP, "PrevWindow", N_("P_revious Window"),
N_("Switch to the previous document window"), INKSCAPE_ICON("window-previous")),
new FileVerb(SP_VERB_FILE_CLOSE_VIEW, "FileClose", N_("_Close"),
- N_("Close this document window"), GTK_STOCK_CLOSE),
- new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), GTK_STOCK_QUIT),
+ N_("Close this document window"), INKSCAPE_ICON("window-close")),
+ new FileVerb(SP_VERB_FILE_QUIT, "FileQuit", N_("_Quit"), N_("Quit Inkscape"), INKSCAPE_ICON("application-exit")),
new FileVerb(SP_VERB_FILE_TEMPLATES, "FileTemplates", N_("_Templates..."),
N_("Create new project from template"), INKSCAPE_ICON("dialog-templates")),
// Edit
new EditVerb(SP_VERB_EDIT_UNDO, "EditUndo", N_("_Undo"), N_("Undo last action"),
- GTK_STOCK_UNDO),
+ INKSCAPE_ICON("edit-undo")),
new EditVerb(SP_VERB_EDIT_REDO, "EditRedo", N_("_Redo"),
- N_("Do again the last undone action"), GTK_STOCK_REDO),
+ N_("Do again the last undone action"), INKSCAPE_ICON("edit-redo")),
new EditVerb(SP_VERB_EDIT_CUT, "EditCut", N_("Cu_t"),
- N_("Cut selection to clipboard"), GTK_STOCK_CUT),
+ N_("Cut selection to clipboard"), INKSCAPE_ICON("edit-cut")),
new EditVerb(SP_VERB_EDIT_COPY, "EditCopy", N_("_Copy"),
- N_("Copy selection to clipboard"), GTK_STOCK_COPY),
+ N_("Copy selection to clipboard"), INKSCAPE_ICON("edit-copy")),
new EditVerb(SP_VERB_EDIT_PASTE, "EditPaste", N_("_Paste"),
- N_("Paste objects from clipboard to mouse point, or paste text"), GTK_STOCK_PASTE),
+ N_("Paste objects from clipboard to mouse point, or paste text"), INKSCAPE_ICON("edit-paste")),
new EditVerb(SP_VERB_EDIT_PASTE_STYLE, "EditPasteStyle", N_("Paste _Style"),
N_("Apply the style of the copied object to selection"), INKSCAPE_ICON("edit-paste-style")),
new EditVerb(SP_VERB_EDIT_PASTE_SIZE, "EditPasteSize", N_("Paste Si_ze"),
@@ -2420,7 +2420,7 @@ Verb *Verb::_base_verbs[] = {
new EditVerb(SP_VERB_EDIT_REMOVE_FILTER, "RemoveFilter", N_("_Remove Filters"),
N_("Remove any filters from selected objects"), NULL),
new EditVerb(SP_VERB_EDIT_DELETE, "EditDelete", N_("_Delete"),
- N_("Delete selection"), GTK_STOCK_DELETE),
+ N_("Delete selection"), INKSCAPE_ICON("edit-delete")),
new EditVerb(SP_VERB_EDIT_DUPLICATE, "EditDuplicate", N_("Duplic_ate"),
N_("Duplicate selected objects"), INKSCAPE_ICON("edit-duplicate")),
new EditVerb(SP_VERB_EDIT_CLONE, "EditClone", N_("Create Clo_ne"),
@@ -2448,19 +2448,19 @@ Verb *Verb::_base_verbs[] = {
new EditVerb(SP_VERB_EDIT_CLEAR_ALL, "EditClearAll", N_("Clea_r All"),
N_("Delete all objects from document"), NULL),
new EditVerb(SP_VERB_EDIT_SELECT_ALL, "EditSelectAll", N_("Select Al_l"),
- N_("Select all objects or all nodes"), GTK_STOCK_SELECT_ALL),
+ N_("Select all objects or all nodes"), INKSCAPE_ICON("edit-select-all")),
new EditVerb(SP_VERB_EDIT_SELECT_ALL_IN_ALL_LAYERS, "EditSelectAllInAllLayers", N_("Select All in All La_yers"),
N_("Select all objects in all visible and unlocked layers"), INKSCAPE_ICON("edit-select-all-layers")),
new EditVerb(SP_VERB_EDIT_SELECT_SAME_FILL_STROKE, "EditSelectSameFillStroke", N_("Fill _and Stroke"),
- N_("Select all objects with the same fill and stroke as the selected objects"), GTK_STOCK_SELECT_ALL),
+ N_("Select all objects with the same fill and stroke as the selected objects"), INKSCAPE_ICON("edit-select-all")),
new EditVerb(SP_VERB_EDIT_SELECT_SAME_FILL_COLOR, "EditSelectSameFillColor", N_("_Fill Color"),
- N_("Select all objects with the same fill as the selected objects"), GTK_STOCK_SELECT_ALL),
+ N_("Select all objects with the same fill as the selected objects"), INKSCAPE_ICON("edit-select-all")),
new EditVerb(SP_VERB_EDIT_SELECT_SAME_STROKE_COLOR, "EditSelectSameStrokeColor", N_("_Stroke Color"),
- N_("Select all objects with the same stroke as the selected objects"), GTK_STOCK_SELECT_ALL),
+ N_("Select all objects with the same stroke as the selected objects"), INKSCAPE_ICON("edit-select-all")),
new EditVerb(SP_VERB_EDIT_SELECT_SAME_STROKE_STYLE, "EditSelectSameStrokeStyle", N_("Stroke St_yle"),
- N_("Select all objects with the same stroke style (width, dash, markers) as the selected objects"), GTK_STOCK_SELECT_ALL),
+ N_("Select all objects with the same stroke style (width, dash, markers) as the selected objects"), INKSCAPE_ICON("edit-select-all")),
new EditVerb(SP_VERB_EDIT_SELECT_SAME_OBJECT_TYPE, "EditSelectSameObjectType", N_("_Object Type"),
- N_("Select all objects with the same object type (rect, arc, text, path, bitmap etc) as the selected objects"), GTK_STOCK_SELECT_ALL),
+ N_("Select all objects with the same object type (rect, arc, text, path, bitmap etc) as the selected objects"), INKSCAPE_ICON("edit-select-all")),
new EditVerb(SP_VERB_EDIT_INVERT, "EditInvert", N_("In_vert Selection"),
N_("Invert selection (unselect what is selected and select everything else)"), INKSCAPE_ICON("edit-select-invert")),
new EditVerb(SP_VERB_EDIT_INVERT_IN_ALL_LAYERS, "EditInvertInAllLayers", N_("Invert in All Layers"),
@@ -2808,18 +2808,20 @@ Verb *Verb::_base_verbs[] = {
// Dialogs
new DialogVerb(SP_VERB_DIALOG_DISPLAY, "DialogPreferences", N_("P_references..."),
- N_("Edit global Inkscape preferences"), GTK_STOCK_PREFERENCES ),
+ N_("Edit global Inkscape preferences"), INKSCAPE_ICON("preferences-system")),
new DialogVerb(SP_VERB_DIALOG_NAMEDVIEW, "DialogDocumentProperties", N_("_Document Properties..."),
- N_("Edit properties of this document (to be saved with the document)"), GTK_STOCK_PROPERTIES ),
+ N_("Edit properties of this document (to be saved with the document)"), INKSCAPE_ICON("document-properties")),
new DialogVerb(SP_VERB_DIALOG_METADATA, "DialogMetadata", N_("Document _Metadata..."),
N_("Edit document metadata (to be saved with the document)"), INKSCAPE_ICON("document-metadata") ),
new DialogVerb(SP_VERB_DIALOG_FILL_STROKE, "DialogFillStroke", N_("_Fill and Stroke..."),
N_("Edit objects' colors, gradients, arrowheads, and other fill and stroke properties..."), INKSCAPE_ICON("dialog-fill-and-stroke")),
+ // FIXME: Probably better to either use something from the icon naming spec or ship our own "select-font" icon
new DialogVerb(SP_VERB_DIALOG_GLYPHS, "DialogGlyphs", N_("Gl_yphs..."),
- N_("Select characters from a glyphs palette"), GTK_STOCK_SELECT_FONT),
+ N_("Select characters from a glyphs palette"), INKSCAPE_ICON("gtk-select-font")),
+ // FIXME: Probably better to either use something from the icon naming spec or ship our own "select-color" icon
// TRANSLATORS: "Swatches" means: color samples
new DialogVerb(SP_VERB_DIALOG_SWATCHES, "DialogSwatches", N_("S_watches..."),
- N_("Select colors from a swatches palette"), GTK_STOCK_SELECT_COLOR),
+ N_("Select colors from a swatches palette"), INKSCAPE_ICON("gtk-select-color")),
new DialogVerb(SP_VERB_DIALOG_SYMBOLS, "DialogSymbols", N_("S_ymbols..."),
N_("Select symbol from a symbols palette"), INKSCAPE_ICON("symbols")),
new DialogVerb(SP_VERB_DIALOG_TRANSFORM, "DialogTransform", N_("Transfor_m..."),
@@ -2835,11 +2837,11 @@ Verb *Verb::_base_verbs[] = {
new DialogVerb(SP_VERB_DIALOG_XML_EDITOR, "DialogXMLEditor", N_("_XML Editor..."),
N_("View and edit the XML tree of the document"), INKSCAPE_ICON("dialog-xml-editor")),
new DialogVerb(SP_VERB_DIALOG_FIND, "DialogFind", N_("_Find/Replace..."),
- N_("Find objects in document"), GTK_STOCK_FIND ),
+ N_("Find objects in document"), INKSCAPE_ICON("edit-find")),
new DialogVerb(SP_VERB_DIALOG_FINDREPLACE, "DialogFindReplace", N_("Find and _Replace Text..."),
- N_("Find and replace text in document"), GTK_STOCK_FIND_AND_REPLACE ),
+ N_("Find and replace text in document"), INKSCAPE_ICON("edit-find-replace")),
new DialogVerb(SP_VERB_DIALOG_SPELLCHECK, "DialogSpellcheck", N_("Check Spellin_g..."),
- N_("Check spelling of text in document"), GTK_STOCK_SPELL_CHECK ),
+ N_("Check spelling of text in document"), INKSCAPE_ICON("tools-check-spelling")),
new DialogVerb(SP_VERB_DIALOG_DEBUG, "DialogDebug", N_("_Messages..."),
N_("View debug messages"), INKSCAPE_ICON("dialog-messages")),
new DialogVerb(SP_VERB_DIALOG_TOGGLE, "DialogsToggle", N_("Show/Hide D_ialogs"),
diff --git a/src/widgets/calligraphy-toolbar.cpp b/src/widgets/calligraphy-toolbar.cpp
index 9f08d3462..73484d1b5 100644
--- a/src/widgets/calligraphy-toolbar.cpp
+++ b/src/widgets/calligraphy-toolbar.cpp
@@ -638,7 +638,7 @@ void sp_calligraphy_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions
InkAction* inky = ink_action_new( "ProfileEditAction",
_("Add/Edit Profile"),
_("Add or edit calligraphic profile"),
- GTK_STOCK_PROPERTIES,
+ INKSCAPE_ICON("document-properties"),
Inkscape::ICON_SIZE_DECORATION );
g_object_set( inky, "short_label", _("Edit"), NULL );
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_ddc_edit_profile), (GObject*)holder );
diff --git a/src/widgets/desktop-widget.cpp b/src/widgets/desktop-widget.cpp
index 7e254cdcd..e5568787b 100644
--- a/src/widgets/desktop-widget.cpp
+++ b/src/widgets/desktop-widget.cpp
@@ -1123,8 +1123,8 @@ SPDesktopWidget::shutdown()
gtk_widget_show(close_button);
gtk_dialog_add_action_widget(GTK_DIALOG(dialog), close_button, GTK_RESPONSE_NO);
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_SAVE, GTK_RESPONSE_YES);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Save"), GTK_RESPONSE_YES);
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
gint response;
@@ -1185,7 +1185,7 @@ SPDesktopWidget::shutdown()
gtk_widget_show(save_button);
gtk_dialog_add_action_widget(GTK_DIALOG(dialog), close_button, GTK_RESPONSE_NO);
- gtk_dialog_add_button(GTK_DIALOG(dialog), GTK_STOCK_CANCEL, GTK_RESPONSE_CANCEL);
+ gtk_dialog_add_button(GTK_DIALOG(dialog), _("_Cancel"), GTK_RESPONSE_CANCEL);
gtk_dialog_add_action_widget(GTK_DIALOG(dialog), save_button, GTK_RESPONSE_YES);
gtk_dialog_set_default_response(GTK_DIALOG(dialog), GTK_RESPONSE_YES);
diff --git a/src/widgets/gradient-selector.cpp b/src/widgets/gradient-selector.cpp
index 5ac994509..871d1ee4c 100644
--- a/src/widgets/gradient-selector.cpp
+++ b/src/widgets/gradient-selector.cpp
@@ -36,6 +36,7 @@
#include "paint-selector.h"
#include "style.h"
#include "id-clash.h"
+#include "ui/icon-names.h"
enum {
GRABBED,
@@ -196,8 +197,13 @@ 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 ();
- gtk_button_set_image(GTK_BUTTON(sel->add), gtk_image_new_from_stock ( GTK_STOCK_ADD, GTK_ICON_SIZE_SMALL_TOOLBAR ) );
+ 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->nonsolid.push_back(sel->add);
gtk_box_pack_start (GTK_BOX (hb), sel->add, FALSE, FALSE, 0);
@@ -207,8 +213,14 @@ static void sp_gradient_selector_init(SPGradientSelector *sel)
gtk_button_set_relief(GTK_BUTTON(sel->add), GTK_RELIEF_NONE);
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 ();
- gtk_button_set_image(GTK_BUTTON(sel->edit), gtk_image_new_from_stock ( GTK_STOCK_EDIT, GTK_ICON_SIZE_SMALL_TOOLBAR ) );
+ 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->nonsolid.push_back(sel->edit);
gtk_box_pack_start (GTK_BOX (hb), sel->edit, FALSE, FALSE, 0);
@@ -217,8 +229,13 @@ 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 ();
- gtk_button_set_image(GTK_BUTTON(sel->del), gtk_image_new_from_stock ( GTK_STOCK_REMOVE, GTK_ICON_SIZE_SMALL_TOOLBAR ) );
+ 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
sel->swatch_widgets.push_back(sel->del);
gtk_box_pack_start (GTK_BOX (hb), sel->del, FALSE, FALSE, 0);
diff --git a/src/widgets/icon.cpp b/src/widgets/icon.cpp
index feb69cc64..6f558c84a 100644
--- a/src/widgets/icon.cpp
+++ b/src/widgets/icon.cpp
@@ -45,6 +45,7 @@
#include "util/units.h"
#include "icon.h"
+#include "ui/icon-names.h"
struct IconImpl {
static GtkWidget *newFull( Inkscape::IconSize lsize, gchar const *name );
@@ -790,44 +791,20 @@ GtkWidget *IconImpl::newFull( Inkscape::IconSize lsize, gchar const *name )
}
GtkIconSize mappedSize = iconSizeLookup[trySize];
- GtkStockItem stock;
- gboolean stockFound = gtk_stock_lookup( name, &stock );
-
- GtkWidget *img = 0;
if ( legacyNames.empty() ) {
setupLegacyNaming();
}
- if ( stockFound ) {
- img = gtk_image_new_from_stock( name, mappedSize );
- } else {
- img = gtk_image_new_from_icon_name( name, mappedSize );
- if ( dump ) {
- g_message("gtk_image_new_from_icon_name( '%s', %d ) = %p", name, mappedSize, img);
- GtkImageType thing = gtk_image_get_storage_type(GTK_IMAGE(img));
- g_message(" Type is %d %s", (int)thing, (thing == GTK_IMAGE_EMPTY ? "Empty" : "ok"));
- }
+ GtkWidget *img = gtk_image_new_from_icon_name( name, mappedSize );
+ if ( dump ) {
+ g_message("gtk_image_new_from_icon_name( '%s', %d ) = %p", name, mappedSize, img);
+ GtkImageType thing = gtk_image_get_storage_type(GTK_IMAGE(img));
+ g_message(" Type is %d %s", (int)thing, (thing == GTK_IMAGE_EMPTY ? "Empty" : "ok"));
}
if ( img ) {
GtkImageType type = gtk_image_get_storage_type( GTK_IMAGE(img) );
- if ( type == GTK_IMAGE_STOCK ) {
- if ( !stockFound ) {
- // It's not showing as a stock ID, so assume it will be present internally
- addPreRender( mappedSize, name );
-
- // Add a hook to render if set visible before prerender is done.
- g_signal_connect( G_OBJECT(img), "map", G_CALLBACK(imageMapCB), GINT_TO_POINTER(static_cast<int>(mappedSize)) );
- if ( dump ) {
- g_message(" connecting %p for imageMapCB for [%s] %d", img, name, (int)mappedSize);
- }
- }
- widget = GTK_WIDGET(img);
- img = 0;
- if ( dump ) {
- g_message( "loaded gtk '%s' %d (GTK_IMAGE_STOCK) %s on %p", name, mappedSize, (stockFound ? "STOCK" : "local"), widget );
- }
- } else if ( type == GTK_IMAGE_ICON_NAME ) {
+ if ( type == GTK_IMAGE_ICON_NAME ) {
widget = GTK_WIDGET(img);
img = 0;
@@ -842,7 +819,7 @@ GtkWidget *IconImpl::newFull( Inkscape::IconSize lsize, gchar const *name )
}
} else {
if ( dump ) {
- g_message( "skipped gtk '%s' %d (not GTK_IMAGE_STOCK)", name, lsize );
+ g_message( "skipped gtk '%s' %d (not GTK_IMAGE_ICON_NAME)", name, lsize );
}
//g_object_unref(G_OBJECT(img));
img = 0;
@@ -1033,7 +1010,7 @@ int IconImpl::getPhysSize(int size)
// "The rendered pixbuf may not even correspond to the width/height returned by
// gtk_icon_size_lookup(), because themes are free to render the pixbuf however
// they like, including changing the usual size."
- gchar const *id = GTK_STOCK_OPEN;
+ gchar const *id = INKSCAPE_ICON("document-open");
GdkPixbuf *pb = gtk_widget_render_icon( icon, id, gtkSizes[i], NULL);
if (pb) {
width = gdk_pixbuf_get_width(pb);
@@ -1334,9 +1311,9 @@ guchar *IconImpl::load_svg_pixels(std::list<Glib::ustring> const &names,
static void addToIconSet(GdkPixbuf* pb, gchar const* name, GtkIconSize lsize, unsigned psize) {
static bool dump = Inkscape::Preferences::get()->getBool("/debug/icons/dumpGtk");
- GtkStockItem stock;
- gboolean stockFound = gtk_stock_lookup( name, &stock );
- if ( !stockFound ) {
+ Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
+ bool icon_found = icon_theme->has_icon(name);
+ if ( !icon_found ) {
Gtk::IconTheme::add_builtin_icon( name, psize, Glib::wrap(pb) );
if (dump) {
g_message(" set in a builtin for %s:%d:%d", name, lsize, psize);
@@ -1346,10 +1323,8 @@ static void addToIconSet(GdkPixbuf* pb, gchar const* name, GtkIconSize lsize, un
void Inkscape::queueIconPrerender( Glib::ustring const &name, Inkscape::IconSize lsize )
{
- GtkStockItem stock;
- gboolean stockFound = gtk_stock_lookup( name.c_str(), &stock );
gboolean themedFound = gtk_icon_theme_has_icon(gtk_icon_theme_get_default(), name.c_str());
- if (!stockFound && !themedFound ) {
+ if ( !themedFound ) {
gint trySize = CLAMP( static_cast<gint>(lsize), 0, static_cast<gint>(G_N_ELEMENTS(iconSizeLookup) - 1) );
if ( !sizeMapDone ) {
IconImpl::injectCustomSize();
@@ -1617,7 +1592,7 @@ void IconImpl::imageMapCB(GtkWidget* widget, gpointer user_data)
{
gchar* id = 0;
GtkIconSize size = GTK_ICON_SIZE_INVALID;
- gtk_image_get_stock(GTK_IMAGE(widget), &id, &size);
+ gtk_image_get_icon_name(GTK_IMAGE(widget), &id, &size);
GtkIconSize lsize = static_cast<GtkIconSize>(GPOINTER_TO_INT(user_data));
if ( id ) {
int psize = getPhysSize(lsize);
diff --git a/src/widgets/paintbucket-toolbar.cpp b/src/widgets/paintbucket-toolbar.cpp
index 8c4de2b32..a9962b209 100644
--- a/src/widgets/paintbucket-toolbar.cpp
+++ b/src/widgets/paintbucket-toolbar.cpp
@@ -232,7 +232,7 @@ void sp_paintbucket_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions
GtkAction* act = gtk_action_new( "PaintbucketResetAction",
_("Defaults"),
_("Reset paint bucket parameters to defaults (use Inkscape Preferences > Tools to change defaults)"),
- GTK_STOCK_CLEAR );
+ INKSCAPE_ICON("edit-clear"));
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(paintbucket_defaults), holder );
gtk_action_group_add_action( mainActions, act );
gtk_action_set_sensitive( act, TRUE );
diff --git a/src/widgets/pencil-toolbar.cpp b/src/widgets/pencil-toolbar.cpp
index 36f2912e9..e8296f735 100644
--- a/src/widgets/pencil-toolbar.cpp
+++ b/src/widgets/pencil-toolbar.cpp
@@ -321,7 +321,7 @@ void sp_pencil_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb
InkAction* inky = ink_action_new( "PencilResetAction",
_("Defaults"),
_("Reset pencil parameters to defaults (use Inkscape Preferences > Tools to change defaults)"),
- GTK_STOCK_CLEAR,
+ INKSCAPE_ICON("edit-clear"),
Inkscape::ICON_SIZE_SMALL_TOOLBAR );
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_pencil_tb_defaults), holder );
gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
diff --git a/src/widgets/spiral-toolbar.cpp b/src/widgets/spiral-toolbar.cpp
index 7fc6d1b34..b95c1c41e 100644
--- a/src/widgets/spiral-toolbar.cpp
+++ b/src/widgets/spiral-toolbar.cpp
@@ -299,7 +299,7 @@ void sp_spiral_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GOb
InkAction* inky = ink_action_new( "SpiralResetAction",
_("Defaults"),
_("Reset shape parameters to defaults (use Inkscape Preferences > Tools to change defaults)"),
- GTK_STOCK_CLEAR,
+ INKSCAPE_ICON("edit-clear"),
secondarySize );
g_signal_connect_after( G_OBJECT(inky), "activate", G_CALLBACK(sp_spl_tb_defaults), holder );
gtk_action_group_add_action( mainActions, GTK_ACTION(inky) );
diff --git a/src/widgets/star-toolbar.cpp b/src/widgets/star-toolbar.cpp
index bac0271db..1691a9b25 100644
--- a/src/widgets/star-toolbar.cpp
+++ b/src/widgets/star-toolbar.cpp
@@ -571,7 +571,7 @@ void sp_star_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
GtkAction* act = gtk_action_new( "StarResetAction",
_("Defaults"),
_("Reset shape parameters to defaults (use Inkscape Preferences > Tools to change defaults)"),
- GTK_STOCK_CLEAR );
+ INKSCAPE_ICON("edit-clear"));
g_signal_connect_after( G_OBJECT(act), "activate", G_CALLBACK(sp_stb_defaults), holder );
gtk_action_group_add_action( mainActions, act );
gtk_action_set_sensitive( act, TRUE );
diff --git a/src/widgets/text-toolbar.cpp b/src/widgets/text-toolbar.cpp
index 750fa1de6..6d5d54871 100644
--- a/src/widgets/text-toolbar.cpp
+++ b/src/widgets/text-toolbar.cpp
@@ -1348,7 +1348,7 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
gtk_list_store_set( model, &iter,
0, _("Align left"),
1, _("Align left"),
- 2, GTK_STOCK_JUSTIFY_LEFT,
+ 2, INKSCAPE_ICON("format-justify-left"),
3, true,
-1 );
@@ -1356,7 +1356,7 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
gtk_list_store_set( model, &iter,
0, _("Align center"),
1, _("Align center"),
- 2, GTK_STOCK_JUSTIFY_CENTER,
+ 2, INKSCAPE_ICON("format-justify-center"),
3, true,
-1 );
@@ -1364,7 +1364,7 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
gtk_list_store_set( model, &iter,
0, _("Align right"),
1, _("Align right"),
- 2, GTK_STOCK_JUSTIFY_RIGHT,
+ 2, INKSCAPE_ICON("format-justify-right"),
3, true,
-1 );
@@ -1372,14 +1372,14 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
gtk_list_store_set( model, &iter,
0, _("Justify"),
1, _("Justify (only flowed text)"),
- 2, GTK_STOCK_JUSTIFY_FILL,
+ 2, INKSCAPE_ICON("format-justify-fill"),
3, false,
-1 );
EgeSelectOneAction* act = ege_select_one_action_new( "TextAlignAction", // Name
_("Alignment"), // Label
_("Text alignment"), // Tooltip
- NULL, // StockID
+ NULL, // Icon name
GTK_TREE_MODEL(model) ); // Model
g_object_set( act, "short_label", "NotUsed", NULL );
gtk_action_group_add_action( mainActions, GTK_ACTION(act) );
@@ -1420,7 +1420,7 @@ void sp_text_toolbox_prep(SPDesktop *desktop, GtkActionGroup* mainActions, GObje
EgeSelectOneAction* act = ege_select_one_action_new( "TextOrientationAction", // Name
_("Orientation"), // Label
_("Text orientation"), // Tooltip
- NULL, // StockID
+ NULL, // Icon name
GTK_TREE_MODEL(model) ); // Model
g_object_set( act, "short_label", "NotUsed", NULL );