diff options
Diffstat (limited to 'src/iconthemewrapper.cpp')
-rw-r--r-- | src/iconthemewrapper.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/src/iconthemewrapper.cpp b/src/iconthemewrapper.cpp new file mode 100644 index 0000000..496dd45 --- /dev/null +++ b/src/iconthemewrapper.cpp @@ -0,0 +1,23 @@ +#include <config.h> + +#include <gtkmm/icontheme.h> + +#include "iconthemewrapper.h" + + +Glib::RefPtr<Gdk::Pixbuf> +procman::IconThemeWrapper::load_icon(const Glib::ustring& icon_name, + int size, Gtk::IconLookupFlags flags) const +{ + try + { + return Gtk::IconTheme::get_default()->load_icon(icon_name, size, flags); + } + catch (Gtk::IconThemeError &error) + { + if (error.code() != Gtk::IconThemeError::ICON_THEME_NOT_FOUND) + g_error("Cannot load icon '%s' from theme: %s", icon_name.c_str(), error.what().c_str()); + return Glib::RefPtr<Gdk::Pixbuf>(); + } +} + |