Merge lp:~3v1n0/unity-2d/secondary-activate-support-v2 into lp:unity-2d

Proposed by Marco Trevisan (Treviño)
Status: Merged
Approved by: Florian Boucault
Approved revision: 638
Merged at revision: 641
Proposed branch: lp:~3v1n0/unity-2d/secondary-activate-support-v2
Merge into: lp:unity-2d
Diff against target: 27 lines (+7/-3)
1 file modified
panel/applets/common/indicatorentrywidget.cpp (+7/-3)
To merge this branch: bzr merge lp:~3v1n0/unity-2d/secondary-activate-support-v2
Reviewer Review Type Date Requested Status
Florian Boucault (community) Approve
Review via email: mp+70763@code.launchpad.net

Description of the change

[panel] Add support to "secondary-activate" event on middle-click, needed both by bug #609860 and bug #812933. See the second for more informations.

Patch adapted to the unity-core branch.

To post a comment you must log in.
Revision history for this message
Florian Boucault (fboucault) wrote :

Looks good and works as advertised.
Adding [panel] to commit message.

review: Approve

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'panel/applets/common/indicatorentrywidget.cpp'
2--- panel/applets/common/indicatorentrywidget.cpp 2011-08-03 09:01:59 +0000
3+++ panel/applets/common/indicatorentrywidget.cpp 2011-08-08 16:31:34 +0000
4@@ -309,16 +309,20 @@
5 return pix;
6 }
7
8-void IndicatorEntryWidget::mousePressEvent(QMouseEvent*)
9+void IndicatorEntryWidget::mousePressEvent(QMouseEvent* event)
10 {
11 UQ_RETURN_IF_FAIL(m_hasIcon || m_hasLabel);
12- showMenu(Qt::LeftButton);
13+ if (event->button() != Qt::MiddleButton)
14+ showMenu(Qt::LeftButton);
15 }
16
17-void IndicatorEntryWidget::mouseReleaseEvent(QMouseEvent*)
18+void IndicatorEntryWidget::mouseReleaseEvent(QMouseEvent* event)
19 {
20 UQ_VAR(this);
21 update();
22+
23+ if (event->button() == Qt::MiddleButton && rect().contains(event->pos(), false))
24+ m_entry->SecondaryActivate(time(NULL));
25 }
26
27 void IndicatorEntryWidget::wheelEvent(QWheelEvent* event)

Subscribers

People subscribed via source and target branches