diff --git a/lib/SettingsPage.vala b/lib/SettingsPage.vala index 663f013f..609de200 100644 --- a/lib/SettingsPage.vala +++ b/lib/SettingsPage.vala @@ -102,21 +102,19 @@ public abstract class Switchboard.SettingsPage : Gtk.Widget { }; title_label.add_css_class (Granite.STYLE_CLASS_H2_LABEL); + var description_label = new Gtk.Label (description) { + selectable = true, + use_markup = true, + wrap = true, + xalign = 0 + }; + var header_area = new Gtk.Grid (); header_area.attach (title_label, 1, 0); if (description != null) { - var description_label = new Gtk.Label (description) { - selectable = true, - use_markup = true, - wrap = true, - xalign = 0 - }; - header_area.attach (header_icon, 0, 0, 1, 2); header_area.attach (description_label, 1, 1, 2); - - bind_property ("description", description_label, "label"); } else { header_area.attach (header_icon, 0, 0); } @@ -161,15 +159,15 @@ public abstract class Switchboard.SettingsPage : Gtk.Widget { grid.append (action_bar); grid.set_parent (this); - notify["icon"].connect (() => { - if (header_icon != null) { - header_icon.gicon = icon; - } - }); + bind_property ("description", description_label, "label"); + bind_property ("icon", header_icon, "gicon"); + bind_property ("title", title_label, "label"); - notify["title"].connect (() => { - if (title_label != null) { - title_label.label = title; + notify["description"].connect (() => { + if (description_label.parent == null) { + header_area.remove (header_icon); + header_area.attach (header_icon, 0, 0, 1, 2); + header_area.attach (description_label, 1, 1, 2); } }); }