diff options
| author | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-09 12:42:10 +0000 |
|---|---|---|
| committer | Eduard Braun <eduard.braun2@gmx.de> | 2017-07-09 12:42:10 +0000 |
| commit | 241554b7ad311b5868ba284c7a4e6a410432b9bd (patch) | |
| tree | 8bf6fed572d27e9b97ca60b90ae1684ba4856eeb /src/ui/widget/imagetoggler.cpp | |
| parent | Use .xml when exporting shortcuts by default (diff) | |
| parent | Shortcuts: Fix for 7d248fbba5b0c24d9a24cda8c3f2e79f96395553 (is_user_set was ... (diff) | |
| download | inkscape-241554b7ad311b5868ba284c7a4e6a410432b9bd.tar.gz inkscape-241554b7ad311b5868ba284c7a4e6a410432b9bd.zip | |
Merge branch 'master' into shortcuts
Diffstat (limited to 'src/ui/widget/imagetoggler.cpp')
| -rw-r--r-- | src/ui/widget/imagetoggler.cpp | 22 |
1 files changed, 6 insertions, 16 deletions
diff --git a/src/ui/widget/imagetoggler.cpp b/src/ui/widget/imagetoggler.cpp index 987cc67bb..a2783ecb1 100644 --- a/src/ui/widget/imagetoggler.cpp +++ b/src/ui/widget/imagetoggler.cpp @@ -13,7 +13,6 @@ #include <gtkmm/icontheme.h> -#include "widgets/icon.h" #include "widgets/toolbox.h" #include "ui/icon-names.h" @@ -32,23 +31,14 @@ ImageToggler::ImageToggler( char const* on, char const* off) : _property_pixbuf_off(*this, "pixbuf_off", Glib::RefPtr<Gdk::Pixbuf>(0)) { property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE; - int phys = sp_icon_get_phys_size((int)Inkscape::ICON_SIZE_DECORATION); - Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default(); - - if (!icon_theme->has_icon(_pixOnName)) { - Inkscape::queueIconPrerender( INKSCAPE_ICON(_pixOnName.data()), Inkscape::ICON_SIZE_DECORATION ); - } - if (!icon_theme->has_icon(_pixOffName)) { - Inkscape::queueIconPrerender( INKSCAPE_ICON(_pixOffName.data()), Inkscape::ICON_SIZE_DECORATION ); - } + gint width, height; + gtk_icon_size_lookup(GTK_ICON_SIZE_MENU, &width, &height); + int phys = width; - if (icon_theme->has_icon(_pixOnName)) { - _property_pixbuf_on = icon_theme->load_icon(_pixOnName, phys, (Gtk::IconLookupFlags)0); - } - if (icon_theme->has_icon(_pixOffName)) { - _property_pixbuf_off = icon_theme->load_icon(_pixOffName, phys, (Gtk::IconLookupFlags)0); - } + Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_default(); + _property_pixbuf_on = icon_theme->load_icon(_pixOnName, phys, (Gtk::IconLookupFlags)0); + _property_pixbuf_off = icon_theme->load_icon(_pixOffName, phys, (Gtk::IconLookupFlags)0); property_pixbuf() = _property_pixbuf_off.get_value(); } |
