← Back to team overview

elementaryart team mailing list archive

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

 

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

Requested reviews:
  elementary Pantheon team (elementary-pantheon)
Related bugs:
  Bug #1027397 in Granite: "Pressing t without ctrl opens a new tab"
  https://bugs.launchpad.net/granite/+bug/1027397

For more details, see:
https://code.launchpad.net/~marcus-lundgren/granite/fix-1027397/+merge/116116
-- 
https://code.launchpad.net/~marcus-lundgren/granite/fix-1027397/+merge/116116
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 12:28:19 +0000
@@ -291,23 +291,29 @@
             this.key_press_event.connect ( (e) => {
                 switch (e.keyval){
                     case 119: //ctrl+w
-                    	if (!tabs_closable)
-                    		break;
+                        if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0){
+                            if (!tabs_closable)
+                                break;
                 		
-                        if (Signal.has_handler_pending (this, //if no one listens, just kill it!
-                            Signal.lookup ("tab-removed", typeof (DynamicNotebook)), 0, true)) {
-                            var sure = this.tab_removed (tabs.nth_data (this.notebook.page));
-                            if (sure)
+                            if (Signal.has_handler_pending (this, //if no one listens, just kill it!
+                                    Signal.lookup ("tab-removed", typeof (DynamicNotebook)), 0, true)) {
+                                var sure = this.tab_removed (tabs.nth_data (this.notebook.page));
+                                if (sure)
+                                    this.notebook.remove_page (this.notebook.page);
+                            } else {
                                 this.notebook.remove_page (this.notebook.page);
-                        } else {
-                            this.notebook.remove_page (this.notebook.page);
+                            }
+                            return true;
                         }
-                        return true;
+                        break;
                     case 116: //ctrl+t
-                        var t = new Tab ();
-                        this.tab_added (t);
-                        notebook.page = (int)this.insert_tab (t, -1);
-                        return true;
+                        if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0){
+                            var t = new Tab ();
+                            this.tab_added (t);
+                            notebook.page = (int)this.insert_tab (t, -1);
+                            return true;
+                        }
+                        break;
                     case 49: //ctrl+[1-8]
                     case 50:
                     case 51:


Follow ups