Merge lp:~niclasl/granite/fix-dn-add-button into lp:~elementary-pantheon/granite/granite

Proposed by Niclas Lockner
Status: Merged
Approved by: David Gomes
Approved revision: 669
Merged at revision: 669
Proposed branch: lp:~niclasl/granite/fix-dn-add-button
Merge into: lp:~elementary-pantheon/granite/granite
Diff against target: 15 lines (+5/-0)
1 file modified
lib/Widgets/DynamicNotebook.vala (+5/-0)
To merge this branch: bzr merge lp:~niclasl/granite/fix-dn-add-button
Reviewer Review Type Date Requested Status
David Gomes (community) Approve
Review via email: mp+200118@code.launchpad.net

Commit message

Made the add button absorb double-clicks.

Description of the change

Let DynamicNotebook's add button consume double-click events.
With this change, double-clicks on the add button no longer lead to three new tabs.

To post a comment you must log in.
Revision history for this message
David Gomes (davidgomes) wrote :

Thanks, worked perfectly :)

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 2013-12-23 20:20:32 +0000
3+++ lib/Widgets/DynamicNotebook.vala 2013-12-27 16:37:57 +0000
4@@ -694,6 +694,11 @@
5 new_tab_requested ();
6 });
7
8+ add_button.button_press_event.connect ((e) => {
9+ // Consume double-clicks
10+ return e.type == Gdk.EventType.2BUTTON_PRESS && e.button == 1;
11+ });
12+
13 restore_button.clicked.connect (() => {
14 var menu = closed_tabs.menu;
15 menu.attach_widget = restore_button;

Subscribers

People subscribed via source and target branches