summaryrefslogtreecommitdiffstats
path: root/src/ui/icon-loader.cpp
diff options
context:
space:
mode:
authorJabiertxof <jabier.arraiza@marker.es>2018-11-10 18:23:44 +0000
committerJabiertxof <jabier.arraiza@marker.es>2018-11-10 18:23:44 +0000
commit1f4079145c240c43f9fb4a9ef86ecbe31fbbe4d0 (patch)
tree788d424ae4af41a431ba8da55d544f649bcf2c39 /src/ui/icon-loader.cpp
parentfix compiling on macOS (diff)
downloadinkscape-1f4079145c240c43f9fb4a9ef86ecbe31fbbe4d0.tar.gz
inkscape-1f4079145c240c43f9fb4a9ef86ecbe31fbbe4d0.zip
Fix a bug icons dont show if no dialog open
Diffstat (limited to 'src/ui/icon-loader.cpp')
-rw-r--r--src/ui/icon-loader.cpp13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/ui/icon-loader.cpp b/src/ui/icon-loader.cpp
index fa04873a6..9b64e64b5 100644
--- a/src/ui/icon-loader.cpp
+++ b/src/ui/icon-loader.cpp
@@ -16,6 +16,8 @@
#include "preferences.h"
#include "svg/svg-color.h"
#include "widgets/toolbox.h"
+#include <gdkmm/display.h>
+#include <gdkmm/screen.h>
#include <gtkmm/iconinfo.h>
#include <gtkmm/icontheme.h>
#include <gtkmm/toolitem.h>
@@ -24,14 +26,9 @@ void sp_load_theme() {}
Glib::RefPtr<Gdk::Pixbuf> sp_get_icon_pixbuf(Glib::ustring icon_name, gint size)
{
- using namespace Inkscape::IO::Resource;
- static auto icon_theme = Gtk::IconTheme::get_default();
- static bool icon_theme_set;
- if (!icon_theme_set) {
- icon_theme_set = true;
- icon_theme->prepend_search_path(get_path_ustring(SYSTEM, ICONS));
- icon_theme->prepend_search_path(get_path_ustring(USER, ICONS));
- }
+ Glib::RefPtr<Gdk::Display> display = Gdk::Display::get_default();
+ Glib::RefPtr<Gdk::Screen> screen = display->get_default_screen();
+ Glib::RefPtr<Gtk::IconTheme> icon_theme = Gtk::IconTheme::get_for_screen(screen);
// TODO all calls to "sp_get_icon_pixbuf" need to be removed in thew furture
// Put here temporary for allow use symbolic in a few icons require pixbug instead Gtk::Image
// We coulden't acces to pixbuf of a symbolic ones with the next order