Merge lp:~tpeeters/ubuntu-ui-toolkit/headerAnimate into lp:ubuntu-ui-toolkit/staging

Proposed by Tim Peeters
Status: Merged
Approved by: Cris Dywan
Approved revision: 1846
Merged at revision: 1837
Proposed branch: lp:~tpeeters/ubuntu-ui-toolkit/headerAnimate
Merge into: lp:ubuntu-ui-toolkit/staging
Diff against target: 290 lines (+149/-17)
7 files modified
src/Ubuntu/Components/1.3/AppHeader.qml (+9/-5)
src/Ubuntu/Components/plugin/plugin.cpp (+4/-1)
src/Ubuntu/Components/plugin/plugin.pri (+4/-2)
src/Ubuntu/Components/plugin/privates/appheaderbase.cpp (+69/-0)
src/Ubuntu/Components/plugin/privates/appheaderbase.h (+54/-0)
src/Ubuntu/Components/plugin/ucheader.cpp (+7/-7)
src/Ubuntu/Components/plugin/ucheader.h (+2/-2)
To merge this branch: bzr merge lp:~tpeeters/ubuntu-ui-toolkit/headerAnimate
Reviewer Review Type Date Requested Status
ubuntu-sdk-build-bot continuous-integration Approve
Cris Dywan Approve
Review via email: mp+284264@code.launchpad.net

Commit message

Add 'animate' property to new internal AppHeaderBase, and do not show a header animation when starting an app without header.

To post a comment you must log in.
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :

To test the results of this MR:

mkdir fix1518002 && cd fix1518002 && wget https://jenkins.ubuntu.com/ubuntu-sdk/job/ubuntu-ui-toolkit-ci-armhf-singlenode/203/artifact/debs/artifacts/copy-to-phone-headerAnimate-1832.tar && tar -xf copy-to-phone-headerAnimate-1832.tar && sudo dpkg -i *.deb

and then re-run the apps to test them manually.

Revision history for this message
Tim Peeters (tpeeters) wrote :

After a discussion with Zsombor and Christian, I checked whether QQuickItem.componentComplete() is called before or after the Item's Component.onCompleted. Unfortunately, it is after so I cannot use that:

UCHeader.componentComplete()
qml: AppHeader.Component.onCompleted() start.
qml: AppHeader.Component.onCompleted() done.

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
Cris Dywan (kalikiana) wrote :

Looks sensible.

J seems to have failed due to an error in the build script.

