Merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inverse-mouse-area-move-allowed-on-clicks into lp:ubuntu-ui-toolkit

Proposed by Ugo Riboni
Status: Merged
Approved by: Zsombor Egri
Approved revision: 648
Merged at revision: 665
Proposed branch: lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inverse-mouse-area-move-allowed-on-clicks
Merge into: lp:ubuntu-ui-toolkit
Diff against target: 63 lines (+3/-10)
2 files modified
modules/Ubuntu/Components/plugin/inversemouseareatype.cpp (+3/-9)
modules/Ubuntu/Components/plugin/inversemouseareatype.h (+0/-1)
To merge this branch: bzr merge lp:~ubuntu-sdk-team/ubuntu-ui-toolkit/inverse-mouse-area-move-allowed-on-clicks
Reviewer Review Type Date Requested Status
PS Jenkins bot continuous-integration Approve
Zsombor Egri Approve
Review via email: mp+176362@code.launchpad.net

Commit message

Make InverseMouseArea and MouseArea behave the same way when the mouse is moved between a click and release event, i.e. they both generate a click.

Description of the change

Make InverseMouseArea and MouseArea behave the same way when the mouse is moved between a click and release event, i.e. they both generate a click.

To post a comment you must log in.
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Zsombor Egri (zsombi) wrote :

Looks good, works in the same way as MouseArea does

review: Approve
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
PS Jenkins bot (ps-jenkins) wrote :
review: Approve (continuous-integration)

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'modules/Ubuntu/Components/plugin/inversemouseareatype.cpp'
2--- modules/Ubuntu/Components/plugin/inversemouseareatype.cpp 2013-05-29 14:44:26 +0000
3+++ modules/Ubuntu/Components/plugin/inversemouseareatype.cpp 2013-07-23 11:57:39 +0000
4@@ -85,7 +85,6 @@
5 QQuickItem(parent),
6 m_ready(false),
7 m_pressed(false),
8- m_moved(false),
9 m_propagateEvents(false),
10 m_acceptedButtons(Qt::LeftButton),
11 m_sensingArea(QuickUtils::instance().rootItem(this)),
12@@ -293,7 +292,7 @@
13 */
14 void InverseMouseAreaType::reset()
15 {
16- m_pressed = m_moved = false;
17+ m_pressed = false;
18 if (m_event)
19 delete m_event;
20 m_event = 0;
21@@ -372,13 +371,11 @@
22 bool consume = true;
23 if (m_pressed && contains(mapFromScene(event->windowPos()))) {
24 // released outside (inside the sensing area)
25- saveEvent(*event, !m_moved);
26+ saveEvent(*event, true);
27 m_pressed = false;
28 asyncEmit(&InverseMouseAreaType::released);
29 Q_EMIT pressedChanged();
30- if (!m_moved)
31- asyncEmit(&InverseMouseAreaType::clicked);
32- m_moved = false;
33+ asyncEmit(&InverseMouseAreaType::clicked);
34 } else {
35 // the release happened inside the area, which is outside of the active area
36 reset();
37@@ -407,14 +404,11 @@
38 /*!
39 \internal
40 Captures mouse move event. Consumes event depending on the propagateEvent state.
41- Depending whether the mouse was moved after being pressed, the clicked composed
42- event will not be emitted.
43 */
44 bool InverseMouseAreaType::mouseMove(QMouseEvent *event)
45 {
46 // use localPos as we saved the mapped position as
47 if (m_pressed && m_event && (event->windowPos() != QPointF(m_event->x(), m_event->y()))) {
48- m_moved = true;
49 event->setAccepted(!m_propagateEvents);
50 }
51 return false;
52
53=== modified file 'modules/Ubuntu/Components/plugin/inversemouseareatype.h'
54--- modules/Ubuntu/Components/plugin/inversemouseareatype.h 2013-05-29 14:44:26 +0000
55+++ modules/Ubuntu/Components/plugin/inversemouseareatype.h 2013-07-23 11:57:39 +0000
56@@ -79,7 +79,6 @@
57 private:
58 bool m_ready;
59 bool m_pressed;
60- bool m_moved;
61 bool m_propagateEvents;
62 Qt::MouseButtons m_acceptedButtons;
63 QQuickItem *m_sensingArea;

Subscribers

People subscribed via source and target branches

to status/vote changes: