File tree Expand file tree Collapse file tree 1 file changed +13
-3
lines changed
Expand file tree Collapse file tree 1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change @@ -120,9 +120,7 @@ public class Switchboard.SettingsSidebar : Gtk.Widget {
120120 }
121121 });
122122
123- stack. notify[" visible-child-name" ]. connect (() = > {
124- visible_child_name = stack. visible_child_name;
125- });
123+ stack. notify[" visible-child" ]. connect (update_selection);
126124
127125 bind_property (" show-title-buttons" , toolbarview, " reveal-top-bars" , SYNC_CREATE );
128126 }
@@ -131,6 +129,18 @@ public class Switchboard.SettingsSidebar : Gtk.Widget {
131129 get_first_child (). unparent ();
132130 }
133131
132+ private void update_selection () {
133+ for (var child = listbox. get_first_child (); child != null ; child = child. get_next_sibling ()) {
134+ if (child is SettingsSidebarRow ) {
135+ var row = (SettingsSidebarRow ) child;
136+ if (row. page == stack. visible_child) {
137+ listbox. select_row ((Gtk . ListBoxRow ) row);
138+ break ;
139+ }
140+ }
141+ }
142+ }
143+
134144 private Gtk .Widget create_widget_func (Object object ) {
135145 unowned var stack_page = (Gtk . StackPage ) object ;
136146 unowned var page = (SettingsPage ) stack_page. child;
You can’t perform that action at this time.
0 commit comments