diff options
author | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2015-10-28 15:34:16 +0100 |
---|---|---|
committer | Mike Gabriel <mike.gabriel@das-netzwerkteam.de> | 2015-10-28 15:34:16 +0100 |
commit | 252faeb6a6dd5a15154972cf15feec3692165bb9 (patch) | |
tree | 9f9b483bbcc0c4b0b9eef675acc54775660c539a /src/toggle-box.vala | |
parent | fac2a331bf9933175d54aa207f28436329c97204 (diff) | |
download | arctica-greeter-252faeb6a6dd5a15154972cf15feec3692165bb9.tar.gz arctica-greeter-252faeb6a6dd5a15154972cf15feec3692165bb9.tar.bz2 arctica-greeter-252faeb6a6dd5a15154972cf15feec3692165bb9.zip |
toggle-box.vala: Catch Glib.Error where it occurs when setting normal button style.
Diffstat (limited to 'src/toggle-box.vala')
-rw-r--r-- | src/toggle-box.vala | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/toggle-box.vala b/src/toggle-box.vala index fc6c579..91a3e57 100644 --- a/src/toggle-box.vala +++ b/src/toggle-box.vala @@ -44,6 +44,8 @@ public class ToggleBox : Gtk.Box public void set_normal_button_style (Gtk.Button button) { + try + { /* Tighten padding on buttons to not be so large, default color scheme for buttons */ var style = new Gtk.CssProvider (); style.load_from_data ("* {padding: 8px;}\n"+ @@ -56,7 +58,12 @@ public class ToggleBox : Gtk.Box " background-color: %s;\n".printf(AGSettings.get_string (AGSettings.KEY_TOGGLEBOX_BUTTON_BGCOLOR))+ "}\n", -1); button.get_style_context ().add_provider (style, Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION); - return; + } + catch (Error e) + { + debug ("Internal error loading session chooser style: %s", e.message); + } + return; } private Gtk.Button selected_button; @@ -125,14 +132,7 @@ public class ToggleBox : Gtk.Box item.add (hbox); hbox.show_all (); - try - { - set_normal_button_style (item); - } - catch (Error e) - { - debug ("Internal error loading session chooser style: %s", e.message); - } + set_normal_button_style (item); item.set_data<string> ("toggle-list-key", key); return item; |