review: Approve
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Needs Fixing (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :

FAILED: Autolanding.
More details in the following jenkins job:
https://jenkins.ubuntu.com/ubuntu-sdk/job/ubuntu-ui-toolkit-autolanding/123/
Executed test runs:
    None: https://jenkins.ubuntu.com/ubuntu-sdk/job/generic-land-mp/125/console

review: Needs Fixing (continuous-integration)
Revision history for this message
Tim Peeters (tpeeters) wrote :
Download full text (3.7 KiB)

InverseMouseArea breaks on xenial?

tst_inversemousearea: Started with PID: 12219
tst_inversemousearea: ********* Start testing of tst_InverseMouseAreaTest *********
tst_inversemousearea: Config: Using QtTest library 5.4.1, Qt 5.4.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.9.2)
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::initTestCase()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_Defaults()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_DoNotPropagateEvents()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_PropagateEvents()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_sensingAreaError()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreInWindow()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_OverlappedMouseArea()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreaOnTop()
tst_inversemousearea: QWARN : tst_InverseMouseAreaTest::testCase_InverseMouseAreaOnTopNoAccept() file:///tmp/buildd/ubuntu-ui-toolkit-1.3.1795+16.04.20160106/tests/unit_x11/tst_inversemousearea/InverseMouseAreaOnTopNoAccept.qml:53:9: QML Button: Theme.createStyleComponent() is deprecated. Use ThemeSettings instead.
tst_inversemousearea: QWARN : tst_InverseMouseAreaTest::testCase_InverseMouseAreaOnTopNoAccept() file:///tmp/buildd/ubuntu-ui-toolkit-1.3.1795+16.04.20160106/tests/unit_x11/tst_inversemousearea/InverseMouseAreaOnTopNoAccept.qml:53:9: QML Button: Mixing of Ubuntu.Components module versions 1.2 and 1.3 detected!
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreaOnTopNoAccept()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreaOnTopTopmost()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreaSignals()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreaNormalEventStack()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreaTopmost()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreaSensingArea()
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::testCase_InverseMouseAreaSensingAreaChange()
tst_inversemousearea: QDEBUG : tst_InverseMouseAreaTest::test_MouseClicksOnHeaderNotSeen_bug1288876(InverseMouseArea in a Page) qml: Page.tools is a deprecated property. Please use Page.head instead.
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::test_MouseClicksOnHeaderNotSeen_bug1288876(InverseMouseArea in a Page)
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::test_MouseClicksOnHeaderNotSeen_bug1288876(InverseMouseArea with clip)
tst_inversemousearea: QDEBUG : tst_InverseMouseAreaTest::test_MouseClicksOnHeaderNotSeen_bug1288876(InverseMouseArea parent clipped) qml: Page.tools is a deprecated property. Please use Page.head instead.
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::test_MouseClicksOnHeaderNotSeen_bug1288876(InverseMouseArea parent clipped)
tst_inversemousearea: PASS : tst_InverseMouseAreaTest::test_MouseClicksOnHeaderNotSeen_bug1288876(InverseMouseAr...

Read more...

Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) wrote :
review: Approve (continuous-integration)
Revision history for this message
ubuntu-sdk-build-bot (ubuntu-sdk-build-bot) 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 'src/Ubuntu/Components/1.3/AppHeader.qml'
2--- src/Ubuntu/Components/1.3/AppHeader.qml 2016-01-06 11:24:54 +0000
3+++ src/Ubuntu/Components/1.3/AppHeader.qml 2016-02-04 14:11:25 +0000
4@@ -15,7 +15,7 @@
5 */
6
7 import QtQuick 2.4
8-import Ubuntu.Components 1.3 as Components
9+import Ubuntu.Components.Private 1.3 as Privates
10
11 /*!
12 \internal
13@@ -23,7 +23,8 @@
14 \inqmlmodule Ubuntu.Components 1.1
15 \ingroup ubuntu
16 */
17-Components.Header {
18+Privates.AppHeaderBase {
19+ // Note: styleName is set to "PageHeadStyle" in UCAppHeaderBase.
20 id: header
21
22 anchors {
23@@ -117,7 +118,12 @@
24 */
25 property QtObject config: null
26
27- Component.onCompleted: internal.updateProperties()
28+ animate: false
29+ exposed: false
30+ Component.onCompleted: {
31+ internal.updateProperties();
32+ header.animate = true;
33+ }
34 onConfigChanged: internal.updateProperties()
35
36 onExposedChanged: {
37@@ -163,6 +169,4 @@
38 }
39 }
40 }
41-
42- styleName: "PageHeadStyle"
43 }
44
45=== modified file 'src/Ubuntu/Components/plugin/plugin.cpp'
46--- src/Ubuntu/Components/plugin/plugin.cpp 2016-02-02 17:06:54 +0000
47+++ src/Ubuntu/Components/plugin/plugin.cpp 2016-02-04 14:11:25 +0000
48@@ -79,6 +79,7 @@
49 #include "ucmainviewbase.h"
50 #include "ucperformancemonitor.h"
51 #include "privates/frame.h"
52+#include "privates/appheaderbase.h"
53
54 // From UbuntuGestures
55 #include "private/ucswipearea_p.h"
56@@ -331,7 +332,9 @@
57 qmlRegisterType<UCBottomEdgeStyle>(styleUri, 1, 3, "BottomEdgeStyle");
58
59 // Register private types.
60- qmlRegisterType<UCFrame>("Ubuntu.Components.Private", 1, 3, "Frame");
61+ const char *privateUri = "Ubuntu.Components.Private";
62+ qmlRegisterType<UCFrame>(privateUri, 1, 3, "Frame");
63+ qmlRegisterType<UCAppHeaderBase>(privateUri, 1, 3, "AppHeaderBase");
64
65 QQmlExtensionPlugin::initializeEngine(engine, uri);
66
67
68=== modified file 'src/Ubuntu/Components/plugin/plugin.pri'
69--- src/Ubuntu/Components/plugin/plugin.pri 2016-01-22 13:13:28 +0000
70+++ src/Ubuntu/Components/plugin/plugin.pri 2016-02-04 14:11:25 +0000
71@@ -109,7 +109,8 @@
72 $$PWD/ucmainviewbase.h \
73 $$PWD/ucmainviewbase_p.h \
74 $$PWD/ucperformancemonitor.h \
75- $$PWD/privates/frame.h
76+ $$PWD/privates/frame.h \
77+ $$PWD/privates/appheaderbase.h
78
79 SOURCES += $$PWD/plugin.cpp \
80 $$PWD/uctheme.cpp \
81@@ -182,7 +183,8 @@
82 $$PWD/ucpagetreenode.cpp \
83 $$PWD/ucmainviewbase.cpp \
84 $$PWD/ucperformancemonitor.cpp \
85- $$PWD/privates/frame.cpp
86+ $$PWD/privates/frame.cpp \
87+ $$PWD/privates/appheaderbase.cpp
88
89 # adapters
90 SOURCES += $$PWD/adapters/alarmsadapter_organizer.cpp
91
92=== added file 'src/Ubuntu/Components/plugin/privates/appheaderbase.cpp'
93--- src/Ubuntu/Components/plugin/privates/appheaderbase.cpp 1970-01-01 00:00:00 +0000
94+++ src/Ubuntu/Components/plugin/privates/appheaderbase.cpp 2016-02-04 14:11:25 +0000
95@@ -0,0 +1,69 @@
96+/*
97+ * Copyright 2016 Canonical Ltd.
98+ *
99+ * This program is free software; you can redistribute it and/or modify
100+ * it under the terms of the GNU Lesser General Public License as published by
101+ * the Free Software Foundation; version 3.
102+ *
103+ * This program is distributed in the hope that it will be useful,
104+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
105+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
106+ * GNU Lesser General Public License for more details.
107+ *
108+ * You should have received a copy of the GNU Lesser General Public License
109+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
110+ */
111+
112+#include "appheaderbase.h"
113+#include "ucstyleditembase_p.h"
114+
115+/*!
116+ \qmltype AppHeaderBase
117+ \instantiates UCAppHeaderBase
118+ \inherits UCHeader
119+ \internal
120+ \inqmlmodule Ubuntu.Components.Private 1.3
121+ \ingroup ubuntu
122+ \since Ubuntu.Components.Private 1.3
123+ \brief Private parent of AppHeader, to disable animations until pages are
124+ loaded and initial visibility of the header is set.
125+*/
126+UCAppHeaderBase::UCAppHeaderBase(QQuickItem *parent)
127+ : UCHeader(parent)
128+ , m_animate(true)
129+{
130+ connect(this, &UCHeader::themeChanged, this, &UCAppHeaderBase::themeChanged2);
131+ UCStyledItemBasePrivate::get(this)->styleDocument = "PageHeadStyle";
132+}
133+
134+UCTheme* UCAppHeaderBase::theme2()
135+{
136+ return getTheme();
137+}
138+
139+void UCAppHeaderBase::setTheme2(UCTheme* value)
140+{
141+ setTheme(value);
142+}
143+
144+void UCAppHeaderBase::show(bool animate) {
145+ UCHeader::show(m_animate && animate);
146+}
147+
148+void UCAppHeaderBase::hide(bool animate) {
149+ UCHeader::hide(m_animate && animate);
150+}
151+
152+/*!
153+ * \qmlproperty bool AppHeaderBase::animate
154+ * Animate the y-value when the value of \l Header::exposed is set or unset.
155+ * If the header is already animating while the value is set to false,
156+ * the current animation is not cancelled.
157+ * Default value: true.
158+ */
159+void UCAppHeaderBase::setAnimate(bool animate) {
160+ if (animate != m_animate) {
161+ m_animate = animate;
162+ Q_EMIT animateChanged();
163+ }
164+}
165
166=== added file 'src/Ubuntu/Components/plugin/privates/appheaderbase.h'
167--- src/Ubuntu/Components/plugin/privates/appheaderbase.h 1970-01-01 00:00:00 +0000
168+++ src/Ubuntu/Components/plugin/privates/appheaderbase.h 2016-02-04 14:11:25 +0000
169@@ -0,0 +1,54 @@
170+/*
171+ * Copyright 2016 Canonical Ltd.
172+ *
173+ * This program is free software; you can redistribute it and/or modify
174+ * it under the terms of the GNU Lesser General Public License as published by
175+ * the Free Software Foundation; version 3.
176+ *
177+ * This program is distributed in the hope that it will be useful,
178+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
179+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
180+ * GNU Lesser General Public License for more details.
181+ *
182+ * You should have received a copy of the GNU Lesser General Public License
183+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
184+ */
185+
186+#ifndef APPHEADERBASE_H
187+#define APPHEADERBASE_H
188+
189+#include "ucheader.h"
190+class UCTheme;
191+
192+class UCAppHeaderBase : public UCHeader
193+{
194+ Q_OBJECT
195+ Q_PROPERTY(bool animate MEMBER m_animate WRITE setAnimate NOTIFY animateChanged FINAL)
196+
197+ // FIXME Re-expose properties that would be inaccessible due to a QML bug
198+ // https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1389721
199+ Q_PROPERTY(UCTheme *theme
200+ READ theme2
201+ WRITE setTheme2
202+ NOTIFY themeChanged2 FINAL)
203+
204+public:
205+ explicit UCAppHeaderBase(QQuickItem *parent = 0);
206+ void setAnimate(bool animate);
207+
208+ UCTheme* theme2();
209+ void setTheme2(UCTheme* value);
210+
211+Q_SIGNALS:
212+ void animateChanged();
213+ void themeChanged2();
214+
215+protected:
216+ virtual void show(bool animate);
217+ virtual void hide(bool animate);
218+
219+private:
220+ bool m_animate:1;
221+};
222+
223+#endif // APPHEADERBASE_H
224
225=== modified file 'src/Ubuntu/Components/plugin/ucheader.cpp'
226--- src/Ubuntu/Components/plugin/ucheader.cpp 2015-11-18 14:38:16 +0000
227+++ src/Ubuntu/Components/plugin/ucheader.cpp 2016-02-04 14:11:25 +0000
228@@ -1,5 +1,5 @@
229 /*
230- * Copyright 2015 Canonical Ltd.
231+ * Copyright 2016 Canonical Ltd.
232 *
233 * This program is free software; you can redistribute it and/or modify
234 * it under the terms of the GNU Lesser General Public License as published by
235@@ -281,9 +281,9 @@
236 */
237 void UCHeader::setExposed(bool exposed) {
238 if (exposed) {
239- show();
240+ show(true);
241 } else {
242- hide();
243+ hide(true);
244 }
245 }
246
247@@ -328,9 +328,9 @@
248 Q_ASSERT(!m_flickable.isNull());
249 if ((m_flickable->contentY() < 0)
250 || (y() > -height()/2.0)) {
251- show();
252+ show(true);
253 } else {
254- hide();
255+ hide(true);
256 }
257 }
258
259@@ -339,7 +339,7 @@
260 if (m_flickable->height() >= m_flickable->contentHeight()) {
261 // The user cannot scroll down to expose the header, so ensure
262 // that it is visible.
263- show();
264+ show(true);
265 }
266 }
267
268@@ -348,6 +348,6 @@
269 if (!m_flickable->isInteractive()) {
270 // The user cannot scroll down to expose the header, so ensure
271 // that it is visible.
272- show();
273+ show(true);
274 }
275 }
276
277=== modified file 'src/Ubuntu/Components/plugin/ucheader.h'
278--- src/Ubuntu/Components/plugin/ucheader.h 2015-10-01 12:54:32 +0000
279+++ src/Ubuntu/Components/plugin/ucheader.h 2016-02-04 14:11:25 +0000
280@@ -47,8 +47,8 @@
281 void movingChanged();
282
283 protected:
284- void show(bool animate = true);
285- void hide(bool animate = true);
286+ virtual void show(bool animate);
287+ virtual void hide(bool animate);
288
289 private Q_SLOTS:
290 void _q_scrolledContents();

Subscribers

People subscribed via source and target branches