From c68445a226bf38411a7baa7ea5a82890fbb4bba1 Mon Sep 17 00:00:00 2001 From: William Hua Date: Wed, 26 Feb 2014 13:24:23 -0500 Subject: Update icons when icon theme changes. --- lib/main.vala | 20 ++++++++++++++++++++ 1 file changed, 20 insertions(+) (limited to 'lib/main.vala') diff --git a/lib/main.vala b/lib/main.vala index d16022e9..85c9369f 100644 --- a/lib/main.vala +++ b/lib/main.vala @@ -59,6 +59,26 @@ public class Indicator.Keyboard.Service : Object { if (use_gtk) { use_gtk = Gtk.init_check (ref args); + + Gtk.IconTheme? icon_theme = Gtk.IconTheme.get_default (); + + if (icon_theme != null) { + ((!) icon_theme).changed.connect (() => { + if (sources != null) { + foreach (var source in (!) sources) { + source.icon = null; + } + } + + if (sources_menu != null) { + update_sources_menu (); + } + + if (indicator_action != null) { + update_indicator_action (); + } + }); + } } else { Gdk.init (ref args); } -- cgit v1.2.3