Merge lp:~marcus-lundgren/granite/fix-1027397 into lp:~elementary-pantheon/granite/granite

Proposed by Marcus Lundgren
Status: Merged
Merged at revision: 315
Proposed branch: lp:~marcus-lundgren/granite/fix-1027397
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 46 lines (+19/-13)
1 file modified
lib/Widgets/DynamicNotebook.vala (+19/-13)
To merge this branch: bzr merge lp:~marcus-lundgren/granite/fix-1027397
Reviewer Review Type Date Requested Status
Cody Garver (community) Approve
Review via email: mp+116116@code.launchpad.net
To post a comment you must log in.
Revision history for this message
Cody Garver (codygarver) wrote :

Seems to work fine.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'lib/Widgets/DynamicNotebook.vala'
2--- lib/Widgets/DynamicNotebook.vala 2012-07-21 09:31:44 +0000
3+++ lib/Widgets/DynamicNotebook.vala 2012-07-21 12:28:19 +0000
4@@ -291,23 +291,29 @@
5 this.key_press_event.connect ( (e) => {
6 switch (e.keyval){
7 case 119: //ctrl+w
8- if (!tabs_closable)
9- break;
10+ if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0){
11+ if (!tabs_closable)
12+ break;
13
14- if (Signal.has_handler_pending (this, //if no one listens, just kill it!
15- Signal.lookup ("tab-removed", typeof (DynamicNotebook)), 0, true)) {
16- var sure = this.tab_removed (tabs.nth_data (this.notebook.page));
17- if (sure)
18+ if (Signal.has_handler_pending (this, //if no one listens, just kill it!
19+ Signal.lookup ("tab-removed", typeof (DynamicNotebook)), 0, true)) {
20+ var sure = this.tab_removed (tabs.nth_data (this.notebook.page));
21+ if (sure)
22+ this.notebook.remove_page (this.notebook.page);
23+ } else {
24 this.notebook.remove_page (this.notebook.page);
25- } else {
26- this.notebook.remove_page (this.notebook.page);
27+ }
28+ return true;
29 }
30- return true;
31+ break;
32 case 116: //ctrl+t
33- var t = new Tab ();
34- this.tab_added (t);
35- notebook.page = (int)this.insert_tab (t, -1);
36- return true;
37+ if ((e.state & Gdk.ModifierType.CONTROL_MASK) != 0){
38+ var t = new Tab ();
39+ this.tab_added (t);
40+ notebook.page = (int)this.insert_tab (t, -1);
41+ return true;
42+ }
43+ break;
44 case 49: //ctrl+[1-8]
45 case 50:
46 case 51:

Subscribers

People subscribed via source and target branches