@@ -73,7 +73,6 @@ public class MainWindow : Gtk.ApplicationWindow {
7373 private Paned _pane = null ;
7474 private Notebook ? _inspector_nb = null ;
7575 private Stack ? _stack = null ;
76- private StackSwitcher ? _sidebar_switcher = null ;
7776 private Popover ? _zoom = null ;
7877 private Popover ? _search = null ;
7978 private MenuButton ? _search_btn = null ;
@@ -325,7 +324,6 @@ public class MainWindow : Gtk.ApplicationWindow {
325324 case " auto-parse-embedded-urls" : setting_changed_embedded_urls(); break ;
326325 case " enable-markdown" : setting_changed_markdown(); break ;
327326 case " enable-unicode-input" : setting_changed_unicode_input(); break ;
328- case " compact-sidebar-width" : setting_changed_compact_sidebar(); break ;
329327 }
330328 });
331329
@@ -454,13 +452,6 @@ public class MainWindow : Gtk.ApplicationWindow {
454452 }
455453 }
456454
457- // -------------------------------------------------------------
458- // Called whenever the compact sidebar width setting is changed.
459- private void setting_changed_compact_sidebar() {
460- _sidebar_switcher. orientation = Minder . settings. get_boolean( " compact-sidebar-width" ) ? Orientation . VERTICAL : Orientation . HORIZONTAL ;
461- _pane. position = get_width() - 100 ;
462- }
463-
464455 // -------------------------------------------------------------
465456 // Called whenever the current tab is switched in the notebook
466457 private void tab_switched( Widget page, uint page_num ) {
@@ -1238,14 +1229,38 @@ public class MainWindow : Gtk.ApplicationWindow {
12381229 // Handle the enable-ui-animations value
12391230 setting_changed_ui_animations ();
12401231
1241- _sidebar_switcher = new StackSwitcher () {
1242- orientation = Minder.settings.get_boolean ( "compact -sidebar -width " ) ? Orientation.VERTICAL : Orientation.HORIZONTAL,
1243- halign = Align.FILL,
1244- stack = _stack
1232+ var sidebar_switcher = new ModeButtons () {
1233+ halign = Align . CENTER
12451234 };
12461235
1236+ sidebar_switcher.add_stack_tab ( _ ( "Current " ) );
1237+ sidebar_switcher.add_stack_tab ( _ ( "Style " ) );
1238+ sidebar_switcher.add_stack_tab ( _ ( "Tags " ) );
1239+ sidebar_switcher.add_stack_tab ( _ ( "Stickers " ) );
1240+ sidebar_switcher.add_stack_tab ( _ ( "Map " ) );
1241+
1242+ sidebar_switcher.changed.connect ((index ) => {
1243+ switch ( index ) {
1244+ case 0 : _stack. visible_child_name = " current" ; break ;
1245+ case 1 : _stack. visible_child_name = " style" ; break ;
1246+ case 2 : _stack. visible_child_name = " tag" ; break ;
1247+ case 3 : _stack. visible_child_name = " sticker" ; break ;
1248+ case 4 : _stack. visible_child_name = " map" ; break ;
1249+ }
1250+ });
1251+
1252+ _stack.notify["visible-child-name"].connect (() => {
1253+ switch ( _stack. visible_child_name ) {
1254+ case " current" : sidebar_switcher. selected = 0 ; break ;
1255+ case " style" : sidebar_switcher. selected = 1 ; break ;
1256+ case " tag" : sidebar_switcher. selected = 2 ; break ;
1257+ case " sticker" : sidebar_switcher. selected = 3 ; break ;
1258+ case " map" : sidebar_switcher. selected = 4 ; break ;
1259+ }
1260+ });
1261+
12471262 // Make sure that the tabs are displayed nicely
1248- Utils.set_switcher_tab_widths ( _sidebar_switcher );
1263+ Utils.set_switcher_tab_widths ( sidebar_switcher );
12491264
12501265 var box = new Box ( Orientation . VERTICAL , 20 ) {
12511266 halign = Align . FILL ,
@@ -1255,7 +1270,7 @@ public class MainWindow : Gtk.ApplicationWindow {
12551270 margin_top = 5 ,
12561271 margin_bottom = 5
12571272 };
1258- box.append ( _sidebar_switcher );
1273+ box.append ( sidebar_switcher );
12591274 box.append ( _stack );
12601275
12611276 _themer = new ThemeEditor ( this );
0 commit comments