aboutsummaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorWilliam Hua <william.hua@canonical.com>2013-07-17 12:29:03 -0400
committerWilliam Hua <william.hua@canonical.com>2013-07-17 12:29:03 -0400
commit60e32811f02f529579e5e0b7f0311a6c8c830a10 (patch)
tree92f7a2d592500cd6e6b6caabec8cac71c559fa9b /lib
parent4d097b8eb4b6f527ec53b2faf778f0693cac0fa3 (diff)
downloadayatana-indicator-keyboard-60e32811f02f529579e5e0b7f0311a6c8c830a10.tar.gz
ayatana-indicator-keyboard-60e32811f02f529579e5e0b7f0311a6c8c830a10.tar.bz2
ayatana-indicator-keyboard-60e32811f02f529579e5e0b7f0311a6c8c830a10.zip
Fallback to ThemedIcon without --use-gtk.
Diffstat (limited to 'lib')
-rw-r--r--lib/main.vala20
1 files changed, 12 insertions, 8 deletions
diff --git a/lib/main.vala b/lib/main.vala
index e429c9ea..aafcd4a3 100644
--- a/lib/main.vala
+++ b/lib/main.vala
@@ -404,15 +404,19 @@ public class Indicator.Keyboard.Service : Object {
icon_name = @"indicator-keyboard-$((!) icon_string)-$icon_subscript";
}
- var icon_theme = Gtk.IconTheme.get_default ();
- Gtk.IconInfo? icon_info = icon_theme.lookup_icon (icon_name, 22, 0);
-
- if (icon_info != null) {
- try {
- this.icons[index] = Icon.new_for_string (((!) icon_info).get_filename ());
- } catch (Error error) {
- this.icons[index] = null;
+ if (this.use_gtk) {
+ var icon_theme = Gtk.IconTheme.get_default ();
+ Gtk.IconInfo? icon_info = icon_theme.lookup_icon (icon_name, 22, 0);
+
+ if (icon_info != null) {
+ try {
+ this.icons[index] = Icon.new_for_string (((!) icon_info).get_filename ());
+ } catch (Error error) {
+ this.icons[index] = null;
+ }
}
+ } else {
+ this.icons[index] = new ThemedIcon (icon_name);
}
}