Merge lp:~bzoltan/ubuntu-ui-toolkit/landing_2006 into lp:ubuntu-ui-toolkit
- landing_2006
- Merge into trunk
Status: | Rejected |
---|---|
Rejected by: | Zoltan Balogh |
Proposed branch: | lp:~bzoltan/ubuntu-ui-toolkit/landing_2006 |
Merge into: | lp:ubuntu-ui-toolkit |
Diff against target: |
662 lines (+369/-77) 12 files modified
debian/changelog (+25/-0) debian/ubuntu-ui-toolkit-autopilot.install (+1/-1) modules/Ubuntu/Components/Icon.qml (+2/-2) modules/Ubuntu/Components/Label.qml (+0/-2) modules/Ubuntu/Components/OrientationHelper.qml (+55/-21) modules/Ubuntu/Components/plugin/uctheme.cpp (+10/-0) tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py (+5/-1) tests/launcher/MouseTouchAdaptor.cpp (+159/-0) tests/launcher/MouseTouchAdaptor.h (+50/-0) tests/launcher/launcher.cpp (+51/-46) tests/launcher/launcher.pro (+6/-4) tests/unit/tst_components/tst_label.qml (+5/-0) |
To merge this branch: | bzr merge lp:~bzoltan/ubuntu-ui-toolkit/landing_2006 |
Related bugs: |
Reviewer | Review Type | Date Requested | Status |
---|---|---|---|
PS Jenkins bot | continuous-integration | Needs Fixing | |
Zsombor Egri | Pending | ||
Review via email: mp+223858@code.launchpad.net |
Commit message
[ Florian Boucault ]
* OrientationHelper: made rotation animation visually smoother.
* Icon: remove warning when Icon.visible is set to false:
ShaderEffect: Property 'source' is not assigned a valid
texture provider (QQuickImage*).
* OrientationHelper: prevent unnecessary changes of width
and height with a workaround.
[ Tim Peeters ]
* Fix empty toolbar bug with Qt 5.3.
Fixes: https:/
[ Zsombor Egri]
* Default font for the toolkit: Ubuntu, medium sized and light
weight. Fixes: https:/
* Extend launcher to convert mouse to touch events.
MouseTouchA
[ Christian Dywan ]
* Multi-arch aware alternative launcher.
Description of the change
[ Florian Boucault ]
* OrientationHelper: made rotation animation visually smoother.
* Icon: remove warning when Icon.visible is set to false:
ShaderEffect: Property 'source' is not assigned a valid
texture provider (QQuickImage*).
* OrientationHelper: prevent unnecessary changes of width
and height with a workaround.
[ Tim Peeters ]
* Fix empty toolbar bug with Qt 5.3.
Fixes: https:/
[ Zsombor Egri]
* Default font for the toolkit: Ubuntu, medium sized and light
weight. Fixes: https:/
* Extend launcher to convert mouse to touch events.
MouseTouchA
[ Christian Dywan ]
* Multi-arch aware alternative launcher.
PS Jenkins bot (ps-jenkins) wrote : | # |
- 1115. By Zoltan Balogh
-
Changelog update for the release
PS Jenkins bot (ps-jenkins) wrote : | # |
FAILED: Continuous integration, rev:1115
http://
Executed test runs:
SUCCESS: http://
FAILURE: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
SUCCESS: http://
deb: http://
SUCCESS: http://
FAILURE: http://
Click here to trigger a rebuild:
http://
Unmerged revisions
- 1115. By Zoltan Balogh
-
Changelog update for the release
- 1114. By Zoltan Balogh
-
Changelog update for the release
Preview Diff
1 | === modified file 'debian/changelog' | |||
2 | --- debian/changelog 2014-06-19 06:55:24 +0000 | |||
3 | +++ debian/changelog 2014-06-20 19:21:15 +0000 | |||
4 | @@ -1,3 +1,28 @@ | |||
5 | 1 | ubuntu-ui-toolkit (0.1.47+14.10.20140619-0ubuntu2) UNRELEASED; urgency=medium | ||
6 | 2 | |||
7 | 3 | [ Florian Boucault ] | ||
8 | 4 | * OrientationHelper: made rotation animation visually smoother. | ||
9 | 5 | * Icon: remove warning when Icon.visible is set to false: | ||
10 | 6 | ShaderEffect: Property 'source' is not assigned a valid | ||
11 | 7 | texture provider (QQuickImage*). | ||
12 | 8 | * OrientationHelper: prevent unnecessary changes of width | ||
13 | 9 | and height with a workaround. | ||
14 | 10 | |||
15 | 11 | [ Tim Peeters ] | ||
16 | 12 | * Fix empty toolbar bug with Qt 5.3. | ||
17 | 13 | Fixes: https://bugs.launchpad.net/bugs/1327189.* | ||
18 | 14 | |||
19 | 15 | [ Zsombor Egri] | ||
20 | 16 | * Default font for the toolkit: Ubuntu, medium sized and light | ||
21 | 17 | weight. Fixes: https://bugs.launchpad.net/bugs/1263963. | ||
22 | 18 | * Extend launcher to convert mouse to touch events. | ||
23 | 19 | MouseTouchAdaptor taken from unity8 launcher. | ||
24 | 20 | |||
25 | 21 | [ Christian Dywan ] | ||
26 | 22 | * Multi-arch aware alternative launcher. | ||
27 | 23 | |||
28 | 24 | -- Zoltán Balogh <zoltan@bakter.hu> Fri, 20 Jun 2014 21:20:05 +0200 | ||
29 | 25 | |||
30 | 1 | ubuntu-ui-toolkit (0.1.47+14.10.20140619-0ubuntu1) utopic; urgency=low | 26 | ubuntu-ui-toolkit (0.1.47+14.10.20140619-0ubuntu1) utopic; urgency=low |
31 | 2 | 27 | ||
32 | 3 | [ Ubuntu daily release ] | 28 | [ Ubuntu daily release ] |
33 | 4 | 29 | ||
34 | === modified file 'debian/ubuntu-ui-toolkit-autopilot.install' | |||
35 | --- debian/ubuntu-ui-toolkit-autopilot.install 2014-05-14 11:00:20 +0000 | |||
36 | +++ debian/ubuntu-ui-toolkit-autopilot.install 2014-06-20 19:21:15 +0000 | |||
37 | @@ -1,3 +1,3 @@ | |||
38 | 1 | usr/lib/python3 | 1 | usr/lib/python3 |
40 | 2 | usr/lib/ubuntu-ui-toolkit/launcher | 2 | usr/lib/*/ubuntu-ui-toolkit/launcher |
41 | 3 | usr/lib/python2.7 | 3 | usr/lib/python2.7 |
42 | 4 | 4 | ||
43 | === modified file 'modules/Ubuntu/Components/Icon.qml' | |||
44 | --- modules/Ubuntu/Components/Icon.qml 2014-04-23 08:50:20 +0000 | |||
45 | +++ modules/Ubuntu/Components/Icon.qml 2014-06-20 19:21:15 +0000 | |||
46 | @@ -103,12 +103,12 @@ | |||
47 | 103 | id: colorizedImage | 103 | id: colorizedImage |
48 | 104 | 104 | ||
49 | 105 | anchors.fill: parent | 105 | anchors.fill: parent |
51 | 106 | visible: active && image.status == Image.Ready | 106 | visible: active |
52 | 107 | 107 | ||
53 | 108 | // Whether or not a color has been set. | 108 | // Whether or not a color has been set. |
54 | 109 | property bool active: keyColorOut != Qt.rgba(0.0, 0.0, 0.0, 0.0) | 109 | property bool active: keyColorOut != Qt.rgba(0.0, 0.0, 0.0, 0.0) |
55 | 110 | 110 | ||
57 | 111 | property Image source: visible ? image : null | 111 | property Image source: active && image.status == Image.Ready ? image : null |
58 | 112 | property color keyColorOut: Qt.rgba(0.0, 0.0, 0.0, 0.0) | 112 | property color keyColorOut: Qt.rgba(0.0, 0.0, 0.0, 0.0) |
59 | 113 | property color keyColorIn: "#808080" | 113 | property color keyColorIn: "#808080" |
60 | 114 | property real threshold: 0.1 | 114 | property real threshold: 0.1 |
61 | 115 | 115 | ||
62 | === modified file 'modules/Ubuntu/Components/Label.qml' | |||
63 | --- modules/Ubuntu/Components/Label.qml 2014-05-22 09:44:01 +0000 | |||
64 | +++ modules/Ubuntu/Components/Label.qml 2014-06-20 19:21:15 +0000 | |||
65 | @@ -55,8 +55,6 @@ | |||
66 | 55 | property string fontSize: "medium" | 55 | property string fontSize: "medium" |
67 | 56 | 56 | ||
68 | 57 | font.pixelSize: FontUtils.sizeToPixels(fontSize) | 57 | font.pixelSize: FontUtils.sizeToPixels(fontSize) |
69 | 58 | font.family: "Ubuntu" | ||
70 | 59 | font.weight: Font.Light | ||
71 | 60 | color: Theme.palette.selected.backgroundText | 58 | color: Theme.palette.selected.backgroundText |
72 | 61 | 59 | ||
73 | 62 | /* FIXME: workaround for QTBUG 35095 where Text's alignment is incorrect | 60 | /* FIXME: workaround for QTBUG 35095 where Text's alignment is incorrect |
74 | 63 | 61 | ||
75 | === modified file 'modules/Ubuntu/Components/OrientationHelper.qml' | |||
76 | --- modules/Ubuntu/Components/OrientationHelper.qml 2014-06-09 09:07:40 +0000 | |||
77 | +++ modules/Ubuntu/Components/OrientationHelper.qml 2014-06-20 19:21:15 +0000 | |||
78 | @@ -14,7 +14,7 @@ | |||
79 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. |
80 | 15 | */ | 15 | */ |
81 | 16 | 16 | ||
83 | 17 | import QtQuick 2.0 | 17 | import QtQuick 2.2 |
84 | 18 | import QtQuick.Window 2.0 | 18 | import QtQuick.Window 2.0 |
85 | 19 | import Ubuntu.Components 1.0 | 19 | import Ubuntu.Components 1.0 |
86 | 20 | 20 | ||
87 | @@ -136,6 +136,17 @@ | |||
88 | 136 | target: orientationHelper | 136 | target: orientationHelper |
89 | 137 | rotation: 0 | 137 | rotation: 0 |
90 | 138 | } | 138 | } |
91 | 139 | StateChangeScript { | ||
92 | 140 | name: "anchorsScript" | ||
93 | 141 | script: { | ||
94 | 142 | orientationHelper.anchors.fill = null; | ||
95 | 143 | orientationHelper.anchors.leftMargin = 0; | ||
96 | 144 | orientationHelper.anchors.rightMargin = 0; | ||
97 | 145 | orientationHelper.anchors.topMargin = 0; | ||
98 | 146 | orientationHelper.anchors.bottomMargin = 0; | ||
99 | 147 | orientationHelper.anchors.fill = orientationHelper.parent; | ||
100 | 148 | } | ||
101 | 149 | } | ||
102 | 139 | }, | 150 | }, |
103 | 140 | State { | 151 | State { |
104 | 141 | name: "180" | 152 | name: "180" |
105 | @@ -143,17 +154,33 @@ | |||
106 | 143 | target: orientationHelper | 154 | target: orientationHelper |
107 | 144 | rotation: 180 | 155 | rotation: 180 |
108 | 145 | } | 156 | } |
109 | 157 | StateChangeScript { | ||
110 | 158 | name: "anchorsScript" | ||
111 | 159 | script: { | ||
112 | 160 | orientationHelper.anchors.fill = null; | ||
113 | 161 | orientationHelper.anchors.leftMargin = 0; | ||
114 | 162 | orientationHelper.anchors.rightMargin = 0; | ||
115 | 163 | orientationHelper.anchors.topMargin = 0; | ||
116 | 164 | orientationHelper.anchors.bottomMargin = 0; | ||
117 | 165 | orientationHelper.anchors.fill = orientationHelper.parent; | ||
118 | 166 | } | ||
119 | 167 | } | ||
120 | 146 | }, | 168 | }, |
121 | 147 | State { | 169 | State { |
122 | 148 | name: "270" | 170 | name: "270" |
123 | 149 | PropertyChanges { | 171 | PropertyChanges { |
124 | 150 | target: orientationHelper | 172 | target: orientationHelper |
125 | 151 | rotation: 270 | 173 | rotation: 270 |
131 | 152 | anchors { | 174 | } |
132 | 153 | leftMargin: (parent.width - parent.height) / 2 | 175 | StateChangeScript { |
133 | 154 | rightMargin: anchors.leftMargin | 176 | name: "anchorsScript" |
134 | 155 | topMargin: -anchors.leftMargin | 177 | script: { |
135 | 156 | bottomMargin: anchors.topMargin | 178 | orientationHelper.anchors.fill = null; |
136 | 179 | orientationHelper.anchors.topMargin = Qt.binding(function() {return -(parent.width - parent.height) / 2}); | ||
137 | 180 | orientationHelper.anchors.bottomMargin = Qt.binding(function() {return -(parent.width - parent.height) / 2}); | ||
138 | 181 | orientationHelper.anchors.leftMargin = Qt.binding(function() {return (parent.width - parent.height) / 2}); | ||
139 | 182 | orientationHelper.anchors.rightMargin = Qt.binding(function() {return (parent.width - parent.height) / 2}); | ||
140 | 183 | orientationHelper.anchors.fill = orientationHelper.parent; | ||
141 | 157 | } | 184 | } |
142 | 158 | } | 185 | } |
143 | 159 | }, | 186 | }, |
144 | @@ -162,11 +189,16 @@ | |||
145 | 162 | PropertyChanges { | 189 | PropertyChanges { |
146 | 163 | target: orientationHelper | 190 | target: orientationHelper |
147 | 164 | rotation: 90 | 191 | rotation: 90 |
153 | 165 | anchors { | 192 | } |
154 | 166 | leftMargin: (parent.width - parent.height) / 2 | 193 | StateChangeScript { |
155 | 167 | rightMargin: anchors.leftMargin | 194 | name: "anchorsScript" |
156 | 168 | topMargin: -anchors.leftMargin | 195 | script: { |
157 | 169 | bottomMargin: anchors.topMargin | 196 | orientationHelper.anchors.fill = null; |
158 | 197 | orientationHelper.anchors.topMargin = Qt.binding(function() {return -(parent.width - parent.height) / 2}); | ||
159 | 198 | orientationHelper.anchors.bottomMargin = Qt.binding(function() {return -(parent.width - parent.height) / 2}); | ||
160 | 199 | orientationHelper.anchors.leftMargin = Qt.binding(function() {return (parent.width - parent.height) / 2}); | ||
161 | 200 | orientationHelper.anchors.rightMargin = Qt.binding(function() {return (parent.width - parent.height) / 2}); | ||
162 | 201 | orientationHelper.anchors.fill = orientationHelper.parent; | ||
163 | 170 | } | 202 | } |
164 | 171 | } | 203 | } |
165 | 172 | } | 204 | } |
166 | @@ -176,18 +208,20 @@ | |||
167 | 176 | Transition { | 208 | Transition { |
168 | 177 | id: orientationTransition | 209 | id: orientationTransition |
169 | 178 | ParallelAnimation { | 210 | ParallelAnimation { |
178 | 179 | SequentialAnimation { | 211 | /* FIXME: this is a workaround for 2 issues that trigger too many changes |
179 | 180 | PauseAnimation { | 212 | to the width and height of orientationHelper which creates intermediary |
180 | 181 | duration: 25 | 213 | states of the UI with unexpected sizes: |
181 | 182 | } | 214 | 1) upon state change fast-forwarding is used which means that the final values are computed and applied |
182 | 183 | PropertyAction { | 215 | then immediately reverted before the actual transition is applied |
183 | 184 | target: orientationHelper | 216 | 2) when margins are applied, width and height are updated separately |
184 | 185 | properties: "anchors.topMargin,anchors.bottomMargin,anchors.rightMargin,anchors.leftMargin" | 217 | |
185 | 186 | } | 218 | Without these issues, regular PropertyChanges could be used to set the margins. |
186 | 219 | */ | ||
187 | 220 | ScriptAction { | ||
188 | 221 | scriptName: "anchorsScript" | ||
189 | 187 | } | 222 | } |
191 | 188 | RotationAnimation { | 223 | RotationAnimator { |
192 | 189 | target: orientationHelper | 224 | target: orientationHelper |
193 | 190 | properties: "rotation" | ||
194 | 191 | duration: UbuntuAnimation.FastDuration | 225 | duration: UbuntuAnimation.FastDuration |
195 | 192 | easing: UbuntuAnimation.StandardEasing | 226 | easing: UbuntuAnimation.StandardEasing |
196 | 193 | direction: RotationAnimation.Shortest | 227 | direction: RotationAnimation.Shortest |
197 | 194 | 228 | ||
198 | === modified file 'modules/Ubuntu/Components/plugin/uctheme.cpp' | |||
199 | --- modules/Ubuntu/Components/plugin/uctheme.cpp 2014-06-09 08:43:30 +0000 | |||
200 | +++ modules/Ubuntu/Components/plugin/uctheme.cpp 2014-06-20 19:21:15 +0000 | |||
201 | @@ -21,6 +21,7 @@ | |||
202 | 21 | #include "listener.h" | 21 | #include "listener.h" |
203 | 22 | #include "quickutils.h" | 22 | #include "quickutils.h" |
204 | 23 | #include "i18n.h" | 23 | #include "i18n.h" |
205 | 24 | #include "ucfontutils.h" | ||
206 | 24 | 25 | ||
207 | 25 | #include <QtQml/qqml.h> | 26 | #include <QtQml/qqml.h> |
208 | 26 | #include <QtQml/qqmlinfo.h> | 27 | #include <QtQml/qqmlinfo.h> |
209 | @@ -32,6 +33,8 @@ | |||
210 | 32 | #include <QtCore/QTextStream> | 33 | #include <QtCore/QTextStream> |
211 | 33 | #include <QtCore/QLibraryInfo> | 34 | #include <QtCore/QLibraryInfo> |
212 | 34 | #include <QtCore/QStandardPaths> | 35 | #include <QtCore/QStandardPaths> |
213 | 36 | #include <QtGui/QGuiApplication> | ||
214 | 37 | #include <QtGui/QFont> | ||
215 | 35 | 38 | ||
216 | 36 | /*! | 39 | /*! |
217 | 37 | \qmltype Theme | 40 | \qmltype Theme |
218 | @@ -114,6 +117,13 @@ | |||
219 | 114 | 117 | ||
220 | 115 | QObject::connect(this, SIGNAL(nameChanged()), | 118 | QObject::connect(this, SIGNAL(nameChanged()), |
221 | 116 | this, SLOT(loadPalette()), Qt::UniqueConnection); | 119 | this, SLOT(loadPalette()), Qt::UniqueConnection); |
222 | 120 | |||
223 | 121 | // set the default font | ||
224 | 122 | QFont defaultFont; | ||
225 | 123 | defaultFont.setFamily("Ubuntu"); | ||
226 | 124 | defaultFont.setPixelSize(UCFontUtils::instance().sizeToPixels("medium")); | ||
227 | 125 | defaultFont.setWeight(QFont::Light); | ||
228 | 126 | QGuiApplication::setFont(defaultFont); | ||
229 | 117 | } | 127 | } |
230 | 118 | 128 | ||
231 | 119 | void UCTheme::updateEnginePaths() | 129 | void UCTheme::updateEnginePaths() |
232 | 120 | 130 | ||
233 | === modified file 'tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py' | |||
234 | --- tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-05-30 08:21:45 +0000 | |||
235 | +++ tests/autopilot/ubuntuuitoolkit/tests/custom_proxy_objects/test_flickable.py 2014-06-20 19:21:15 +0000 | |||
236 | @@ -15,6 +15,7 @@ | |||
237 | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. | 15 | # along with this program. If not, see <http://www.gnu.org/licenses/>. |
238 | 16 | 16 | ||
239 | 17 | import os | 17 | import os |
240 | 18 | import subprocess | ||
241 | 18 | 19 | ||
242 | 19 | import testtools | 20 | import testtools |
243 | 20 | import ubuntuuitoolkit | 21 | import ubuntuuitoolkit |
244 | @@ -206,8 +207,11 @@ | |||
245 | 206 | if os.path.exists(path_to_local_launcher): | 207 | if os.path.exists(path_to_local_launcher): |
246 | 207 | return path_to_local_launcher | 208 | return path_to_local_launcher |
247 | 208 | else: | 209 | else: |
248 | 210 | arch = subprocess.check_output( | ||
249 | 211 | ["dpkg-architecture", "-qDEB_HOST_MULTIARCH"], | ||
250 | 212 | universal_newlines=True).strip() | ||
251 | 209 | path_to_installed_launcher = os.path.join( | 213 | path_to_installed_launcher = os.path.join( |
253 | 210 | '/', 'usr', 'lib', 'ubuntu-ui-toolkit', 'launcher') | 214 | '/', 'usr', 'lib', arch, 'ubuntu-ui-toolkit', 'launcher') |
254 | 211 | return path_to_installed_launcher | 215 | return path_to_installed_launcher |
255 | 212 | 216 | ||
256 | 213 | def test_get_unity_top_container(self): | 217 | def test_get_unity_top_container(self): |
257 | 214 | 218 | ||
258 | === added file 'tests/launcher/MouseTouchAdaptor.cpp' | |||
259 | --- tests/launcher/MouseTouchAdaptor.cpp 1970-01-01 00:00:00 +0000 | |||
260 | +++ tests/launcher/MouseTouchAdaptor.cpp 2014-06-20 19:21:15 +0000 | |||
261 | @@ -0,0 +1,159 @@ | |||
262 | 1 | /* | ||
263 | 2 | * Copyright 2014 Canonical Ltd. | ||
264 | 3 | * | ||
265 | 4 | * This program is free software; you can redistribute it and/or modify | ||
266 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
267 | 6 | * the Free Software Foundation; version 3. | ||
268 | 7 | * | ||
269 | 8 | * This program is distributed in the hope that it will be useful, | ||
270 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
271 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
272 | 11 | * GNU Lesser General Public License for more details. | ||
273 | 12 | * | ||
274 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
275 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
276 | 15 | * | ||
277 | 16 | * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com> | ||
278 | 17 | * | ||
279 | 18 | */ | ||
280 | 19 | |||
281 | 20 | #include "MouseTouchAdaptor.h" | ||
282 | 21 | |||
283 | 22 | #include <qpa/qwindowsysteminterface.h> | ||
284 | 23 | |||
285 | 24 | #include <QtGui/QMouseEvent> | ||
286 | 25 | #include <QtTest/QTest> | ||
287 | 26 | |||
288 | 27 | using QTest::QTouchEventSequence; | ||
289 | 28 | |||
290 | 29 | namespace { | ||
291 | 30 | Qt::MouseButton translateMouseButton(xcb_button_t detail) | ||
292 | 31 | { | ||
293 | 32 | switch (detail) { | ||
294 | 33 | case 1: return Qt::LeftButton; | ||
295 | 34 | case 2: return Qt::MidButton; | ||
296 | 35 | case 3: return Qt::RightButton; | ||
297 | 36 | // Button values 4-7 are Wheel events | ||
298 | 37 | default: return Qt::NoButton; | ||
299 | 38 | } | ||
300 | 39 | } | ||
301 | 40 | } // end of anonymous namespace | ||
302 | 41 | |||
303 | 42 | MouseTouchAdaptor::MouseTouchAdaptor() | ||
304 | 43 | : m_leftButtonIsPressed(false) | ||
305 | 44 | { | ||
306 | 45 | m_touchDevice = new QTouchDevice; | ||
307 | 46 | m_touchDevice->setType(QTouchDevice::TouchScreen); | ||
308 | 47 | QWindowSystemInterface::registerTouchDevice(m_touchDevice); | ||
309 | 48 | } | ||
310 | 49 | |||
311 | 50 | bool MouseTouchAdaptor::nativeEventFilter(const QByteArray & eventType, | ||
312 | 51 | void * message, long * /*result*/) | ||
313 | 52 | { | ||
314 | 53 | if (eventType != "xcb_generic_event_t") { | ||
315 | 54 | // wrong backend. | ||
316 | 55 | qWarning("MouseTouchAdaptor: XCB backend not in use. Adaptor inoperative!"); | ||
317 | 56 | return false; | ||
318 | 57 | } | ||
319 | 58 | |||
320 | 59 | xcb_generic_event_t *xcbEvent = static_cast<xcb_generic_event_t *>(message); | ||
321 | 60 | |||
322 | 61 | switch (xcbEvent->response_type & ~0x80) { | ||
323 | 62 | case XCB_BUTTON_PRESS: | ||
324 | 63 | return handleButtonPress(reinterpret_cast<xcb_button_press_event_t *>(xcbEvent)); | ||
325 | 64 | break; | ||
326 | 65 | case XCB_BUTTON_RELEASE: | ||
327 | 66 | return handleButtonRelease(reinterpret_cast<xcb_button_release_event_t *>(xcbEvent)); | ||
328 | 67 | break; | ||
329 | 68 | case XCB_MOTION_NOTIFY: | ||
330 | 69 | return handleMotionNotify(reinterpret_cast<xcb_motion_notify_event_t *>(xcbEvent)); | ||
331 | 70 | break; | ||
332 | 71 | default: | ||
333 | 72 | return false; | ||
334 | 73 | break; | ||
335 | 74 | }; | ||
336 | 75 | } | ||
337 | 76 | |||
338 | 77 | bool MouseTouchAdaptor::handleButtonPress(xcb_button_press_event_t *pressEvent) | ||
339 | 78 | { | ||
340 | 79 | Qt::MouseButton button = translateMouseButton(pressEvent->detail); | ||
341 | 80 | |||
342 | 81 | // Skip the event if it wasn't a left mouse press | ||
343 | 82 | if (button != Qt::LeftButton) { | ||
344 | 83 | return false; | ||
345 | 84 | } | ||
346 | 85 | |||
347 | 86 | QPoint windowPos(pressEvent->event_x, pressEvent->event_y); | ||
348 | 87 | |||
349 | 88 | QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(pressEvent->event)); | ||
350 | 89 | |||
351 | 90 | // no autoCommit | ||
352 | 91 | QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false); | ||
353 | 92 | touchEvent.press(0, windowPos); | ||
354 | 93 | // do not process events when committed, let the events be processed with next event loop | ||
355 | 94 | touchEvent.commit(false); | ||
356 | 95 | |||
357 | 96 | m_leftButtonIsPressed = true; | ||
358 | 97 | return true; | ||
359 | 98 | } | ||
360 | 99 | |||
361 | 100 | bool MouseTouchAdaptor::handleButtonRelease(xcb_button_release_event_t *releaseEvent) | ||
362 | 101 | { | ||
363 | 102 | Qt::MouseButton button = translateMouseButton(releaseEvent->detail); | ||
364 | 103 | |||
365 | 104 | // Skip the event if it wasn't a left mouse release | ||
366 | 105 | if (button != Qt::LeftButton) { | ||
367 | 106 | return false; | ||
368 | 107 | } | ||
369 | 108 | |||
370 | 109 | QPoint windowPos(releaseEvent->event_x, releaseEvent->event_y); | ||
371 | 110 | |||
372 | 111 | QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(releaseEvent->event)); | ||
373 | 112 | |||
374 | 113 | // no autoCommit | ||
375 | 114 | QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false); | ||
376 | 115 | touchEvent.release(0, windowPos); | ||
377 | 116 | // do not process events when committed, let the events be processed with next event loop | ||
378 | 117 | touchEvent.commit(false); | ||
379 | 118 | |||
380 | 119 | m_leftButtonIsPressed = false; | ||
381 | 120 | return true; | ||
382 | 121 | } | ||
383 | 122 | |||
384 | 123 | bool MouseTouchAdaptor::handleMotionNotify(xcb_motion_notify_event_t *event) | ||
385 | 124 | { | ||
386 | 125 | if (!m_leftButtonIsPressed) { | ||
387 | 126 | return false; | ||
388 | 127 | } | ||
389 | 128 | |||
390 | 129 | QPoint windowPos(event->event_x, event->event_y); | ||
391 | 130 | |||
392 | 131 | QWindow *targetWindow = findQWindowWithXWindowID(static_cast<WId>(event->event)); | ||
393 | 132 | |||
394 | 133 | // no autoCommit | ||
395 | 134 | QTouchEventSequence touchEvent = QTest::touchEvent(targetWindow, m_touchDevice, false); | ||
396 | 135 | touchEvent.move(0, windowPos); | ||
397 | 136 | // do not process events when committed, let the events be processed with next event loop | ||
398 | 137 | touchEvent.commit(false); | ||
399 | 138 | |||
400 | 139 | return true; | ||
401 | 140 | } | ||
402 | 141 | |||
403 | 142 | QWindow *MouseTouchAdaptor::findQWindowWithXWindowID(WId windowId) | ||
404 | 143 | { | ||
405 | 144 | QWindowList windowList = QGuiApplication::topLevelWindows(); | ||
406 | 145 | QWindow *foundWindow = 0; | ||
407 | 146 | |||
408 | 147 | int i = 0; | ||
409 | 148 | while (!foundWindow && i < windowList.count()) { | ||
410 | 149 | QWindow *window = windowList[i]; | ||
411 | 150 | if (window->winId() == windowId) { | ||
412 | 151 | foundWindow = window; | ||
413 | 152 | } else { | ||
414 | 153 | ++i; | ||
415 | 154 | } | ||
416 | 155 | } | ||
417 | 156 | |||
418 | 157 | Q_ASSERT(foundWindow); | ||
419 | 158 | return foundWindow; | ||
420 | 159 | } | ||
421 | 0 | 160 | ||
422 | === added file 'tests/launcher/MouseTouchAdaptor.h' | |||
423 | --- tests/launcher/MouseTouchAdaptor.h 1970-01-01 00:00:00 +0000 | |||
424 | +++ tests/launcher/MouseTouchAdaptor.h 2014-06-20 19:21:15 +0000 | |||
425 | @@ -0,0 +1,50 @@ | |||
426 | 1 | /* | ||
427 | 2 | * Copyright 2014 Canonical Ltd. | ||
428 | 3 | * | ||
429 | 4 | * This program is free software; you can redistribute it and/or modify | ||
430 | 5 | * it under the terms of the GNU Lesser General Public License as published by | ||
431 | 6 | * the Free Software Foundation; version 3. | ||
432 | 7 | * | ||
433 | 8 | * This program is distributed in the hope that it will be useful, | ||
434 | 9 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
435 | 10 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
436 | 11 | * GNU Lesser General Public License for more details. | ||
437 | 12 | * | ||
438 | 13 | * You should have received a copy of the GNU Lesser General Public License | ||
439 | 14 | * along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
440 | 15 | * | ||
441 | 16 | * Authored by: Daniel d'Andrada <daniel.dandrada@canonical.com> | ||
442 | 17 | * | ||
443 | 18 | */ | ||
444 | 19 | |||
445 | 20 | #ifndef MOUSE_TOUCH_ADAPTOR_H | ||
446 | 21 | #define MOUSE_TOUCH_ADAPTOR_H | ||
447 | 22 | |||
448 | 23 | #include <QtCore/QAbstractNativeEventFilter> | ||
449 | 24 | #include <QWindow> | ||
450 | 25 | #include <xcb/xcb.h> | ||
451 | 26 | |||
452 | 27 | class QMouseEvent; | ||
453 | 28 | class QTouchDevice; | ||
454 | 29 | |||
455 | 30 | // Transforms QMouseEvents into single-finger QTouchEvents. | ||
456 | 31 | class MouseTouchAdaptor : public QAbstractNativeEventFilter { | ||
457 | 32 | |||
458 | 33 | public: | ||
459 | 34 | MouseTouchAdaptor(); | ||
460 | 35 | |||
461 | 36 | // Filters mouse events and posts the equivalent QTouchEvents. | ||
462 | 37 | virtual bool nativeEventFilter(const QByteArray & eventType, void *message, long *result); | ||
463 | 38 | |||
464 | 39 | private: | ||
465 | 40 | |||
466 | 41 | bool handleButtonPress(xcb_button_press_event_t *pressEvent); | ||
467 | 42 | bool handleButtonRelease(xcb_button_release_event_t *releaseEvent); | ||
468 | 43 | bool handleMotionNotify(xcb_motion_notify_event_t *event); | ||
469 | 44 | QWindow *findQWindowWithXWindowID(WId windowId); | ||
470 | 45 | |||
471 | 46 | QTouchDevice *m_touchDevice; | ||
472 | 47 | bool m_leftButtonIsPressed; | ||
473 | 48 | }; | ||
474 | 49 | |||
475 | 50 | #endif // MOUSE_TOUCH_ADAPTOR_H | ||
476 | 0 | 51 | ||
477 | === modified file 'tests/launcher/launcher.cpp' | |||
478 | --- tests/launcher/launcher.cpp 2014-06-09 08:26:24 +0000 | |||
479 | +++ tests/launcher/launcher.cpp 2014-06-20 19:21:15 +0000 | |||
480 | @@ -30,16 +30,18 @@ | |||
481 | 30 | #include <QOpenGLContext> | 30 | #include <QOpenGLContext> |
482 | 31 | #include <QtGui/private/qopenglcontext_p.h> | 31 | #include <QtGui/private/qopenglcontext_p.h> |
483 | 32 | #include <QtQuick/private/qsgcontext_p.h> | 32 | #include <QtQuick/private/qsgcontext_p.h> |
484 | 33 | #include <QtCore/QCommandLineParser> | ||
485 | 34 | #include <QtCore/QCommandLineOption> | ||
486 | 35 | #include "MouseTouchAdaptor.h" | ||
487 | 36 | #include <QtGui/QTouchDevice> | ||
488 | 33 | 37 | ||
490 | 34 | int usage() | 38 | bool touchDevicePresent() |
491 | 35 | { | 39 | { |
499 | 36 | QString self(QGuiApplication::instance()->arguments().at(0)); | 40 | Q_FOREACH(const QTouchDevice *device, QTouchDevice::devices()) { |
500 | 37 | std::cout << "Usage\n " | 41 | if (device->type() == QTouchDevice::TouchScreen) |
501 | 38 | << qPrintable(self) | 42 | return true; |
502 | 39 | << " -testability -frameless -engine" | 43 | } |
503 | 40 | << " --desktop_file_path=DESKTOP_FILE" | 44 | return false; |
497 | 41 | << " -I MODULE_PATH FILENAME\n"; | ||
498 | 42 | return 1; | ||
504 | 43 | } | 45 | } |
505 | 44 | 46 | ||
506 | 45 | int main(int argc, const char *argv[]) | 47 | int main(int argc, const char *argv[]) |
507 | @@ -58,25 +60,40 @@ | |||
508 | 58 | #endif | 60 | #endif |
509 | 59 | QGuiApplication::setApplicationName("UITK Launcher"); | 61 | QGuiApplication::setApplicationName("UITK Launcher"); |
510 | 60 | QGuiApplication application(argc, (char**)argv); | 62 | QGuiApplication application(argc, (char**)argv); |
526 | 61 | QStringList args (application.arguments()); | 63 | |
527 | 62 | 64 | QCommandLineParser args; | |
528 | 63 | int _testability(args.indexOf("-testability")); | 65 | QCommandLineOption _import("I", "Add <path> to the list of import paths", "path"); |
529 | 64 | args.removeAt(_testability); | 66 | QCommandLineOption _enableTouch("touch", "Enables mouse to touch conversion on desktop"); |
530 | 65 | int _frameless(args.indexOf("-frameless")); | 67 | QCommandLineOption _testability("testability", "Loads the testability driver"); |
531 | 66 | args.removeAt(_frameless); | 68 | QCommandLineOption _frameless("frameless", "Run without borders"); |
532 | 67 | int _engine(args.indexOf("-engine")); | 69 | QCommandLineOption _engine("engine", "Use quick engine from quick view"); |
533 | 68 | args.removeAt(_engine); | 70 | QCommandLineOption _desktop_file_hint("desktop_file_hint", "Desktop file - ignored", "desktop_file"); |
534 | 69 | 71 | ||
535 | 70 | Q_FOREACH(QString arg, args) { | 72 | args.addOption(_import); |
536 | 71 | if (arg.startsWith("--desktop_file_hint")) { | 73 | args.addOption(_enableTouch); |
537 | 72 | // This will not be used - it only needs to be ignored | 74 | args.addOption(_testability); |
538 | 73 | int _desktop_file_hint(args.indexOf(arg)); | 75 | args.addOption(_frameless); |
539 | 74 | args.removeAt(_desktop_file_hint); | 76 | args.addOption(_engine); |
540 | 75 | } | 77 | args.addOption(_desktop_file_hint); |
541 | 78 | args.addPositionalArgument("filename", "Document to be viewed"); | ||
542 | 79 | args.setSingleDashWordOptionMode(QCommandLineParser::ParseAsLongOptions); | ||
543 | 80 | args.addHelpOption(); | ||
544 | 81 | if (!args.parse(application.arguments())) { | ||
545 | 82 | qWarning() << args.errorText(); | ||
546 | 83 | args.showHelp(1); | ||
547 | 84 | } | ||
548 | 85 | |||
549 | 86 | QString filename; | ||
550 | 87 | if (args.positionalArguments().count() > 0) { | ||
551 | 88 | filename = args.positionalArguments()[0]; | ||
552 | 89 | } | ||
553 | 90 | if (filename.isEmpty()) { | ||
554 | 91 | // show usage and exit | ||
555 | 92 | args.showHelp(1); | ||
556 | 76 | } | 93 | } |
557 | 77 | 94 | ||
558 | 78 | // Testability is only supported out of the box by QApplication not QGuiApplication | 95 | // Testability is only supported out of the box by QApplication not QGuiApplication |
560 | 79 | if (_testability > -1 || getenv("QT_LOAD_TESTABILITY")) { | 96 | if (args.isSet(_testability) || getenv("QT_LOAD_TESTABILITY")) { |
561 | 80 | QLibrary testLib(QLatin1String("qttestability")); | 97 | QLibrary testLib(QLatin1String("qttestability")); |
562 | 81 | if (testLib.load()) { | 98 | if (testLib.load()) { |
563 | 82 | typedef void (*TasInitialize)(void); | 99 | typedef void (*TasInitialize)(void); |
564 | @@ -96,7 +113,7 @@ | |||
565 | 96 | QQmlEngine* engine; | 113 | QQmlEngine* engine; |
566 | 97 | // The default constructor affects the components tree (autopilot vis) | 114 | // The default constructor affects the components tree (autopilot vis) |
567 | 98 | QQuickView* view; | 115 | QQuickView* view; |
569 | 99 | if (_engine > -1) { | 116 | if (args.isSet(_engine)) { |
570 | 100 | view = new QQuickView(); | 117 | view = new QQuickView(); |
571 | 101 | engine = view->engine(); | 118 | engine = view->engine(); |
572 | 102 | } else { | 119 | } else { |
573 | @@ -104,43 +121,31 @@ | |||
574 | 104 | view = new QQuickView(engine, NULL); | 121 | view = new QQuickView(engine, NULL); |
575 | 105 | } | 122 | } |
576 | 106 | 123 | ||
584 | 107 | int _import(args.indexOf("-I")); | 124 | if (args.isSet(_import)) { |
585 | 108 | args.removeAt(_import); | 125 | QStringList paths = args.values(_import); |
586 | 109 | if (_import > -1) { | 126 | Q_FOREACH(const QString &path, paths) { |
587 | 110 | if (args.count() > _import) { | 127 | engine->addImportPath(path); |
581 | 111 | QString importPath(args.at(_import)); | ||
582 | 112 | args.removeAt(_import); | ||
583 | 113 | engine->addImportPath(importPath); | ||
588 | 114 | } | 128 | } |
589 | 115 | } | 129 | } |
590 | 116 | 130 | ||
591 | 117 | view->setResizeMode(QQuickView::SizeRootObjectToView); | 131 | view->setResizeMode(QQuickView::SizeRootObjectToView); |
592 | 118 | view->setTitle("UI Toolkit QQuickView"); | 132 | view->setTitle("UI Toolkit QQuickView"); |
594 | 119 | if (_frameless > -1) { | 133 | if (args.isSet(_frameless)) { |
595 | 120 | view->setFlags(Qt::FramelessWindowHint); | 134 | view->setFlags(Qt::FramelessWindowHint); |
596 | 121 | } | 135 | } |
597 | 122 | 136 | ||
602 | 123 | // The remaining unnamed argument must be a filename | 137 | if (args.isSet(_enableTouch) && !touchDevicePresent()) { |
603 | 124 | if (args.count() == 1) { | 138 | // has no effect if we have touch screen |
604 | 125 | qCritical() << "Missing filename"; | 139 | application.installNativeEventFilter(new MouseTouchAdaptor); |
601 | 126 | return usage(); | ||
605 | 127 | } | 140 | } |
606 | 128 | QString filename(args.at(1)); | ||
607 | 129 | // The first argument is the launcher itself | ||
608 | 130 | args.removeAt(0); | ||
609 | 131 | 141 | ||
610 | 132 | QUrl source(QUrl::fromLocalFile(filename)); | 142 | QUrl source(QUrl::fromLocalFile(filename)); |
611 | 133 | view->setSource(source); | 143 | view->setSource(source); |
612 | 134 | if (view->errors().count() > 0) { | 144 | if (view->errors().count() > 0) { |
614 | 135 | return usage(); | 145 | args.showHelp(3); |
615 | 136 | } | 146 | } |
616 | 137 | view->show(); | 147 | view->show(); |
617 | 138 | 148 | ||
618 | 139 | if (args.count() > 1) { | ||
619 | 140 | qCritical() << "Invalid arguments passed" << args; | ||
620 | 141 | return usage(); | ||
621 | 142 | } | ||
622 | 143 | |||
623 | 144 | return application.exec(); | 149 | return application.exec(); |
624 | 145 | } | 150 | } |
625 | 146 | 151 | ||
626 | 147 | 152 | ||
627 | === modified file 'tests/launcher/launcher.pro' | |||
628 | --- tests/launcher/launcher.pro 2014-05-14 11:00:20 +0000 | |||
629 | +++ tests/launcher/launcher.pro 2014-06-20 19:21:15 +0000 | |||
630 | @@ -1,11 +1,13 @@ | |||
631 | 1 | TEMPLATE = app | 1 | TEMPLATE = app |
632 | 2 | QT += qml quick | 2 | QT += qml quick |
633 | 3 | # For setSharedOpenGLContext | 3 | # For setSharedOpenGLContext |
635 | 4 | QT += core-private gui-private quick-private | 4 | QT += core-private gui-private testlib quick-private |
636 | 5 | CONFIG += no_keywords | 5 | CONFIG += no_keywords |
640 | 6 | SOURCES += \ | 6 | HEADERS += MouseTouchAdaptor.h |
641 | 7 | launcher.cpp | 7 | SOURCES += launcher.cpp \ |
642 | 8 | launcher.path = /usr/lib/ubuntu-ui-toolkit | 8 | MouseTouchAdaptor.cpp |
643 | 9 | installPath = $$[QT_INSTALL_LIBS]/ubuntu-ui-toolkit | ||
644 | 10 | launcher.path = $$installPath | ||
645 | 9 | launcher.files = launcher | 11 | launcher.files = launcher |
646 | 10 | INSTALLS += launcher | 12 | INSTALLS += launcher |
647 | 11 | 13 | ||
648 | 12 | 14 | ||
649 | === modified file 'tests/unit/tst_components/tst_label.qml' | |||
650 | --- tests/unit/tst_components/tst_label.qml 2014-05-26 10:13:41 +0000 | |||
651 | +++ tests/unit/tst_components/tst_label.qml 2014-06-20 19:21:15 +0000 | |||
652 | @@ -21,6 +21,11 @@ | |||
653 | 21 | TestCase { | 21 | TestCase { |
654 | 22 | name: "LabelAPI" | 22 | name: "LabelAPI" |
655 | 23 | 23 | ||
656 | 24 | function test_0_defaults() { | ||
657 | 25 | compare(textCustom.font.family, "Ubuntu", "Default font family"); | ||
658 | 26 | compare(textCustom.font.weight, Font.Light, "Default font weight"); | ||
659 | 27 | } | ||
660 | 28 | |||
661 | 24 | function test_fontSize() { | 29 | function test_fontSize() { |
662 | 25 | compare(textCustom.fontSize,"medium","fontSize is 'medium' by default") | 30 | compare(textCustom.fontSize,"medium","fontSize is 'medium' by default") |
663 | 26 | 31 |
FAILED: Continuous integration, rev:1114 jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- ci/2094/ jenkins. qa.ubuntu. com/job/ generic- deb-autopilot- utopic- touch/1055/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- utopic/ 951/console jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- utopic- amd64-ci/ 40/console jenkins. qa.ubuntu. com/job/ ubuntu- ui-toolkit- utopic- armhf-ci/ 40/console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- armhf/1854/ console jenkins. qa.ubuntu. com/job/ generic- mediumtests- builder- utopic- amd64/1094/ console
http://
Executed test runs:
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
FAILURE: http://
Click here to trigger a rebuild: s-jenkins. ubuntu- ci:8080/ job/ubuntu- ui-toolkit- ci/2094/ rebuild
http://