Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 13 additions & 3 deletions lib/SettingsSidebar.vala
Original file line number Diff line number Diff line change
Expand Up @@ -120,9 +120,7 @@ public class Switchboard.SettingsSidebar : Gtk.Widget {
}
});

stack.notify["visible-child-name"].connect (() => {
visible_child_name = stack.visible_child_name;
});
stack.notify["visible-child"].connect (update_selection);

bind_property ("show-title-buttons", toolbarview, "reveal-top-bars", SYNC_CREATE);
}
Expand All @@ -131,6 +129,18 @@ public class Switchboard.SettingsSidebar : Gtk.Widget {
get_first_child ().unparent ();
}

private void update_selection () {
for (var child = listbox.get_first_child (); child != null; child = child.get_next_sibling ()) {
if (child is SettingsSidebarRow) {
var row = (SettingsSidebarRow) child;
if (row.page == stack.visible_child) {
listbox.select_row ((Gtk.ListBoxRow) row);
break;
}
}
}
}

private Gtk.Widget create_widget_func (Object object) {
unowned var stack_page = (Gtk.StackPage) object;
unowned var page = (SettingsPage) stack_page.child;
Expand Down