summaryrefslogtreecommitdiffstats
path: root/src/ui/widget
diff options
context:
space:
mode:
authorJabier Arraiza <jabier.arraiza@marker.es>2018-07-21 02:55:31 +0000
committerJabier Arraiza <jabier.arraiza@marker.es>2018-07-21 02:55:31 +0000
commit75d662f71d8eeb4b1c83e9bb61c1bd56f9b0e959 (patch)
treee31f9e32ffa511bb495fc75eac6484681798e0d2 /src/ui/widget
parentCMake/MSYS2: Update for enchant-2 (diff)
downloadinkscape-75d662f71d8eeb4b1c83e9bb61c1bd56f9b0e959.tar.gz
inkscape-75d662f71d8eeb4b1c83e9bb61c1bd56f9b0e959.zip
adding gtk-theme
Diffstat (limited to 'src/ui/widget')
-rw-r--r--src/ui/widget/addtoicon.cpp16
-rw-r--r--src/ui/widget/addtoicon.h1
-rw-r--r--src/ui/widget/alignment-selector.cpp4
-rw-r--r--src/ui/widget/anchor-selector.cpp7
-rw-r--r--src/ui/widget/clipmaskicon.cpp18
-rw-r--r--src/ui/widget/color-notebook.cpp10
-rw-r--r--src/ui/widget/dock-item.cpp17
-rw-r--r--src/ui/widget/imagetoggler.cpp19
-rw-r--r--src/ui/widget/insertordericon.cpp16
-rw-r--r--src/ui/widget/labelled.cpp5
-rw-r--r--src/ui/widget/layer-selector.cpp9
-rw-r--r--src/ui/widget/layertypeicon.cpp17
-rw-r--r--src/ui/widget/preferences-widget.cpp57
-rw-r--r--src/ui/widget/preferences-widget.h10
-rw-r--r--src/ui/widget/random.cpp5
15 files changed, 112 insertions, 99 deletions
diff --git a/src/ui/widget/addtoicon.cpp b/src/ui/widget/addtoicon.cpp
index e5119fc60..4542333b5 100644
--- a/src/ui/widget/addtoicon.cpp
+++ b/src/ui/widget/addtoicon.cpp
@@ -14,11 +14,10 @@
#include "ui/widget/addtoicon.h"
-#include <gtkmm/icontheme.h>
-
-#include "widgets/toolbox.h"
-#include "ui/icon-names.h"
+#include "helper/icon-loader.h"
#include "layertypeicon.h"
+#include "ui/icon-names.h"
+#include "widgets/toolbox.h"
namespace Inkscape {
namespace UI {
@@ -33,9 +32,6 @@ AddToIcon::AddToIcon() :
{
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
- gint width, height;
- gtk_icon_size_lookup(GTK_ICON_SIZE_BUTTON, &width, &height);
- phys = width; // Assumes that we have a square icon?
// Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
//
@@ -103,11 +99,7 @@ bool AddToIcon::activate_vfunc(GdkEvent* /*event*/,
void AddToIcon::set_pixbuf()
{
bool active = property_active().get_value();
-
- auto icon_theme = Gtk::IconTheme::get_default();
-
- property_pixbuf() = icon_theme->load_icon(active ? "list-add" : "edit-delete",
- phys);
+ property_pixbuf() = sp_get_icon_pixbuf((active ? "list-add" : "edit-delete"), GTK_ICON_SIZE_BUTTON);
}
diff --git a/src/ui/widget/addtoicon.h b/src/ui/widget/addtoicon.h
index 60c773e84..c17ae907a 100644
--- a/src/ui/widget/addtoicon.h
+++ b/src/ui/widget/addtoicon.h
@@ -54,7 +54,6 @@ protected:
private:
- int phys; ///< Physical size of the icon (px)
// Glib::ustring _pixAddName;
diff --git a/src/ui/widget/alignment-selector.cpp b/src/ui/widget/alignment-selector.cpp
index c6c95f097..9256a08bd 100644
--- a/src/ui/widget/alignment-selector.cpp
+++ b/src/ui/widget/alignment-selector.cpp
@@ -5,6 +5,7 @@
*/
#include "ui/widget/alignment-selector.h"
+#include "helper/icon-loader.h"
#include "ui/icon-names.h"
#include <gtkmm/image.h>
@@ -14,8 +15,7 @@ namespace UI {
namespace Widget {
void AlignmentSelector::setupButton(const Glib::ustring& icon, Gtk::Button& button) {
- Gtk::Image* buttonIcon = Gtk::manage(new Gtk::Image());
- buttonIcon->set_from_icon_name(icon, Gtk::ICON_SIZE_SMALL_TOOLBAR);
+ Gtk::Image *buttonIcon = Gtk::manage(sp_get_icon_image(icon, Gtk::ICON_SIZE_SMALL_TOOLBAR));
buttonIcon->show();
button.set_relief(Gtk::RELIEF_NONE);
diff --git a/src/ui/widget/anchor-selector.cpp b/src/ui/widget/anchor-selector.cpp
index 52768b7f1..fc7c15f21 100644
--- a/src/ui/widget/anchor-selector.cpp
+++ b/src/ui/widget/anchor-selector.cpp
@@ -6,8 +6,8 @@
*
* Released under GNU GPL. Read the file 'COPYING' for more information.
*/
-
#include "ui/widget/anchor-selector.h"
+#include "helper/icon-loader.h"
#include "ui/icon-names.h"
#include <gtkmm/image.h>
@@ -17,9 +17,8 @@ namespace UI {
namespace Widget {
void AnchorSelector::setupButton(const Glib::ustring& icon, Gtk::ToggleButton& button) {
- Gtk::Image* buttonIcon = Gtk::manage(new Gtk::Image());
- buttonIcon->set_from_icon_name(icon, Gtk::ICON_SIZE_SMALL_TOOLBAR);
- buttonIcon->show();
+ Gtk::Image *buttonIcon = Gtk::manage(sp_get_icon_image(icon, Gtk::ICON_SIZE_SMALL_TOOLBAR));
+ buttonIcon->show();
button.set_relief(Gtk::RELIEF_NONE);
button.show();
diff --git a/src/ui/widget/clipmaskicon.cpp b/src/ui/widget/clipmaskicon.cpp
index 509e218a9..704b5c653 100644
--- a/src/ui/widget/clipmaskicon.cpp
+++ b/src/ui/widget/clipmaskicon.cpp
@@ -13,11 +13,10 @@
#include "ui/widget/clipmaskicon.h"
-#include <gtkmm/icontheme.h>
-
-#include "widgets/toolbox.h"
-#include "ui/icon-names.h"
+#include "helper/icon-loader.h"
#include "layertypeicon.h"
+#include "ui/icon-names.h"
+#include "widgets/toolbox.h"
namespace Inkscape {
namespace UI {
@@ -37,14 +36,9 @@ ClipMaskIcon::ClipMaskIcon() :
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
- gint width, height;
- gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
- phys = width;
-
- Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
- _property_pixbuf_clip = icon_theme->load_icon(_pixClipName, phys, (Gtk::IconLookupFlags)0);
- _property_pixbuf_mask = icon_theme->load_icon(_pixMaskName, phys, (Gtk::IconLookupFlags)0);
- _property_pixbuf_both = icon_theme->load_icon(_pixBothName, phys, (Gtk::IconLookupFlags)0);
+ _property_pixbuf_clip = sp_get_icon_pixbuf(_pixClipName, GTK_ICON_SIZE_MENU);
+ _property_pixbuf_mask = sp_get_icon_pixbuf(_pixMaskName, GTK_ICON_SIZE_MENU);
+ _property_pixbuf_both = sp_get_icon_pixbuf(_pixBothName, GTK_ICON_SIZE_MENU);
property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>(nullptr);
}
diff --git a/src/ui/widget/color-notebook.cpp b/src/ui/widget/color-notebook.cpp
index 5b0f12e51..2d8dcc310 100644
--- a/src/ui/widget/color-notebook.cpp
+++ b/src/ui/widget/color-notebook.cpp
@@ -30,6 +30,7 @@
#include "preferences.h"
#include "profile-manager.h"
+#include "helper/icon-loader.h"
#include "object/color-profile.h"
#include "svg/svg-icc-color.h"
@@ -159,21 +160,22 @@ void ColorNotebook::_initUI()
#if defined(HAVE_LIBLCMS1) || defined(HAVE_LIBLCMS2)
/* Create color management icons */
_box_colormanaged = gtk_event_box_new();
- GtkWidget *colormanaged = gtk_image_new_from_icon_name("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ GtkWidget *colormanaged =
+ GTK_WIDGET(sp_get_icon_image("color-management-icon", GTK_ICON_SIZE_SMALL_TOOLBAR)->gobj());
gtk_container_add(GTK_CONTAINER(_box_colormanaged), colormanaged);
gtk_widget_set_tooltip_text(_box_colormanaged, _("Color Managed"));
gtk_widget_set_sensitive(_box_colormanaged, false);
gtk_box_pack_start(GTK_BOX(rgbabox), _box_colormanaged, FALSE, FALSE, 2);
_box_outofgamut = gtk_event_box_new();
- GtkWidget *outofgamut = gtk_image_new_from_icon_name("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ GtkWidget *outofgamut = GTK_WIDGET(sp_get_icon_image("out-of-gamut-icon", GTK_ICON_SIZE_SMALL_TOOLBAR)->gobj());
gtk_container_add(GTK_CONTAINER(_box_outofgamut), outofgamut);
gtk_widget_set_tooltip_text(_box_outofgamut, _("Out of gamut!"));
gtk_widget_set_sensitive(_box_outofgamut, false);
gtk_box_pack_start(GTK_BOX(rgbabox), _box_outofgamut, FALSE, FALSE, 2);
_box_toomuchink = gtk_event_box_new();
- GtkWidget *toomuchink = gtk_image_new_from_icon_name("too-much-ink-icon", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ GtkWidget *toomuchink = GTK_WIDGET(sp_get_icon_image("too-much-ink-icon", GTK_ICON_SIZE_SMALL_TOOLBAR)->gobj());
gtk_container_add(GTK_CONTAINER(_box_toomuchink), toomuchink);
gtk_widget_set_tooltip_text(_box_toomuchink, _("Too much ink!"));
gtk_widget_set_sensitive(_box_toomuchink, false);
@@ -182,7 +184,7 @@ void ColorNotebook::_initUI()
/* Color picker */
- GtkWidget *picker = gtk_image_new_from_icon_name("color-picker", GTK_ICON_SIZE_SMALL_TOOLBAR);
+ GtkWidget *picker = GTK_WIDGET(sp_get_icon_image("color-picker", GTK_ICON_SIZE_SMALL_TOOLBAR)->gobj());
_btn_picker = gtk_button_new();
gtk_button_set_relief(GTK_BUTTON(_btn_picker), GTK_RELIEF_NONE);
gtk_container_add(GTK_CONTAINER(_btn_picker), picker);
diff --git a/src/ui/widget/dock-item.cpp b/src/ui/widget/dock-item.cpp
index 7cd841d88..c85abd6de 100644
--- a/src/ui/widget/dock-item.cpp
+++ b/src/ui/widget/dock-item.cpp
@@ -10,11 +10,11 @@
#include "ui/widget/dock.h"
#include "desktop.h"
+#include "helper/icon-loader.h"
#include "inkscape.h"
#include "ui/icon-names.h"
-
-#include <gtkmm/icontheme.h>
#include <glibmm/exceptionhandler.h>
+#include <gtkmm/icontheme.h>
namespace Inkscape {
namespace UI {
@@ -31,6 +31,7 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l
_grab_focus_on_realize(false),
_gdl_dock_item(nullptr)
{
+
Inkscape::Preferences *prefs = Inkscape::Preferences::get();
GdlDockItemBehavior gdl_dock_behavior =
(prefs->getBool("/options/dock/cancenterdock", true) ?
@@ -39,17 +40,7 @@ DockItem::DockItem(Dock& dock, const Glib::ustring& name, const Glib::ustring& l
if (!icon_name.empty()) {
- Glib::RefPtr<Gtk::IconTheme> iconTheme = Gtk::IconTheme::get_default();
-
- int width = 0;
- int height = 0;
- Gtk::IconSize::lookup(Gtk::ICON_SIZE_MENU, width, height);
- try {
- _icon_pixbuf = iconTheme->load_icon(icon_name, width);
- }
- catch (const Gtk::IconThemeError& e) {
- std::cerr << "DocItem::DocItem(): " << e.what() << std::endl;
- }
+ _icon_pixbuf = sp_get_icon_pixbuf(icon_name, "/toolbox/secondary");
}
if ( _icon_pixbuf ) {
diff --git a/src/ui/widget/imagetoggler.cpp b/src/ui/widget/imagetoggler.cpp
index 1200144f1..76b48fbbe 100644
--- a/src/ui/widget/imagetoggler.cpp
+++ b/src/ui/widget/imagetoggler.cpp
@@ -11,10 +11,9 @@
#include "ui/widget/imagetoggler.h"
-#include <gtkmm/icontheme.h>
-
-#include "widgets/toolbox.h"
+#include "helper/icon-loader.h"
#include "ui/icon-names.h"
+#include "widgets/toolbox.h"
#include <iostream>
@@ -34,18 +33,8 @@ ImageToggler::ImageToggler( char const* on, char const* off) :
{
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
- gint width, height;
- gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
- int phys = width;
-
- Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
- try {
- _property_pixbuf_on = icon_theme->load_icon(_pixOnName, phys, (Gtk::IconLookupFlags)0);
- _property_pixbuf_off = icon_theme->load_icon(_pixOffName, phys, (Gtk::IconLookupFlags)0);
- }
- catch (const Gtk::IconThemeError& e) {
- std::cerr << "ImageToggler::ImageToggler(): " << e.what() << std::endl;
- }
+ _property_pixbuf_on = sp_get_icon_pixbuf(_pixOnName, GTK_ICON_SIZE_MENU);
+ _property_pixbuf_off = sp_get_icon_pixbuf(_pixOffName, GTK_ICON_SIZE_MENU);
property_pixbuf() = _property_pixbuf_off.get_value();
}
diff --git a/src/ui/widget/insertordericon.cpp b/src/ui/widget/insertordericon.cpp
index d402aca37..1343786a1 100644
--- a/src/ui/widget/insertordericon.cpp
+++ b/src/ui/widget/insertordericon.cpp
@@ -8,12 +8,11 @@
*/
#include "ui/widget/insertordericon.h"
-
-#include <gtkmm/icontheme.h>
-#include "widgets/toolbox.h"
-#include "ui/icon-names.h"
+#include "helper/icon-loader.h"
#include "layertypeicon.h"
+#include "ui/icon-names.h"
+#include "widgets/toolbox.h"
namespace Inkscape {
namespace UI {
@@ -31,13 +30,8 @@ InsertOrderIcon::InsertOrderIcon() :
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
- gint width, height;
- gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
- phys=width;
-
- Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
- _property_pixbuf_top = icon_theme->load_icon(_pixTopName, phys, (Gtk::IconLookupFlags)0);
- _property_pixbuf_bottom = icon_theme->load_icon(_pixBottomName, phys, (Gtk::IconLookupFlags)0);
+ _property_pixbuf_top = sp_get_icon_pixbuf(_pixTopName, GTK_ICON_SIZE_MENU);
+ _property_pixbuf_bottom = sp_get_icon_pixbuf(_pixBottomName, GTK_ICON_SIZE_MENU);
property_pixbuf() = Glib::RefPtr<Gdk::Pixbuf>(nullptr);
}
diff --git a/src/ui/widget/labelled.cpp b/src/ui/widget/labelled.cpp
index 2e9840035..6ee2b752f 100644
--- a/src/ui/widget/labelled.cpp
+++ b/src/ui/widget/labelled.cpp
@@ -12,8 +12,8 @@
# include <config.h>
#endif
+#include "helper/icon-loader.h"
#include "labelled.h"
-
#include <gtkmm/image.h>
#include <gtkmm/label.h>
@@ -32,8 +32,7 @@ Labelled::Labelled(Glib::ustring const &label, Glib::ustring const &tooltip,
{
g_assert(g_utf8_validate(icon.c_str(), -1, nullptr));
if (icon != "") {
- _icon = Gtk::manage(new Gtk::Image());
- _icon->set_from_icon_name(icon, Gtk::ICON_SIZE_LARGE_TOOLBAR);
+ _icon = Gtk::manage(sp_get_icon_image(icon, Gtk::ICON_SIZE_LARGE_TOOLBAR));
pack_start(*_icon, Gtk::PACK_SHRINK);
}
pack_start(*Gtk::manage(_label), Gtk::PACK_EXPAND_WIDGET, 6);
diff --git a/src/ui/widget/layer-selector.cpp b/src/ui/widget/layer-selector.cpp
index b86222404..c8aefa656 100644
--- a/src/ui/widget/layer-selector.cpp
+++ b/src/ui/widget/layer-selector.cpp
@@ -17,10 +17,11 @@
#include <cstring>
#include <string>
+#include "helper/icon-loader.h"
#include "ui/dialog/layer-properties.h"
-#include <glibmm/i18n.h>
#include <boost/range/adaptor/filtered.hpp>
#include <boost/range/adaptor/reversed.hpp>
+#include <glibmm/i18n.h>
#include "desktop.h"
@@ -46,14 +47,12 @@ public:
{
set_name("AlternateIcons");
if (!a.empty()) {
- _a = Gtk::manage(new Gtk::Image());
- _a->set_from_icon_name(a, size);
+ _a = Gtk::manage(sp_get_icon_image(a, size));
_a->set_no_show_all(true);
add(*_a);
}
if (!b.empty()) {
- _b = Gtk::manage(new Gtk::Image());
- _b->set_from_icon_name(b, size);
+ _b = Gtk::manage(sp_get_icon_image(b, size));
_b->set_no_show_all(true);
add(*_b);
}
diff --git a/src/ui/widget/layertypeicon.cpp b/src/ui/widget/layertypeicon.cpp
index 278bd317b..356531620 100644
--- a/src/ui/widget/layertypeicon.cpp
+++ b/src/ui/widget/layertypeicon.cpp
@@ -13,10 +13,9 @@
#include "ui/widget/layertypeicon.h"
-#include <gtkmm/icontheme.h>
-
-#include "widgets/toolbox.h"
+#include "helper/icon-loader.h"
#include "ui/icon-names.h"
+#include "widgets/toolbox.h"
namespace Inkscape {
namespace UI {
@@ -36,14 +35,10 @@ LayerTypeIcon::LayerTypeIcon() :
{
property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE;
- gint width, height;
- gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height);
- int phys = width;
-
- Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default();
- _property_pixbuf_layer = icon_theme->load_icon(_pixLayerName, phys, (Gtk::IconLookupFlags)0);
- _property_pixbuf_group = icon_theme->load_icon(_pixGroupName, phys, (Gtk::IconLookupFlags)0);
- _property_pixbuf_path = icon_theme->load_icon(_pixPathName, phys, (Gtk::IconLookupFlags)0);
+
+ _property_pixbuf_layer = sp_get_icon_pixbuf(_pixLayerName, GTK_ICON_SIZE_MENU);
+ _property_pixbuf_group = sp_get_icon_pixbuf(_pixGroupName, GTK_ICON_SIZE_MENU);
+ _property_pixbuf_path = sp_get_icon_pixbuf(_pixPathName, GTK_ICON_SIZE_MENU);
property_pixbuf() = _property_pixbuf_path.get_value();
}
diff --git a/src/ui/widget/preferences-widget.cpp b/src/ui/widget/preferences-widget.cpp
index fee392632..09656a800 100644
--- a/src/ui/widget/preferences-widget.cpp
+++ b/src/ui/widget/preferences-widget.cpp
@@ -34,6 +34,7 @@
#include "io/sys.h"
+#include "helper/icon-loader.h"
#include "ui/dialog/filedialog.h"
#include "ui/widget/preferences-widget.h"
@@ -633,6 +634,58 @@ void PrefCombo::init(Glib::ustring const &prefs_path,
this->set_active(row);
}
+void PrefCombo::init(Glib::ustring const &prefs_path,
+ std::vector<Glib::ustring> labels, std::vector<int> values, int default_value)
+{
+ size_t labels_size = labels.size();
+ size_t values_size = values.size();
+ if (values_size != labels_size) {
+ std::cout << "PrefCombo::" << "Diferent number of values/labels in " << prefs_path << std::endl;
+ return;
+ }
+ _prefs_path = prefs_path;
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ int row = 0;
+ int value = prefs->getInt(_prefs_path, default_value);
+
+ for (int i = 0 ; i < labels_size; ++i)
+ {
+ this->append(labels[i]);
+ _values.push_back(values[i]);
+ if (value == values[i])
+ row = i;
+ }
+ this->set_active(row);
+}
+
+void PrefCombo::init(Glib::ustring const &prefs_path,
+ std::vector<Glib::ustring> labels, std::vector<Glib::ustring> values, Glib::ustring default_value)
+{
+ size_t labels_size = labels.size();
+ size_t values_size = values.size();
+ if (values_size != labels_size) {
+ std::cout << "PrefCombo::" << "Diferent number of values/labels in " << prefs_path << std::endl;
+ return;
+ }
+ _prefs_path = prefs_path;
+ Inkscape::Preferences *prefs = Inkscape::Preferences::get();
+ int row = 0;
+ Glib::ustring value = prefs->getString(_prefs_path);
+ if(value.empty())
+ {
+ value = default_value;
+ }
+
+ for (int i = 0 ; i < labels_size; ++i)
+ {
+ this->append(labels[i]);
+ _ustr_values.push_back(values[i]);
+ if (value == values[i])
+ row = i;
+ }
+ this->set_active(row);
+}
+
void PrefCombo::on_changed()
{
if (this->get_visible()) //only take action if user changed value
@@ -705,9 +758,7 @@ void PrefEntryFileButtonHBox::init(Glib::ustring const &prefs_path,
relatedButton = new Gtk::Button();
Gtk::HBox* pixlabel = new Gtk::HBox(false, 3);
- Gtk::Image *im = new Gtk::Image();
- im->set_from_icon_name("applications-graphics",
- Gtk::ICON_SIZE_BUTTON);
+ Gtk::Image *im = sp_get_icon_image("applications-graphics", Gtk::ICON_SIZE_BUTTON);
pixlabel->pack_start(*im);
Gtk::Label *l = new Gtk::Label();
l->set_markup_with_mnemonic(_("_Browse..."));
diff --git a/src/ui/widget/preferences-widget.h b/src/ui/widget/preferences-widget.h
index 8e1602ff9..f75079c77 100644
--- a/src/ui/widget/preferences-widget.h
+++ b/src/ui/widget/preferences-widget.h
@@ -181,6 +181,16 @@ public:
*/
void init(Glib::ustring const &prefs_path,
Glib::ustring labels[], Glib::ustring values[], int num_items, Glib::ustring default_value);
+ /**
+ * Initialize a combo box.
+ * with vectors.
+ */
+ void init(Glib::ustring const &prefs_path,
+ std::vector<Glib::ustring> labels, std::vector<int> values, int default_value);
+
+ void init(Glib::ustring const &prefs_path,
+ std::vector<Glib::ustring> labels, std::vector<Glib::ustring> values, Glib::ustring default_value);
+
protected:
Glib::ustring _prefs_path;
std::vector<int> _values;
diff --git a/src/ui/widget/random.cpp b/src/ui/widget/random.cpp
index 237144c7c..3bda641d7 100644
--- a/src/ui/widget/random.cpp
+++ b/src/ui/widget/random.cpp
@@ -14,8 +14,8 @@
#endif
+#include "helper/icon-loader.h"
#include "random.h"
-
#include <glibmm/i18n.h>
#include <gtkmm/button.h>
@@ -70,8 +70,7 @@ void Random::setStartSeed(long newseed)
void Random::addReseedButton()
{
- Gtk::Image* pIcon = Gtk::manage(new Gtk::Image());
- pIcon->set_from_icon_name( "randomize", Gtk::ICON_SIZE_BUTTON);
+ Gtk::Image *pIcon = Gtk::manage(sp_get_icon_image("randomize", Gtk::ICON_SIZE_BUTTON));
Gtk::Button * pButton = Gtk::manage(new Gtk::Button());
pButton->set_relief(Gtk::RELIEF_NONE);
pIcon->show();