diff options
Diffstat (limited to 'src/images/icon.vala')
-rw-r--r-- | src/images/icon.vala | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/src/images/icon.vala b/src/images/icon.vala index 1c8a9f4..81eb2d9 100644 --- a/src/images/icon.vala +++ b/src/images/icon.vala @@ -80,7 +80,17 @@ public class Icon : Image { public static string get_icon_file(string icon_name, int size) { string result = ""; - + + if (icon_name.contains("/")) { + var file = GLib.File.new_for_path(icon_name); + if(file.query_exists()) + return icon_name; + + warning("Icon \"" + icon_name + "\" not found! Using default icon..."); + icon_name = "application-default-icon"; + } + + var icon_theme = Gtk.IconTheme.get_default(); var file = icon_theme.lookup_icon(icon_name, size, 0); if (file != null) result = file.get_filename(); |