diff options
Diffstat (limited to 'lib/source.vala')
-rw-r--r-- | lib/source.vala | 21 |
1 files changed, 10 insertions, 11 deletions
diff --git a/lib/source.vala b/lib/source.vala index 3e38a86e..5fe7157d 100644 --- a/lib/source.vala +++ b/lib/source.vala @@ -51,7 +51,7 @@ public class Indicator.Keyboard.Source : Object { public Icon? icon { get { if (_icon == null) { _icon = _get_icon (); } return _icon; } - private set { _icon = value; } + set { _icon = value; } } public uint subscript { @@ -69,6 +69,14 @@ public class Indicator.Keyboard.Source : Object { construct set { _use_gtk = value; icon = null; } } + public bool is_xkb { + get { return xkb != null; } + } + + public bool is_ibus { + get { return ibus != null; } + } + public Source (Variant variant, bool use_gtk = false) { Object (use_gtk: use_gtk); @@ -416,16 +424,7 @@ public class Indicator.Keyboard.Source : Object { Gtk.IconInfo? icon_info = icon_theme.lookup_icon (icon_name, 22, 0); if (icon_info != null) { - string? file_name = ((!) icon_info).get_filename (); - var has_file_name = file_name != null && ((!) file_name).get_char () != '\0'; - - if (has_file_name) { - try { - icon = Icon.new_for_string ((!) file_name); - } catch (Error error) { - warning ("error: %s", error.message); - } - } + icon = new ThemedIcon (icon_name); } } else { icon = new ThemedIcon (icon_name); |