aboutsummaryrefslogtreecommitdiff
path: root/lib/main.vala
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2014-02-27 19:37:55 +0000
committerCI bot <ps-jenkins@lists.canonical.com>2014-02-27 19:37:55 +0000
commit89d447d27b925b3c10593840440b8e1a8ab70e18 (patch)
treefda82ef05a2c7acfef9baff8f4a1dda12ee7bf4f /lib/main.vala
parent7b3c032fa7e4f42b5fe4a3dc3b3409ecbf7baf2e (diff)
parentc68445a226bf38411a7baa7ea5a82890fbb4bba1 (diff)
downloadayatana-indicator-keyboard-89d447d27b925b3c10593840440b8e1a8ab70e18.tar.gz
ayatana-indicator-keyboard-89d447d27b925b3c10593840440b8e1a8ab70e18.tar.bz2
ayatana-indicator-keyboard-89d447d27b925b3c10593840440b8e1a8ab70e18.zip
Update icons when icon theme changes. Fixes: 1237749
Diffstat (limited to 'lib/main.vala')
-rw-r--r--lib/main.vala20
1 files changed, 20 insertions, 0 deletions
diff --git a/lib/main.vala b/lib/main.vala
index 61036fd5..f012ecb0 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);
}