sync
[app.Builder.js] / src / Builder4 / WindowLeftTree.vala
index 4c4dba4..be697e1 100644 (file)
@@ -225,6 +225,17 @@ public class Xcls_WindowLeftTree : Object
                         while (Gtk.events_pending()) {
                             Gtk.main_iteration();
                         }
+                        var cp = mod.get_path(iter);
+                        Gtk.TreePath sp, ep;
+                        this.el.get_visible_range(out sp, out ep);
+                        // if sp is before cp then retuns 1.
+                        // if cp is before ep then retuns 1.
+                        if (cp.compare(sp) >= 0 && ep.compare(cp) >=1) {
+                            return false;
+                        }
+                        
+                         
+                        
                         this.el.scroll_to_cell(new Gtk.TreePath.from_string(_this.model.activePath), null, true, 0.1f,0.0f);
                         
                         return false;
@@ -1237,15 +1248,13 @@ public class Xcls_WindowLeftTree : Object
                 // we only need to show the template if it's come from else where?
                  if (show_templates) {
                  
-                    if (this.template_select == null) {
-                        this.template_select = new DialogTemplateSelect();
-                     }
+                     var ts = _this.main_window.windowstate.template_select;
                  
-                     var new_node = this.template_select.show(
-                          (Gtk.Window) _this.el.get_toplevel (),
+                     var new_node = ts.show(
+                          _this.main_window, // (Gtk.Window) _this.el.get_toplevel (),
                               this.file.palete(),
-                           node,
-                            this.project);
+                            node,
+                            this.file.project);
                            
                      if (new_node == null) {
                          return; // do not add?