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
=== modified file 'panel/applets/common/indicatorentrywidget.cpp'
--- panel/applets/common/indicatorentrywidget.cpp 2011-08-03 09:01:59 +0000
+++ panel/applets/common/indicatorentrywidget.cpp 2011-08-08 16:31:34 +0000
@@ -309,16 +309,20 @@
309 return pix;309 return pix;
310}310}
311311
312void IndicatorEntryWidget::mousePressEvent(QMouseEvent*)312void IndicatorEntryWidget::mousePressEvent(QMouseEvent* event)
313{313{
314 UQ_RETURN_IF_FAIL(m_hasIcon || m_hasLabel);314 UQ_RETURN_IF_FAIL(m_hasIcon || m_hasLabel);
315 showMenu(Qt::LeftButton);315 if (event->button() != Qt::MiddleButton)
316 showMenu(Qt::LeftButton);
316}317}
317318
318void IndicatorEntryWidget::mouseReleaseEvent(QMouseEvent*)319void IndicatorEntryWidget::mouseReleaseEvent(QMouseEvent* event)
319{320{
320 UQ_VAR(this);321 UQ_VAR(this);
321 update();322 update();
323
324 if (event->button() == Qt::MiddleButton && rect().contains(event->pos(), false))
325 m_entry->SecondaryActivate(time(NULL));
322}326}
323327
324void IndicatorEntryWidget::wheelEvent(QWheelEvent* event)328void IndicatorEntryWidget::wheelEvent(QWheelEvent* event)

Subscribers

People subscribed via source and target branches