Merge lp:~aacid/unity-2d/unity-2d-shell_inputshaperectangle_improvements into lp:~unity-2d-team/unity-2d/unity-2d-shell

Proposed by Albert Astals Cid
Status: Merged
Approved by: Florian Boucault
Approved revision: 988
Merged at revision: 990
Proposed branch: lp:~aacid/unity-2d/unity-2d-shell_inputshaperectangle_improvements
Merge into: lp:~unity-2d-team/unity-2d/unity-2d-shell
Diff against target: 37 lines (+7/-2)
2 files modified
libunity-2d-private/src/inputshaperectangle.cpp (+5/-1)
libunity-2d-private/src/inputshaperectangle.h (+2/-1)
To merge this branch: bzr merge lp:~aacid/unity-2d/unity-2d-shell_inputshaperectangle_improvements
Reviewer Review Type Date Requested Status
Florian Boucault Pending
Review via email: mp+92031@code.launchpad.net

Description of the change

Improvements to InputShapeRectangle regarding the mirrorHorizontally property

To post a comment you must log in.
988. By Albert Astals Cid

Pass the value in the signal

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'libunity-2d-private/src/inputshaperectangle.cpp'
2--- libunity-2d-private/src/inputshaperectangle.cpp 2012-02-07 20:19:29 +0000
3+++ libunity-2d-private/src/inputshaperectangle.cpp 2012-02-08 14:02:20 +0000
4@@ -104,7 +104,11 @@
5
6 void InputShapeRectangle::setMirrorHorizontally(bool mirror)
7 {
8- m_mirrorHorizontally = mirror;
9+ if (mirror != m_mirrorHorizontally) {
10+ m_mirrorHorizontally = mirror;
11+ updateShape();
12+ Q_EMIT mirrorHorizontallyChanged(m_mirrorHorizontally);
13+ }
14 }
15
16 void InputShapeRectangle::appendMask(QDeclarativeListProperty<InputShapeMask> *list, InputShapeMask *mask)
17
18=== modified file 'libunity-2d-private/src/inputshaperectangle.h'
19--- libunity-2d-private/src/inputshaperectangle.h 2012-02-07 20:19:29 +0000
20+++ libunity-2d-private/src/inputshaperectangle.h 2012-02-08 14:02:20 +0000
21@@ -35,7 +35,7 @@
22 Q_OBJECT
23 Q_PROPERTY(QRect rectangle READ rectangle WRITE setRectangle NOTIFY rectangleChanged)
24 Q_PROPERTY(bool enabled READ enabled WRITE setEnabled NOTIFY enabledChanged)
25- Q_PROPERTY(bool mirrorHorizontally READ mirrorHorizontally WRITE setMirrorHorizontally)
26+ Q_PROPERTY(bool mirrorHorizontally READ mirrorHorizontally WRITE setMirrorHorizontally NOTIFY mirrorHorizontallyChanged)
27 Q_PROPERTY(QBitmap shape READ shape NOTIFY shapeChanged)
28 Q_PROPERTY(QDeclarativeListProperty<InputShapeMask> masks READ masks)
29 Q_CLASSINFO("DefaultProperty", "masks")
30@@ -62,6 +62,7 @@
31 void rectangleChanged();
32 void enabledChanged();
33 void shapeChanged();
34+ void mirrorHorizontallyChanged(bool mirrorHorizontally);
35
36 private:
37 QRect m_rectangle;

Subscribers

People subscribed via source and target branches