From 22d06152d0fabc7fe50bb6829f00b2bac4ed1796 Mon Sep 17 00:00:00 2001 From: Alexander Valavanis Date: Thu, 29 Jun 2017 13:43:56 +0200 Subject: Remove old icon handling code --- src/ui/widget/imagetoggler.cpp | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) (limited to 'src/ui/widget/imagetoggler.cpp') diff --git a/src/ui/widget/imagetoggler.cpp b/src/ui/widget/imagetoggler.cpp index 987cc67bb..81d0edd47 100644 --- a/src/ui/widget/imagetoggler.cpp +++ b/src/ui/widget/imagetoggler.cpp @@ -13,7 +13,6 @@ #include -#include "widgets/icon.h" #include "widgets/toolbox.h" #include "ui/icon-names.h" @@ -32,15 +31,12 @@ ImageToggler::ImageToggler( char const* on, char const* off) : _property_pixbuf_off(*this, "pixbuf_off", Glib::RefPtr(0)) { property_mode() = Gtk::CELL_RENDERER_MODE_ACTIVATABLE; - int phys = sp_icon_get_phys_size((int)Inkscape::ICON_SIZE_DECORATION); - Glib::RefPtr 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; + + Glib::RefPtr icon_theme = Gtk::IconTheme::get_default(); if (icon_theme->has_icon(_pixOnName)) { -- cgit v1.2.3 From f80d5b44e2fdad56b6aad9ca7fb14f44c835915c Mon Sep 17 00:00:00 2001 From: Tavmjong Bah Date: Thu, 6 Jul 2017 11:32:09 +0200 Subject: Don't check if icon exists in default theme since that prevents use of fallback icons. --- src/ui/widget/imagetoggler.cpp | 10 ++-------- 1 file changed, 2 insertions(+), 8 deletions(-) (limited to 'src/ui/widget/imagetoggler.cpp') diff --git a/src/ui/widget/imagetoggler.cpp b/src/ui/widget/imagetoggler.cpp index 81d0edd47..a2783ecb1 100644 --- a/src/ui/widget/imagetoggler.cpp +++ b/src/ui/widget/imagetoggler.cpp @@ -37,14 +37,8 @@ ImageToggler::ImageToggler( char const* on, char const* off) : int phys = width; Glib::RefPtr icon_theme = Gtk::IconTheme::get_default(); - - - 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); - } + _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(); } -- cgit v1.2.3