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
=== modified file 'src/Ubuntu/Components/1.3/AppHeader.qml'
--- src/Ubuntu/Components/1.3/AppHeader.qml 2016-01-06 11:24:54 +0000
+++ src/Ubuntu/Components/1.3/AppHeader.qml 2016-02-04 14:11:25 +0000
@@ -15,7 +15,7 @@
15 */15 */
1616
17import QtQuick 2.417import QtQuick 2.4
18import Ubuntu.Components 1.3 as Components18import Ubuntu.Components.Private 1.3 as Privates
1919
20/*!20/*!
21 \internal21 \internal
@@ -23,7 +23,8 @@
23 \inqmlmodule Ubuntu.Components 1.123 \inqmlmodule Ubuntu.Components 1.1
24 \ingroup ubuntu24 \ingroup ubuntu
25*/25*/
26Components.Header {26Privates.AppHeaderBase {
27 // Note: styleName is set to "PageHeadStyle" in UCAppHeaderBase.
27 id: header28 id: header
2829
29 anchors {30 anchors {
@@ -117,7 +118,12 @@
117 */118 */
118 property QtObject config: null119 property QtObject config: null
119120
120 Component.onCompleted: internal.updateProperties()121 animate: false
122 exposed: false
123 Component.onCompleted: {
124 internal.updateProperties();
125 header.animate = true;
126 }
121 onConfigChanged: internal.updateProperties()127 onConfigChanged: internal.updateProperties()
122128
123 onExposedChanged: {129 onExposedChanged: {
@@ -163,6 +169,4 @@
163 }169 }
164 }170 }
165 }171 }
166
167 styleName: "PageHeadStyle"
168}172}
169173
=== modified file 'src/Ubuntu/Components/plugin/plugin.cpp'
--- src/Ubuntu/Components/plugin/plugin.cpp 2016-02-02 17:06:54 +0000
+++ src/Ubuntu/Components/plugin/plugin.cpp 2016-02-04 14:11:25 +0000
@@ -79,6 +79,7 @@
79#include "ucmainviewbase.h"79#include "ucmainviewbase.h"
80#include "ucperformancemonitor.h"80#include "ucperformancemonitor.h"
81#include "privates/frame.h"81#include "privates/frame.h"
82#include "privates/appheaderbase.h"
8283
83// From UbuntuGestures84// From UbuntuGestures
84#include "private/ucswipearea_p.h"85#include "private/ucswipearea_p.h"
@@ -331,7 +332,9 @@
331 qmlRegisterType<UCBottomEdgeStyle>(styleUri, 1, 3, "BottomEdgeStyle");332 qmlRegisterType<UCBottomEdgeStyle>(styleUri, 1, 3, "BottomEdgeStyle");
332333
333 // Register private types.334 // Register private types.
334 qmlRegisterType<UCFrame>("Ubuntu.Components.Private", 1, 3, "Frame");335 const char *privateUri = "Ubuntu.Components.Private";
336 qmlRegisterType<UCFrame>(privateUri, 1, 3, "Frame");
337 qmlRegisterType<UCAppHeaderBase>(privateUri, 1, 3, "AppHeaderBase");
335338
336 QQmlExtensionPlugin::initializeEngine(engine, uri);339 QQmlExtensionPlugin::initializeEngine(engine, uri);
337340
338341
=== modified file 'src/Ubuntu/Components/plugin/plugin.pri'
--- src/Ubuntu/Components/plugin/plugin.pri 2016-01-22 13:13:28 +0000
+++ src/Ubuntu/Components/plugin/plugin.pri 2016-02-04 14:11:25 +0000
@@ -109,7 +109,8 @@
109 $$PWD/ucmainviewbase.h \109 $$PWD/ucmainviewbase.h \
110 $$PWD/ucmainviewbase_p.h \110 $$PWD/ucmainviewbase_p.h \
111 $$PWD/ucperformancemonitor.h \111 $$PWD/ucperformancemonitor.h \
112 $$PWD/privates/frame.h112 $$PWD/privates/frame.h \
113 $$PWD/privates/appheaderbase.h
113114
114SOURCES += $$PWD/plugin.cpp \115SOURCES += $$PWD/plugin.cpp \
115 $$PWD/uctheme.cpp \116 $$PWD/uctheme.cpp \
@@ -182,7 +183,8 @@
182 $$PWD/ucpagetreenode.cpp \183 $$PWD/ucpagetreenode.cpp \
183 $$PWD/ucmainviewbase.cpp \184 $$PWD/ucmainviewbase.cpp \
184 $$PWD/ucperformancemonitor.cpp \185 $$PWD/ucperformancemonitor.cpp \
185 $$PWD/privates/frame.cpp186 $$PWD/privates/frame.cpp \
187 $$PWD/privates/appheaderbase.cpp
186188
187# adapters189# adapters
188SOURCES += $$PWD/adapters/alarmsadapter_organizer.cpp190SOURCES += $$PWD/adapters/alarmsadapter_organizer.cpp
189191
=== added file 'src/Ubuntu/Components/plugin/privates/appheaderbase.cpp'
--- src/Ubuntu/Components/plugin/privates/appheaderbase.cpp 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/privates/appheaderbase.cpp 2016-02-04 14:11:25 +0000
@@ -0,0 +1,69 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#include "appheaderbase.h"
18#include "ucstyleditembase_p.h"
19
20/*!
21 \qmltype AppHeaderBase
22 \instantiates UCAppHeaderBase
23 \inherits UCHeader
24 \internal
25 \inqmlmodule Ubuntu.Components.Private 1.3
26 \ingroup ubuntu
27 \since Ubuntu.Components.Private 1.3
28 \brief Private parent of AppHeader, to disable animations until pages are
29 loaded and initial visibility of the header is set.
30*/
31UCAppHeaderBase::UCAppHeaderBase(QQuickItem *parent)
32 : UCHeader(parent)
33 , m_animate(true)
34{
35 connect(this, &UCHeader::themeChanged, this, &UCAppHeaderBase::themeChanged2);
36 UCStyledItemBasePrivate::get(this)->styleDocument = "PageHeadStyle";
37}
38
39UCTheme* UCAppHeaderBase::theme2()
40{
41 return getTheme();
42}
43
44void UCAppHeaderBase::setTheme2(UCTheme* value)
45{
46 setTheme(value);
47}
48
49void UCAppHeaderBase::show(bool animate) {
50 UCHeader::show(m_animate && animate);
51}
52
53void UCAppHeaderBase::hide(bool animate) {
54 UCHeader::hide(m_animate && animate);
55}
56
57/*!
58 * \qmlproperty bool AppHeaderBase::animate
59 * Animate the y-value when the value of \l Header::exposed is set or unset.
60 * If the header is already animating while the value is set to false,
61 * the current animation is not cancelled.
62 * Default value: true.
63 */
64void UCAppHeaderBase::setAnimate(bool animate) {
65 if (animate != m_animate) {
66 m_animate = animate;
67 Q_EMIT animateChanged();
68 }
69}
070
=== added file 'src/Ubuntu/Components/plugin/privates/appheaderbase.h'
--- src/Ubuntu/Components/plugin/privates/appheaderbase.h 1970-01-01 00:00:00 +0000
+++ src/Ubuntu/Components/plugin/privates/appheaderbase.h 2016-02-04 14:11:25 +0000
@@ -0,0 +1,54 @@
1/*
2 * Copyright 2016 Canonical Ltd.
3 *
4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by
6 * the Free Software Foundation; version 3.
7 *
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU Lesser General Public License for more details.
12 *
13 * You should have received a copy of the GNU Lesser General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
15 */
16
17#ifndef APPHEADERBASE_H
18#define APPHEADERBASE_H
19
20#include "ucheader.h"
21class UCTheme;
22
23class UCAppHeaderBase : public UCHeader
24{
25 Q_OBJECT
26 Q_PROPERTY(bool animate MEMBER m_animate WRITE setAnimate NOTIFY animateChanged FINAL)
27
28 // FIXME Re-expose properties that would be inaccessible due to a QML bug
29 // https://bugs.launchpad.net/ubuntu/+source/qtdeclarative-opensource-src/+bug/1389721
30 Q_PROPERTY(UCTheme *theme
31 READ theme2
32 WRITE setTheme2
33 NOTIFY themeChanged2 FINAL)
34
35public:
36 explicit UCAppHeaderBase(QQuickItem *parent = 0);
37 void setAnimate(bool animate);
38
39 UCTheme* theme2();
40 void setTheme2(UCTheme* value);
41
42Q_SIGNALS:
43 void animateChanged();
44 void themeChanged2();
45
46protected:
47 virtual void show(bool animate);
48 virtual void hide(bool animate);
49
50private:
51 bool m_animate:1;
52};
53
54#endif // APPHEADERBASE_H
055
=== modified file 'src/Ubuntu/Components/plugin/ucheader.cpp'
--- src/Ubuntu/Components/plugin/ucheader.cpp 2015-11-18 14:38:16 +0000
+++ src/Ubuntu/Components/plugin/ucheader.cpp 2016-02-04 14:11:25 +0000
@@ -1,5 +1,5 @@
1/*1/*
2 * Copyright 2015 Canonical Ltd.2 * Copyright 2016 Canonical Ltd.
3 *3 *
4 * This program is free software; you can redistribute it and/or modify4 * This program is free software; you can redistribute it and/or modify
5 * it under the terms of the GNU Lesser General Public License as published by5 * it under the terms of the GNU Lesser General Public License as published by
@@ -281,9 +281,9 @@
281 */281 */
282void UCHeader::setExposed(bool exposed) {282void UCHeader::setExposed(bool exposed) {
283 if (exposed) {283 if (exposed) {
284 show();284 show(true);
285 } else {285 } else {
286 hide();286 hide(true);
287 }287 }
288}288}
289289
@@ -328,9 +328,9 @@
328 Q_ASSERT(!m_flickable.isNull());328 Q_ASSERT(!m_flickable.isNull());
329 if ((m_flickable->contentY() < 0)329 if ((m_flickable->contentY() < 0)
330 || (y() > -height()/2.0)) {330 || (y() > -height()/2.0)) {
331 show();331 show(true);
332 } else {332 } else {
333 hide();333 hide(true);
334 }334 }
335}335}
336336
@@ -339,7 +339,7 @@
339 if (m_flickable->height() >= m_flickable->contentHeight()) {339 if (m_flickable->height() >= m_flickable->contentHeight()) {
340 // The user cannot scroll down to expose the header, so ensure340 // The user cannot scroll down to expose the header, so ensure
341 // that it is visible.341 // that it is visible.
342 show();342 show(true);
343 }343 }
344}344}
345345
@@ -348,6 +348,6 @@
348 if (!m_flickable->isInteractive()) {348 if (!m_flickable->isInteractive()) {
349 // The user cannot scroll down to expose the header, so ensure349 // The user cannot scroll down to expose the header, so ensure
350 // that it is visible.350 // that it is visible.
351 show();351 show(true);
352 }352 }
353}353}
354354
=== modified file 'src/Ubuntu/Components/plugin/ucheader.h'
--- src/Ubuntu/Components/plugin/ucheader.h 2015-10-01 12:54:32 +0000
+++ src/Ubuntu/Components/plugin/ucheader.h 2016-02-04 14:11:25 +0000
@@ -47,8 +47,8 @@
47 void movingChanged();47 void movingChanged();
4848
49protected:49protected:
50 void show(bool animate = true);50 virtual void show(bool animate);
51 void hide(bool animate = true);51 virtual void hide(bool animate);
5252
53private Q_SLOTS:53private Q_SLOTS:
54 void _q_scrolledContents();54 void _q_scrolledContents();

Subscribers

People subscribed via source and target branches