src/Builder4/MainWindow.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 1 Feb 2024 11:31:55 +0000 (19:31 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 1 Feb 2024 11:31:55 +0000 (19:31 +0800)
src/Builder4/MainWindow.vala

src/Builder4/MainWindow.bjs
src/Builder4/MainWindow.vala

index fa1eaab..866de98 100644 (file)
            "  ( ) => {",
            "  \t_this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;",
            "  \tif (_this.splitview.el.show_sidebar) {",
-           "  \t\t_this.filesearch.el.grab_focus();",
-           "  \t\t_this.winloading = true;",
-           "  \t\t_this.winmodel.el.remove_all();",
-           "  \t\t_this.filesearch.el.set_text(\"\");",
-           "  \t\tfor(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {",
-           "\t\t\t_this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));",
-           "\t\t}",
-           "\t\t_this.winsel.selectCurrent();",
-           "\t\t_this.winloading = false;",
-           "\t\t",
-           "\t\t _this.treeview.el.set_model(new Gtk.SingleSelection(null));",
-           "\t\t",
-           "\t\t_this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);",
-           "\t\t",
-           "\t\t_this.treeview.el.set_model(_this.treeselmodel.el);",
-           "\t\t",
-           "\t \t _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;",
-           "\t\t",
-           "\t\t",
+           "  \t\t_this.sidebar.show(); ",
            " \t}",
            "}"
           ]
index bd69211..a898d87 100644 (file)
@@ -268,25 +268,7 @@ public class Xcls_MainWindow : Object
                        this.el.clicked.connect( ( ) => {
                                _this.splitview.el.show_sidebar = !_this.splitview.el.show_sidebar;
                                if (_this.splitview.el.show_sidebar) {
-                                       _this.filesearch.el.grab_focus();
-                                       _this.winloading = true;
-                                       _this.winmodel.el.remove_all();
-                                       _this.filesearch.el.set_text("");
-                                       for(var i = 0;i < BuilderApplication.windowlist.get_n_items(); i++) {
-                                               _this.winmodel.el.append( BuilderApplication.windowlist.get_item(i));
-                                       }
-                                       _this.winsel.selectCurrent();
-                                       _this.winloading = false;
-                                       
-                                        _this.treeview.el.set_model(new Gtk.SingleSelection(null));
-                                       
-                                       _this.windowstate.project.loadDirsIntoStore(_this.treemodel.el);
-                                       
-                                       _this.treeview.el.set_model(_this.treeselmodel.el);
-                                       
-                                        _this.treeselmodel.el.selected = Gtk.INVALID_LIST_POSITION;
-                                       
-                                       
+                                       _this.sidebar.show(); 
                                }
                        });
                }