Skip to content

Commit

Permalink
Merge pull request #1452 from JoshStrobl/budgie-menu-applet-errhandle
Browse files Browse the repository at this point in the history
Budgie Menu: Added Pixbuf error handling and fallback.
  • Loading branch information
ikeydoherty authored May 25, 2018
2 parents 19ccf51 + 60cf43b commit c868817
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/applets/budgie-menu/BudgieMenu.vala
Original file line number Diff line number Diff line change
Expand Up @@ -200,8 +200,13 @@ public class BudgieMenuApplet : Budgie.Applet
case "menu-icon":
string? icon = settings.get_string(key);
if ("/" in icon) {
Gdk.Pixbuf pixbuf = new Gdk.Pixbuf.from_file(icon);
img.set_from_pixbuf(pixbuf.scale_simple(this.pixel_size, this.pixel_size, Gdk.InterpType.BILINEAR));
try {
Gdk.Pixbuf pixbuf = new Gdk.Pixbuf.from_file(icon);
img.set_from_pixbuf(pixbuf.scale_simple(this.pixel_size, this.pixel_size, Gdk.InterpType.BILINEAR));
} catch (Error e) {
warning("Failed to update Budgie Menu applet icon: %s", e.message);
img.set_from_icon_name("view-grid-symbolic", Gtk.IconSize.INVALID); // Revert to view-grid-symbolic
}
} else if (icon == "") {
should_show = false;
} else {
Expand Down

0 comments on commit c868817

Please sign in to comment.