← Back to team overview

elementaryart team mailing list archive

[Merge] lp:~marcus-lundgren/granite/fix-959552 into lp:granite

 

Marcus Lundgren has proposed merging lp:~marcus-lundgren/granite/fix-959552 into lp:granite.

Requested reviews:
  elementary Pantheon team (elementary-pantheon)
Related bugs:
  Bug #959552 in Granite: "double click on tabbar to create new tab"
  https://bugs.launchpad.net/granite/+bug/959552

For more details, see:
https://code.launchpad.net/~marcus-lundgren/granite/fix-959552/+merge/116121
-- 
https://code.launchpad.net/~marcus-lundgren/granite/fix-959552/+merge/116121
Your team elementaryart (old) is subscribed to branch lp:granite.
=== modified file 'lib/Widgets/DynamicNotebook.vala'
--- lib/Widgets/DynamicNotebook.vala	2012-07-21 09:31:44 +0000
+++ lib/Widgets/DynamicNotebook.vala	2012-07-21 14:29:19 +0000
@@ -133,6 +133,14 @@
                 
                 return false;
             });
+
+            // Disable the double click signal on the tab
+            this.button_press_event.connect ( (e) => {
+                    if (e.type == Gdk.EventType.2BUTTON_PRESS)
+                        return true;
+                    return false;
+                });
+            
             page_container.button_press_event.connect (() => { return true; });//dont let clicks pass through
             close.clicked.connect ( () => closed () );
         }
@@ -267,6 +275,15 @@
             });
             
             this.add (this.notebook);
+
+            this.button_press_event.connect ( (e) => {
+                    if (e.type == Gdk.EventType.2BUTTON_PRESS && e.button == 1) {
+                        var t = new Tab ();
+                        notebook.page = (int)this.insert_tab (t, -1);
+                        this.tab_added (t);
+                    }
+                    return false;
+                });
             
             
             var add = new Gtk.Button ();


Follow ups