[ Albert Astals Cid ]
* Add an Item that proxies for old and new audio roles (LP: #1493851)
* CroppedImageMinimumSourceSize: Fix 'Binding loop detected for
property "imageAspectRatio"'
* Make the scope settings list scroll to text visible area (LP:
#1499084)
* Move to importing QtQuick 2.4 & friends
* Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
[ Andrea Cimitan ]
* Add sharing widget to zoomable image and video playback
* Make zoomable and video playback widgets edge to edge
* Updated all 1.3 UbuntuShape to use new APIs where possible
* Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
[ CI Train Bot ]
* Resync trunk.
[ Christopher Lee ]
* Quick spelling fix in process control output.
[ Daniel d'Andrada ]
* Enable support for overriding application orientations based on
device type (LP: #1478637)
* Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
* Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
[ Josh Arenson ]
* Enable support for overriding application orientations based on
device type (LP: #1478637)
[ Michael Terry ]
* Avoid showing the shutdown dialog when turning on the screen if your
device is under heavy load. (LP: #1508563)
* Handle lifecycle policy exceptions ourselves, instead of letting
qtmir do it for us and allow non-Touch apps to opt-out of the Touch
lifecycle.
[ Michael Zanetti ]
* Fixes for the panel buttons (LP: #1510360, #1504269, #1431566,
#1443319)
* Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
[ Michał Sawicz ]
* Add missing copyright to Cursor.qml
* Enable support for overriding application orientations based on
device type (LP: #1478637)
* Support server->client visibility change to stop rendering
(lp:#1475678) (LP: #1475678)
[ Nick Dedekind ]
* Support server->client visibility change to stop rendering
(lp:#1475678) (LP: #1475678)
commitad33176139f17e2325027c705a7b001f072e8a60
authorJosh Arenson <joshua.arenson@canonical.com>
dateFri 6 Nov 2015, 11:43 (11 years ago)
parenta167c5dd527f6b
381 files changed+2660−1524
CMakeLists.txt+9−9
@@ -49,15 +49,15 @@ add_custom_target(cppcheck COMMAND cppcheck --enable=all -q --error-exitcode=2
4949 ${CMAKE_SOURCE_DIR}/src ${CMAKE_SOURCE_DIR}/tests)
5050
5151include(FindPkgConfig)
52−find_package(Qt5Core 5.2 REQUIRED)
53−find_package(Qt5Qml 5.2 REQUIRED)
54−find_package(Qt5Quick 5.2 REQUIRED)
55−find_package(Qt5Gui 5.2 REQUIRED)
56−find_package(Qt5DBus 5.2 REQUIRED)
57−find_package(Qt5Concurrent 5.2 REQUIRED)
58−find_package(Qt5Sql 5.2 REQUIRED)
59−
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=9)
52+find_package(Qt5Core 5.4 REQUIRED)
53+find_package(Qt5Qml 5.4 REQUIRED)
54+find_package(Qt5Quick 5.4 REQUIRED)
55+find_package(Qt5Gui 5.4 REQUIRED)
56+find_package(Qt5DBus 5.4 REQUIRED)
57+find_package(Qt5Concurrent 5.4 REQUIRED)
58+find_package(Qt5Sql 5.4 REQUIRED)
59+
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=10)
6161
6262# Standard install paths
6363include(GNUInstallDirs)
debian/changelog+58
@@ -1,3 +1,61 @@
1+unity8 (8.11+16.04.20151104-0ubuntu1) xenial; urgency=medium
2+
3+ [ Albert Astals Cid ]
4+ * Add an Item that proxies for old and new audio roles (LP: #1493851)
5+ * CroppedImageMinimumSourceSize: Fix 'Binding loop detected for
6+ property "imageAspectRatio"'
7+ * Make the scope settings list scroll to text visible area (LP:
8+ #1499084)
9+ * Move to importing QtQuick 2.4 & friends
10+ * Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
11+
12+ [ Andrea Cimitan ]
13+ * Add sharing widget to zoomable image and video playback
14+ * Make zoomable and video playback widgets edge to edge
15+ * Updated all 1.3 UbuntuShape to use new APIs where possible
16+ * Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
17+
18+ [ CI Train Bot ]
19+ * Resync trunk.
20+
21+ [ Christopher Lee ]
22+ * Quick spelling fix in process control output.
23+
24+ [ Daniel d'Andrada ]
25+ * Enable support for overriding application orientations based on
26+ device type (LP: #1478637)
27+ * Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
28+ * Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
29+
30+ [ Josh Arenson ]
31+ * Enable support for overriding application orientations based on
32+ device type (LP: #1478637)
33+
34+ [ Michael Terry ]
35+ * Avoid showing the shutdown dialog when turning on the screen if your
36+ device is under heavy load. (LP: #1508563)
37+ * Handle lifecycle policy exceptions ourselves, instead of letting
38+ qtmir do it for us and allow non-Touch apps to opt-out of the Touch
39+ lifecycle.
40+
41+ [ Michael Zanetti ]
42+ * Fixes for the panel buttons (LP: #1510360, #1504269, #1431566,
43+ #1443319)
44+ * Use SDK 1.3 across all files (LP: #1503498, #1508363, #1449628)
45+
46+ [ Michał Sawicz ]
47+ * Add missing copyright to Cursor.qml
48+ * Enable support for overriding application orientations based on
49+ device type (LP: #1478637)
50+ * Support server->client visibility change to stop rendering
51+ (lp:#1475678) (LP: #1475678)
52+
53+ [ Nick Dedekind ]
54+ * Support server->client visibility change to stop rendering
55+ (lp:#1475678) (LP: #1475678)
56+
57+ -- Michał Sawicz <michal.sawicz@canonical.com> Wed, 04 Nov 2015 14:58:41 +0000
58+
159unity8 (8.11+15.10.20151021-0ubuntu1) wily; urgency=medium
260
361 [ Albert Astals Cid ]
debian/control+9−8
@@ -30,7 +30,7 @@ Build-Depends: cmake,
3030 libqt5xmlpatterns5-dev,
3131 libsystemsettings-dev,
3232 libudev-dev,
33− libunity-api-dev (>= 7.101),
33+ libunity-api-dev (>= 7.102),
3434 libusermetricsoutput1-dev,
3535 libxcb1-dev,
3636 pkg-config,
@@ -43,15 +43,16 @@ Build-Depends: cmake,
4343 qml-module-qtsysteminfo,
4444 qml-module-qttest,
4545 qt5-default,
46− qtbase5-dev (>= 5.2.1),
46+ qtbase5-dev (>= 5.4),
4747 qtbase5-dev-tools,
48− qtbase5-private-dev (>= 5.2.1),
49− qtdeclarative5-dev (>= 5.2.1),
48+ qtbase5-private-dev (>= 5.4),
49+ qtdeclarative5-dev (>= 5.4),
5050 qtdeclarative5-dev-tools,
51− qtdeclarative5-private-dev (>= 5.2.1),
51+ qtdeclarative5-private-dev (>= 5.4),
5252 qtdeclarative5-qtmultimedia-plugin,
53+ qtdeclarative5-ubuntu-content1,
5354 qtdeclarative5-ubuntu-settings-components (>= 0.6),
54− qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
55+ qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1676) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1676),
5556 qtdeclarative5-ubuntu-web-plugin,
5657 ttf-ubuntu-font-family,
5758Standards-Version: 3.9.4
@@ -138,7 +139,7 @@ Depends: qml-module-qtquick-layouts,
138139 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
139140 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
140141 ubuntu-thumbnailer-impl-0,
141− unity-application-impl-9,
142+ unity-application-impl-10,
142143 unity-notifications-impl-3,
143144 unity-plugin-scopes | unity-scopes-impl,
144145 unity-scopes-impl-7,
@@ -184,7 +185,7 @@ Pre-Depends: ${misc:Pre-Depends},
184185Depends: ${misc:Depends},
185186 ${shlibs:Depends},
186187Provides: unity-application-impl,
187− unity-application-impl-9,
188+ unity-application-impl-10,
188189Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
189190Description: Fake environment for running Unity 8 shell
190191 Provides fake implementations of some QML modules used by Unity 8 shell
plugins/Dash/CardAttributes.qml+3−3
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020
2121GridLayout {
2222 id: grid
@@ -27,7 +27,7 @@ GridLayout {
2727 columns: 2 + repeater.count % 2
2828 rowSpacing: units.gu(.5)
2929 property alias model: repeater.model
30− property color color: Theme.palette.normal.baseText
30+ property color color: theme.palette.normal.baseText
3131 property real fontScale: 1.0
3232
3333 Repeater {
plugins/Dash/CardCreator.js+26−52
@@ -28,11 +28,12 @@ var kBackgroundLoaderCode = 'Loader {\n\
2828 sourceComponent: UbuntuShape { \n\
2929 objectName: "background"; \n\
3030 radius: "medium"; \n\
31− color: getColor(0) || "white"; \n\
32− gradientColor: getColor(1) || color; \n\
31+ backgroundColor: getColor(0) || "white"; \n\
32+ secondaryBackgroundColor: getColor(1) || backgroundColor; \n\
33+ backgroundMode: UbuntuShape.VerticalGradient; \n\
3334 anchors.fill: parent; \n\
34− image: backgroundImage.source ? backgroundImage : null; \n\
35− property real luminance: Style.luminance(color); \n\
35+ source: backgroundImage.source ? backgroundImage : null; \n\
36+ property real luminance: Style.luminance(backgroundColor); \n\
3637 property Image backgroundImage: Image { \n\
3738 objectName: "backgroundImage"; \n\
3839 source: { \n\
@@ -52,7 +53,7 @@ var kBackgroundLoaderCode = 'Loader {\n\
5253// %1 is used as anchors of artShapeHolder
5354// %2 is used as image width
5455// %3 is used as image height
55−var kArtShapeHolderCode = 'Item { \n\
56+var kArtShapeHolderCode = 'Item { \n\
5657 id: artShapeHolder; \n\
5758 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
5859 width: root.fixedArtShapeSize.width > 0 ? root.fixedArtShapeSize.width : artShapeLoader.width; \n\
@@ -66,10 +67,9 @@ var kArtShapeHolderCode = 'Item { \n\
6667 sourceComponent: Item { \n\
6768 id: artShape; \n\
6869 objectName: "artShape"; \n\
69− property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
70+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
7071 visible: image.status == Image.Ready; \n\
7172 readonly property alias image: artImage; \n\
72− property alias borderSource: artShapeShape.borderSource; \n\
7373 ShaderEffectSource { \n\
7474 id: artShapeSource; \n\
7575 sourceItem: artImage; \n\
@@ -78,16 +78,17 @@ var kArtShapeHolderCode = 'Item { \n\
7878 height: 1; \n\
7979 hideSource: doShapeItem; \n\
8080 } \n\
81− Shape { \n\
81+ UbuntuShape { \n\
8282 id: artShapeShape; \n\
83− image: artShapeSource; \n\
83+ source: artShapeSource; \n\
8484 anchors.fill: parent; \n\
8585 visible: doShapeItem; \n\
8686 radius: "medium"; \n\
87+ aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat; \n\
8788 } \n\
8889 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
8990 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
90− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; } \n\
91+ Component.onCompleted: { updateWidthHeightBindings(); } \n\
9192 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
9293 function updateWidthHeightBindings() { \n\
9394 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) { \n\
@@ -112,44 +113,18 @@ var kArtShapeHolderCode = 'Item { \n\
112113
113114var kOverlayLoaderCode = 'Loader { \n\
114115 id: overlayLoader; \n\
115− anchors { \n\
116− left: artShapeHolder.left; \n\
117− right: artShapeHolder.right; \n\
118− bottom: artShapeHolder.bottom; \n\
119− } \n\
116+ readonly property real overlayHeight: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); \n\
117+ anchors.fill: artShapeHolder; \n\
120118 active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false; \n\
121119 asynchronous: root.asynchronous; \n\
122120 visible: showHeader && status == Loader.Ready; \n\
123− sourceComponent: ShaderEffect { \n\
121+ sourceComponent: UbuntuShapeOverlay { \n\
124122 id: overlay; \n\
125− height: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2); \n\
126123 property real luminance: Style.luminance(overlayColor); \n\
127− property color overlayColor: cardData && cardData["overlayColor"] || "#99000000"; \n\
128− property var source: ShaderEffectSource { \n\
129− id: shaderSource; \n\
130− sourceItem: artShapeLoader.item; \n\
131− onVisibleChanged: if (visible) scheduleUpdate(); \n\
132− live: false; \n\
133− sourceRect: Qt.rect(0, artShapeLoader.height - overlay.height, artShapeLoader.width, overlay.height); \n\
134− } \n\
135− vertexShader: " \n\
136− uniform highp mat4 qt_Matrix; \n\
137− attribute highp vec4 qt_Vertex; \n\
138− attribute highp vec2 qt_MultiTexCoord0; \n\
139− varying highp vec2 coord; \n\
140− void main() { \n\
141− coord = qt_MultiTexCoord0; \n\
142− gl_Position = qt_Matrix * qt_Vertex; \n\
143− }"; \n\
144− fragmentShader: " \n\
145− varying highp vec2 coord; \n\
146− uniform sampler2D source; \n\
147− uniform lowp float qt_Opacity; \n\
148− uniform highp vec4 overlayColor; \n\
149− void main() { \n\
150− lowp vec4 tex = texture2D(source, coord); \n\
151− gl_FragColor = vec4(overlayColor.r, overlayColor.g, overlayColor.b, 1) * qt_Opacity * overlayColor.a * tex.a; \n\
152− }"; \n\
124+ aspect: UbuntuShape.Flat; \n\
125+ radius: "medium"; \n\
126+ overlayColor: cardData && cardData["overlayColor"] || "#99000000"; \n\
127+ overlayRect: Qt.rect(0, 1 - overlayLoader.overlayHeight / height, 1, 1); \n\
153128 } \n\
154129 }\n';
155130
@@ -325,7 +300,7 @@ function cardString(template, components) {
325300 id: root; \n\
326301 property var components; \n\
327302 property var cardData; \n\
328− property var artShapeBorderSource: undefined; \n\
303+ property string artShapeStyle: "inset"; \n\
329304 property real fontScale: 1.0; \n\
330305 property var scopeStyle: null; \n\
331306 property int titleAlignment: Text.AlignLeft; \n\
@@ -368,7 +343,6 @@ function cardString(template, components) {
368343 }
369344
370345 if (hasArt) {
371− code += 'onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; } \n';
372346 code += 'readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);\n';
373347
374348 var widthCode, heightCode;
@@ -480,20 +454,20 @@ function cardString(template, components) {
480454 }
481455 }
482456
483− var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white")';
457+ var summaryColorWithBackground = 'backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white")';
484458
485459 var hasTitleContainer = hasTitle && (hasEmblem || (hasMascot && (hasSubtitle || hasAttributes)));
486460 var titleSubtitleCode = '';
487461 if (hasTitle) {
488462 var titleColor;
489463 if (headerAsOverlay) {
490− titleColor = 'root.scopeStyle && overlayLoader.item ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item && overlayLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white")';
464+ titleColor = 'root.scopeStyle && overlayLoader.item ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item && overlayLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white")';
491465 } else if (hasSummary) {
492466 titleColor = 'summary.color';
493467 } else if (hasBackground) {
494468 titleColor = summaryColorWithBackground;
495469 } else {
496− titleColor = 'root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText';
470+ titleColor = 'root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText';
497471 }
498472
499473 var titleAnchors;
@@ -555,7 +529,7 @@ function cardString(template, components) {
555529 titleAnchors += 'left: parent.left; \n\
556530 leftMargin: units.gu(1); \n\
557531 top: overlayLoader.top; \n\
558− topMargin: units.gu(1);\n';
532+ topMargin: units.gu(1) + overlayLoader.height - overlayLoader.overlayHeight; \n';
559533 } else {
560534 // Using anchors to the mascot/parent
561535 titleAnchors = titleRightAnchor;
@@ -649,7 +623,7 @@ function cardString(template, components) {
649623 if (hasBackground) {
650624 summaryColor = summaryColorWithBackground;
651625 } else {
652− summaryColor = 'root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText';
626+ summaryColor = 'root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText';
653627 }
654628
655629 var summaryTopMargin = (hasMascot || hasSubtitle || hasAttributes ? 'anchors.margins' : '0');
@@ -697,8 +671,8 @@ function cardString(template, components) {
697671}
698672
699673function createCardComponent(parent, template, components) {
700− var imports = 'import QtQuick 2.2; \n\
701− import Ubuntu.Components 1.1; \n\
674+ var imports = 'import QtQuick 2.4; \n\
675+ import Ubuntu.Components 1.3; \n\
702676 import Ubuntu.Settings.Components 0.1; \n\
703677 import Dash 0.1;\n\
704678 import Utils 0.1;\n';
plugins/Dash/CardCreatorCache.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717pragma Singleton
18−import QtQuick 2.2
18+import QtQuick 2.4
1919import "CardCreator.js" as CardCreator
2020
2121QtObject {
plugins/Dash/CroppedImageMinimumSourceSize.qml+16−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014, 2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,14 +14,25 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818
1919Image {
2020 id: root
2121
2222 fillMode: Image.PreserveAspectCrop
2323
24− readonly property real itemAspectRatio: width / height
25− readonly property real imageAspectRatio: implicitWidth / implicitHeight
26− sourceSize: (imageAspectRatio > itemAspectRatio) ? Qt.size(0, height) : Qt.size(width, 0)
24+ property bool useHeight: false
25+ function updateUseHeight()
26+ {
27+ // Do not turn into a binding since otherwise the qml
28+ // engine complains about binding loops
29+ useHeight = (implicitWidth / implicitHeight) > (width / height);
30+ }
31+
32+ onHeightChanged: updateUseHeight();
33+ onWidthChanged: updateUseHeight();
34+ onImplicitHeightChanged: updateUseHeight();
35+ onImplicitWidthChanged: updateUseHeight();
36+
37+ sourceSize: useHeight ? Qt.size(0, height) : Qt.size(width, 0)
2738}
plugins/Dash/ScopeStyle.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import Utils 0.1
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020
2121/*! \brief Helper for processing scope customization options.
2222
plugins/Dash/abstractdashview.h−4
@@ -109,11 +109,7 @@ private:
109109 virtual void doRelayout() = 0;
110110 virtual void updateItemCulling(qreal visibleFromY, qreal visibleToY) = 0;
111111 virtual void calculateImplicitHeight() = 0;
112−#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
113− virtual void processModelRemoves(const QVector<QQmlChangeSet::Remove> &removes) = 0;
114−#else
115112 virtual void processModelRemoves(const QVector<QQmlChangeSet::Change> &removes) = 0;
116−#endif
117113
118114 QQmlDelegateModel *m_delegateModel;
119115
plugins/Dash/horizontaljournal.cpp−4
@@ -182,11 +182,7 @@ void HorizontalJournal::calculateImplicitHeight()
182182 }
183183}
184184
185−#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
186−void HorizontalJournal::processModelRemoves(const QVector<QQmlChangeSet::Remove> &removes)
187−#else
188185void HorizontalJournal::processModelRemoves(const QVector<QQmlChangeSet::Change> &removes)
189−#endif
190186{
191187 Q_FOREACH(const QQmlChangeSet::Change &remove, removes) {
192188 for (int i = remove.count - 1; i >= 0; --i) {
plugins/Dash/horizontaljournal.h−4
@@ -52,11 +52,7 @@ private:
5252 void calculateImplicitHeight() override;
5353 void doRelayout() override;
5454 void updateItemCulling(qreal visibleFromY, qreal visibleToY) override;
55−#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
56− void processModelRemoves(const QVector<QQmlChangeSet::Remove> &removes) override;
57−#else
5855 void processModelRemoves(const QVector<QQmlChangeSet::Change> &removes) override;
59−#endif
6056
6157 int m_firstVisibleIndex;
6258 QList<QQuickItem*> m_visibleItems;
plugins/Dash/organicgrid.cpp−4
@@ -235,11 +235,7 @@ void OrganicGrid::calculateImplicitHeight()
235235 }
236236}
237237
238−#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
239−void OrganicGrid::processModelRemoves(const QVector<QQmlChangeSet::Remove> &removes)
240−#else
241238void OrganicGrid::processModelRemoves(const QVector<QQmlChangeSet::Change> &removes)
242−#endif
243239{
244240 Q_FOREACH(const QQmlChangeSet::Change &remove, removes) {
245241 for (int i = remove.count - 1; i >= 0; --i) {
plugins/Dash/organicgrid.h−4
@@ -79,11 +79,7 @@ private:
7979 void doRelayout() override;
8080 void updateItemCulling(qreal visibleFromY, qreal visibleToY) override;
8181 void calculateImplicitHeight() override;
82−#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
83− void processModelRemoves(const QVector<QQmlChangeSet::Remove> &removes) override;
84−#else
8582 void processModelRemoves(const QVector<QQmlChangeSet::Change> &removes) override;
86−#endif
8783
8884 QSizeF m_smallDelegateSize;
8985 QSizeF m_bigDelegateSize;
plugins/Dash/verticaljournal.cpp−4
@@ -237,11 +237,7 @@ void VerticalJournal::updateItemCulling(qreal visibleFromY, qreal visibleToY)
237237 }
238238}
239239
240−#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
241−void VerticalJournal::processModelRemoves(const QVector<QQmlChangeSet::Remove> &removes)
242−#else
243240void VerticalJournal::processModelRemoves(const QVector<QQmlChangeSet::Change> &removes)
244−#endif
245241{
246242 Q_FOREACH(const QQmlChangeSet::Change &remove, removes) {
247243 for (int i = remove.count - 1; i >= 0; --i) {
plugins/Dash/verticaljournal.h−4
@@ -90,11 +90,7 @@ private:
9090 void calculateImplicitHeight() override;
9191 void doRelayout() override;
9292 void updateItemCulling(qreal visibleFromY, qreal visibleToY) override;
93−#if (QT_VERSION < QT_VERSION_CHECK(5, 4, 0))
94− void processModelRemoves(const QVector<QQmlChangeSet::Remove> &removes) override;
95−#else
9693 void processModelRemoves(const QVector<QQmlChangeSet::Change> &removes) override;
97−#endif
9894
9995 QVector<QList<ViewItem>> m_columnVisibleItems;
10096 QHash<int, int> m_indexColumnMap;
plugins/Utils/windowkeysfilter.cpp+15−1
@@ -21,7 +21,8 @@
2121#include <QQuickWindow>
2222
2323WindowKeysFilter::WindowKeysFilter(QQuickItem *parent)
24− : QQuickItem(parent)
24+ : QQuickItem(parent),
25+ m_currentEventTimestamp(0)
2526{
2627 connect(this, &QQuickItem::windowChanged,
2728 this, &WindowKeysFilter::setupFilterOnWindow);
@@ -36,7 +37,15 @@ bool WindowKeysFilter::eventFilter(QObject *watched, QEvent *event)
3637 if (event->type() == QEvent::KeyPress || event->type() == QEvent::KeyRelease) {
3738 // Let QML see this event and decide if it does not want it
3839 event->accept();
40+
41+ m_currentEventTimestamp = static_cast<QInputEvent*>(event)->timestamp();
42+ Q_EMIT currentEventTimestampChanged();
43+
3944 QCoreApplication::sendEvent(this, event);
45+
46+ m_currentEventTimestamp = 0;
47+ Q_EMIT currentEventTimestampChanged();
48+
4049 return event->isAccepted();
4150 } else {
4251 // Not interested
@@ -56,3 +65,8 @@ void WindowKeysFilter::setupFilterOnWindow(QQuickWindow *window)
5665 m_filteredWindow = window;
5766 }
5867}
68+
69+ulong WindowKeysFilter::currentEventTimestamp() const
70+{
71+ return m_currentEventTimestamp;
72+}
plugins/Utils/windowkeysfilter.h+7
@@ -36,16 +36,23 @@
3636class WindowKeysFilter : public QQuickItem
3737{
3838 Q_OBJECT
39+ Q_PROPERTY(ulong currentEventTimestamp READ currentEventTimestamp NOTIFY currentEventTimestampChanged)
3940public:
4041 WindowKeysFilter(QQuickItem *parent = 0);
4142
4243 bool eventFilter(QObject *watched, QEvent *event) override;
4344
45+ ulong currentEventTimestamp() const;
46+
47+Q_SIGNALS:
48+ void currentEventTimestampChanged();
49+
4450private Q_SLOTS:
4551 void setupFilterOnWindow(QQuickWindow *window);
4652
4753private:
4854 QPointer<QQuickWindow> m_filteredWindow;
55+ ulong m_currentEventTimestamp;
4956};
5057
5158#endif // UNITY_WINDOWKEYSFILTER_H
plugins/Utils/windowstatestorage.cpp+61−22
@@ -47,26 +47,38 @@ WindowStateStorage::~WindowStateStorage()
4747 m_db.close();
4848}
4949
50−void WindowStateStorage::saveGeometry(const QString &windowId, const QRect &rect)
50+void WindowStateStorage::saveState(const QString &windowId, WindowStateStorage::WindowState state)
5151{
52− QMutexLocker mutexLocker(&s_mutex);
52+ const QString queryString = QStringLiteral("INSERT OR REPLACE INTO state (windowId, state) values ('%1', '%2');")
53+ .arg(windowId)
54+ .arg((int)state);
55+
56+ saveValue(queryString);
57+}
58+
59+WindowStateStorage::WindowState WindowStateStorage::getState(const QString &windowId, WindowStateStorage::WindowState defaultValue) const
60+{
61+ const QString queryString = QStringLiteral("SELECT * FROM state WHERE windowId = '%1';")
62+ .arg(windowId);
5363
54− QString queryString = QStringLiteral("INSERT OR REPLACE INTO geometry (windowId, x, y, width, height) values ('%1', '%2', '%3', '%4', '%5');")
64+ QSqlQuery query = getValue(queryString);
65+
66+ if (!query.first()) {
67+ return defaultValue;
68+ }
69+ return (WindowState)query.value("state").toInt();
70+}
71+
72+void WindowStateStorage::saveGeometry(const QString &windowId, const QRect &rect)
73+{
74+ const QString queryString = QStringLiteral("INSERT OR REPLACE INTO geometry (windowId, x, y, width, height) values ('%1', '%2', '%3', '%4', '%5');")
5575 .arg(windowId)
5676 .arg(rect.x())
5777 .arg(rect.y())
5878 .arg(rect.width())
5979 .arg(rect.height());
6080
61− QFuture<void> future = QtConcurrent::run(executeAsyncQuery, queryString);
62− m_asyncQueries.append(future);
63−
64− QFutureWatcher<void> *futureWatcher = new QFutureWatcher<void>();
65− futureWatcher->setFuture(future);
66− connect(futureWatcher, &QFutureWatcher<void>::finished,
67− this,
68− [=](){ m_asyncQueries.removeAll(futureWatcher->future());
69− futureWatcher->deleteLater(); });
81+ saveValue(queryString);
7082}
7183
7284void WindowStateStorage::executeAsyncQuery(const QString &queryString)
@@ -82,20 +94,13 @@ void WindowStateStorage::executeAsyncQuery(const QString &queryString)
8294 }
8395}
8496
85−QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defaultValue)
97+QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defaultValue) const
8698{
87− QMutexLocker l(&s_mutex);
8899 QString queryString = QStringLiteral("SELECT * FROM geometry WHERE windowId = '%1';")
89100 .arg(windowId);
90− QSqlQuery query;
91101
92− bool ok = query.exec(queryString);
93− if (!ok) {
94− qWarning() << "Error retrieving window state for" << windowId
95− << "Driver error:" << query.lastError().driverText()
96− << "Database error:" << query.lastError().databaseText();
97− return defaultValue;
98− }
102+ QSqlQuery query = getValue(queryString);
103+
99104 if (!query.first()) {
100105 return defaultValue;
101106 }
@@ -114,4 +119,38 @@ void WindowStateStorage::initdb()
114119 QSqlQuery query;
115120 query.exec(QStringLiteral("CREATE TABLE geometry(windowId TEXT UNIQUE, x INTEGER, y INTEGER, width INTEGER, height INTEGER);"));
116121 }
122+
123+ if (!m_db.tables().contains("state")) {
124+ QSqlQuery query;
125+ query.exec("CREATE TABLE state(windowId TEXT UNIQUE, state INTEGER);");
126+ }
127+}
128+
129+void WindowStateStorage::saveValue(const QString &queryString)
130+{
131+ QMutexLocker mutexLocker(&s_mutex);
132+
133+ QFuture<void> future = QtConcurrent::run(executeAsyncQuery, queryString);
134+ m_asyncQueries.append(future);
135+
136+ QFutureWatcher<void> *futureWatcher = new QFutureWatcher<void>();
137+ futureWatcher->setFuture(future);
138+ connect(futureWatcher, &QFutureWatcher<void>::finished,
139+ this,
140+ [=](){ m_asyncQueries.removeAll(futureWatcher->future());
141+ futureWatcher->deleteLater(); });
142+}
143+
144+QSqlQuery WindowStateStorage::getValue(const QString &queryString) const
145+{
146+ QMutexLocker l(&s_mutex);
147+ QSqlQuery query;
148+
149+ bool ok = query.exec(queryString);
150+ if (!ok) {
151+ qWarning() << "Error retrieving database query:" << queryString
152+ << "Driver error:" << query.lastError().driverText()
153+ << "Database error:" << query.lastError().databaseText();
154+ }
155+ return query;
117156}
plugins/Utils/windowstatestorage.h+13−1
@@ -22,16 +22,28 @@
2222class WindowStateStorage: public QObject
2323{
2424 Q_OBJECT
25+ Q_ENUMS(WindowState)
2526public:
27+ enum WindowState {
28+ WindowStateNormal,
29+ WindowStateMaximized
30+ };
31+
2632 WindowStateStorage(QObject *parent = 0);
2733 virtual ~WindowStateStorage();
2834
35+ Q_INVOKABLE void saveState(const QString &windowId, WindowState state);
36+ Q_INVOKABLE WindowState getState(const QString &windowId, WindowState defaultValue) const;
37+
2938 Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect &rect);
30− Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue);
39+ Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue) const;
3140
3241private:
3342 void initdb();
3443
44+ void saveValue(const QString &queryString);
45+ QSqlQuery getValue(const QString &queryString) const;
46+
3547 static void executeAsyncQuery(const QString &queryString);
3648 static QMutex s_mutex;
3749
po/unity8.pot+53−49
@@ -8,7 +8,7 @@ msgid ""
88msgstr ""
99"Project-Id-Version: unity8\n"
1010"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2015-09-16 00:49+0200\n"
11+"POT-Creation-Date: 2015-10-19 14:34+0100\n"
1212"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
1313"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
1414"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -69,8 +69,8 @@ msgstr ""
6969#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
7070#. This format string is used for showing, on a 12-hour clock, times that happened before a week from now.
7171#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
72−#. en_US example: "%a %d %b\u2003%l:%M %p" --> "Fri Oct 31 1:00 PM"
73−#. en_GB example: "%a %b %d\u2003%l:%M %p" --> "Fri 31 Oct 1:00 PM"
72+#. en_US example: "%a %b %d\u2003%l:%M %p" --> "Fri Oct 31 1:00 PM"
73+#. en_GB example: "%a %d %b\u2003%l:%M %p" --> "Fri 31 Oct 1:00 PM"
7474#: plugins/Utils/relativetimeformatter.cpp:190
7575msgid "%a %d %b %l:%M %p"
7676msgstr ""
@@ -109,8 +109,8 @@ msgstr ""
109109#. Translators, please edit/rearrange these strftime(3) tokens to suit your locale!
110110#. This format string is used for showing, on a 24-hour clock, times that happened before a week from now.
111111#. (\u2003 is a unicode em space which is slightly wider than a normal space.)
112−#. en_US example: "%a %d %b\u2003%H:%M" --> "Fri Oct 31 13:00"
113−#. en_GB example: "%a %b %d\u2003%H:%M" --> "Fri 31 Oct 13:00"
112+#. en_US example: "%a %b %d\u2003%H:%M" --> "Fri Oct 31 13:00"
113+#. en_GB example: "%a %d %b\u2003%H:%M" --> "Fri 31 Oct 13:00"
114114#: plugins/Utils/relativetimeformatter.cpp:234
115115msgid "%a %d %b %H:%M"
116116msgstr ""
@@ -286,6 +286,10 @@ msgstr ""
286286msgid "Add a review"
287287msgstr ""
288288
289+#: qml/Dash/Previews/PreviewSharing.qml:51
290+msgid "Preview Share Item"
291+msgstr ""
292+
289293#: qml/Dash/PullToRefreshScopeStyle.qml:55
290294msgid "Pull to refresh…"
291295msgstr ""
@@ -389,62 +393,62 @@ msgstr ""
389393msgid "Conference"
390394msgstr ""
391395
392−#: qml/Panel/Indicators/MenuItemFactory.qml:718
396+#: qml/Panel/Indicators/MenuItemFactory.qml:727
393397msgid "Nothing is playing"
394398msgstr ""
395399
396−#: qml/Panel/Indicators/MenuItemFactory.qml:847
400+#: qml/Panel/Indicators/MenuItemFactory.qml:856
397401#, qt-format
398402msgid "%1 hour"
399403msgid_plural "%1 hours"
400404msgstr[0] ""
401405msgstr[1] ""
402406
403−#: qml/Panel/Indicators/MenuItemFactory.qml:851
407+#: qml/Panel/Indicators/MenuItemFactory.qml:860
404408#, qt-format
405409msgid "%1 minute"
406410msgid_plural "%1 minutes"
407411msgstr[0] ""
408412msgstr[1] ""
409413
410−#: qml/Panel/Indicators/MenuItemFactory.qml:856
414+#: qml/Panel/Indicators/MenuItemFactory.qml:865
411415#, qt-format
412416msgid "%1 second"
413417msgid_plural "%1 seconds"
414418msgstr[0] ""
415419msgstr[1] ""
416420
417−#: qml/Panel/Indicators/MenuItemFactory.qml:859
421+#: qml/Panel/Indicators/MenuItemFactory.qml:868
418422msgid "0 seconds"
419423msgstr ""
420424
421425#. Translators: String like "1 hour, 2 minutes, 3 seconds remaining"
422−#: qml/Panel/Indicators/MenuItemFactory.qml:861
426+#: qml/Panel/Indicators/MenuItemFactory.qml:870
423427#, qt-format
424428msgid "%1 remaining"
425429msgstr ""
426430
427−#: qml/Panel/Indicators/MenuItemFactory.qml:867
431+#: qml/Panel/Indicators/MenuItemFactory.qml:876
428432msgid "In queue…"
429433msgstr ""
430434
431−#: qml/Panel/Indicators/MenuItemFactory.qml:871
435+#: qml/Panel/Indicators/MenuItemFactory.qml:880
432436msgid "Downloading"
433437msgstr ""
434438
435−#: qml/Panel/Indicators/MenuItemFactory.qml:873
439+#: qml/Panel/Indicators/MenuItemFactory.qml:882
436440msgid "Paused, tap to resume"
437441msgstr ""
438442
439−#: qml/Panel/Indicators/MenuItemFactory.qml:875
443+#: qml/Panel/Indicators/MenuItemFactory.qml:884
440444msgid "Canceled"
441445msgstr ""
442446
443−#: qml/Panel/Indicators/MenuItemFactory.qml:877
447+#: qml/Panel/Indicators/MenuItemFactory.qml:886
444448msgid "Finished"
445449msgstr ""
446450
447−#: qml/Panel/Indicators/MenuItemFactory.qml:879
451+#: qml/Panel/Indicators/MenuItemFactory.qml:888
448452msgid "Failed, tap to retry"
449453msgstr ""
450454
@@ -523,38 +527,6 @@ msgctxt "Button: Go back one page in the Wizard"
523527msgid "Back"
524528msgstr ""
525529
526−#: qml/Wizard/Pages/here-terms.qml:27
527−msgid "Terms & Conditions"
528−msgstr ""
529−
530−#: qml/Wizard/Pages/passwd-confirm.qml:49
531−msgid "Confirm passphrase"
532−msgstr ""
533−
534−#: qml/Wizard/Pages/passwd-confirm.qml:50
535−msgid "Confirm passcode"
536−msgstr ""
537−
538−#: qml/Wizard/Pages/passwd-confirm.qml:53
539−#: qml/Wizard/Pages/passwd-confirm.qml:54
540−msgid "Please try again."
541−msgstr ""
542−
543−#: qml/Wizard/Pages/passwd-confirm.qml:82 qml/Wizard/Pages/passwd-set.qml:90
544−#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
545−#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
546−#: qml/Wizard/Pages/60-reporting.qml:50
547−msgid "Continue"
548−msgstr ""
549−
550−#: qml/Wizard/Pages/passwd-set.qml:61
551−msgid "Choose your passcode"
552−msgstr ""
553−
554−#: qml/Wizard/Pages/passwd-set.qml:68
555−msgid "Passphrase must be 4 characters long"
556−msgstr ""
557−
558530#: qml/Wizard/Pages/10-welcome.qml:27
559531msgid "Hi!"
560532msgstr ""
@@ -567,6 +539,13 @@ msgstr ""
567539msgid "Let’s get started."
568540msgstr ""
569541
542+#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:128
543+#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
544+#: qml/Wizard/Pages/60-reporting.qml:50 qml/Wizard/Pages/passwd-confirm.qml:82
545+#: qml/Wizard/Pages/passwd-set.qml:90
546+msgid "Continue"
547+msgstr ""
548+
570549#: qml/Wizard/Pages/20-sim.qml:25
571550msgid "Add a SIM card and restart your device"
572551msgstr ""
@@ -692,6 +671,31 @@ msgstr ""
692671msgid "Finish"
693672msgstr ""
694673
674+#: qml/Wizard/Pages/here-terms.qml:27
675+msgid "Terms & Conditions"
676+msgstr ""
677+
678+#: qml/Wizard/Pages/passwd-confirm.qml:49
679+msgid "Confirm passphrase"
680+msgstr ""
681+
682+#: qml/Wizard/Pages/passwd-confirm.qml:50
683+msgid "Confirm passcode"
684+msgstr ""
685+
686+#: qml/Wizard/Pages/passwd-confirm.qml:53
687+#: qml/Wizard/Pages/passwd-confirm.qml:54
688+msgid "Please try again."
689+msgstr ""
690+
691+#: qml/Wizard/Pages/passwd-set.qml:61
692+msgid "Choose your passcode"
693+msgstr ""
694+
695+#: qml/Wizard/Pages/passwd-set.qml:68
696+msgid "Passphrase must be 4 characters long"
697+msgstr ""
698+
695699#. Translators: This is the arrow for "Back" buttons
696700#: qml/Wizard/StackButton.qml:39
697701#, qt-format
qml/Components/Background.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Utils 0.1 as Utils
2020
2121Loader {
qml/Components/BaseCarouselDelegate.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020/*!
2121 \brief Base delegate for use with the Carousel component
qml/Components/Carousel.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "carousel.js" as CarouselJS
2020
2121/*! The Carousel component presents the items of a model in a carousel view. It's similar to a
qml/Components/Circle.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Rectangle {
2020 antialiasing: true
qml/Components/DelayedLockscreen.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121Item {
qml/Components/Dialogs.qml+2−2
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919import Unity.Application 0.1
2020import Unity.Session 0.1
21−import Ubuntu.Components 1.1
2221import GlobalShortcut 1.0
22+import Ubuntu.Components 1.3
2323import Unity.Platform 1.0
2424import "../Greeter"
2525
qml/Components/DragHandle.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020
2121/*
qml/Components/DraggingArea.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020MouseArea {
2121 id: draggingArea
qml/Components/EdgeDragEvaluator.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020
2121/*
qml/Components/Header.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import Ubuntu.Components 1.1
18−import Ubuntu.Components.Themes.Ambiance 1.1
17+import Ubuntu.Components 1.3
18+import Ubuntu.Components.Themes.Ambiance 1.3
1919
2020PageHeadStyle {
2121 id: root
qml/Components/InputMethod.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Unity.Application 0.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Ubuntu.Gestures 0.1
2121
2222Item {
qml/Components/LazyImage.qml+24−13
@@ -17,8 +17,8 @@
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 */
1919
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
20+import QtQuick 2.4
21+import Ubuntu.Components 1.3
2222
2323Item {
2424 id: root
@@ -31,13 +31,12 @@ Item {
3131 property real initialHeight: scaleTo == "height" || scaleTo == "fit" ? height : units.gu(10)
3232
3333 property alias sourceSize: image.sourceSize
34− property alias fillMode: image.fillMode
3534 property alias asynchronous: image.asynchronous
3635 property alias cache: image.cache
37− property alias horizontalAlignment: image.horizontalAlignment
38− property alias verticalAlignment: image.verticalAlignment
3936 property alias sourceImage: image
40− property alias borderSource: shape.borderSource
37+
38+ property bool useUbuntuShape: true
39+ property bool pressed: false
4140
4241 state: "default"
4342
@@ -50,12 +49,15 @@ Item {
5049 }
5150 }
5251
53− UbuntuShape {
52+ Loader {
5453 id: placeholder
5554 objectName: "placeholder"
56− color: "#22FFFFFF"
5755 anchors.fill: shape
56+ active: useUbuntuShape
5857 visible: opacity != 0
58+ sourceComponent: UbuntuShape {
59+ backgroundColor: "#22FFFFFF"
60+ }
5961
6062 ActivityIndicator {
6163 id: activity
@@ -78,28 +80,37 @@ Item {
7880 }
7981 }
8082
81− UbuntuShape {
83+ Loader {
8284 id: shape
8385 objectName: "shape"
8486 height: root.initialHeight
8587 width: root.initialWidth
8688 anchors.centerIn: root.scaleTo == "fit" ? parent : undefined
87−
89+ active: useUbuntuShape
8890 opacity: 0
8991 visible: opacity != 0
92+ sourceComponent: UbuntuShapeOverlay {
93+ property bool pressed: false
94+ overlayColor: Qt.rgba(0, 0, 0, pressed ? 0.1 : 0)
95+ overlayRect: Qt.rect(0.0, 0.0, 1.0, 1.0)
96+ }
97+ onLoaded: {
98+ item.source = image;
99+ item.pressed = Qt.binding(function() { return root.pressed; });
100+ }
90101
91− image: Image {
102+ Image {
92103 id: image
93104 objectName: "image"
94105
95106 property url nextSource
96107 property string format: image.implicitWidth > image.implicitHeight ? "landscape" : "portrait"
97108
109+ anchors.fill: parent
110+ visible: !useUbuntuShape
98111 fillMode: Image.PreserveAspectFit
99112 asynchronous: true
100113 cache: false
101− horizontalAlignment: Image.AlignHCenter
102− verticalAlignment: Image.AlignVCenter
103114 sourceSize.width: root.scaleTo == "width" ? root.width
104115 : root.scaleTo == "fit" && root.width <= root.height ? root.width
105116 : 0
qml/Components/ListItems/Header.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020
2121Item {
2222 property alias text: label.text
qml/Components/ListItems/ThinDivider.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Image {
2020 anchors {
qml/Components/ListViewOSKScroller.qmlnew file+53
@@ -0,0 +1,53 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import "../Components"
19+
20+Item {
21+ id: root
22+
23+ property ListView list
24+
25+ Binding {
26+ target: list
27+ property: "bottomMargin"
28+ value: d.bottomMargin
29+ }
30+
31+ function setMakeSureVisibleItem(item) {
32+ d.previousVisibleHeight = d.visibleHeight;
33+ d.makeSureVisibleItem = item;
34+ }
35+
36+ QtObject {
37+ id: d
38+ property var makeSureVisibleItem
39+ property real previousVisibleHeight: 0
40+ readonly property real visibleHeight: list.height - list.bottomMargin
41+ readonly property real bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
42+
43+ onVisibleHeightChanged: {
44+ if (makeSureVisibleItem && makeSureVisibleItem.activeFocus && previousVisibleHeight > visibleHeight) {
45+ var textAreaPos = makeSureVisibleItem.mapToItem(list, 0, 0);
46+ if (textAreaPos.y + makeSureVisibleItem.height > visibleHeight) {
47+ list.contentY += textAreaPos.y + makeSureVisibleItem.height - visibleHeight
48+ }
49+ }
50+ previousVisibleHeight = visibleHeight;
51+ }
52+ }
53+}
qml/Components/Lockscreen.qml+3−3
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.0
19−import Ubuntu.Components.Popups 1.0
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.Popups 1.3
2020import Ubuntu.Telephony 0.1 as Telephony
2121
2222Showable {
qml/Components/NotificationAudio.qmlnew file+42
@@ -0,0 +1,42 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+
19+Item {
20+ id: root
21+ property string source: ""
22+ readonly property var playbackState: priv.audio ? priv.audio.playbackState : 0
23+
24+ function play() {
25+ priv.audio.play();
26+ }
27+ function stop() {
28+ priv.audio.stop();
29+ }
30+
31+ QtObject {
32+ id: priv
33+ property var audio: {
34+ try {
35+ return Qt.createQmlObject("import QtMultimedia 5.6; Audio { source: root.source; audioRole: MediaPlayer.NotificationRole }", priv)
36+ } catch(err) {
37+ console.log("Upstream audioRole enum not available, falling back to old role name.");
38+ return Qt.createQmlObject("import QtMultimedia 5.0; Audio { source: root.source; audioRole: MediaPlayer.alert }", priv)
39+ }
40+ }
41+ }
42+}
qml/Components/Orientations.qmlnew file+57
@@ -0,0 +1,57 @@
1+/*
2+ * Copyright 2015 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+
19+QtObject {
20+ id: root
21+
22+ // Just because "native" is a reserved keyword :(
23+ property int native_: Qt.PortraitOrientation
24+
25+ property int primary: Qt.PortraitOrientation
26+
27+ property int landscape: Qt.LandscapeOrientation
28+ property int invertedLandscape: Qt.InvertedLandscapeOrientation
29+ property int portrait: Qt.PortraitOrientation
30+ property int invertedPortrait: Qt.InvertedPortraitOrientation
31+
32+ function map(orientations) {
33+ var result = 0;
34+
35+ if (orientations & Qt.PortraitOrientation) {
36+ result |= root.portrait;
37+ }
38+
39+ if (orientations & Qt.InvertedPortraitOrientation) {
40+ result |= root.invertedPortrait;
41+ }
42+
43+ if (orientations & Qt.LandscapeOrientation) {
44+ result |= root.landscape;
45+ }
46+
47+ if (orientations & Qt.InvertedLandscapeOrientation) {
48+ result |= root.invertedLandscape;
49+ }
50+
51+ if (result == 0) {
52+ result = root.primary;
53+ }
54+
55+ return result;
56+ }
57+}
qml/Components/PanelState/PanelState.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717pragma Singleton
18−import QtQuick 2.0
18+import QtQuick 2.4
1919
2020QtObject {
2121 id: root
qml/Components/PassphraseLockscreen.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121Item {
qml/Components/PhysicalKeysMapper.qml+14−21
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Powerd 0.1
1919
2020/*!
@@ -57,27 +57,20 @@ Item {
5757
5858 property bool altPressed: false
5959 property bool altTabPressed: false
60− }
6160
62− Timer {
63− id: powerKeyLongPressTimer
64− interval: root.powerKeyLongPressTime
65− onTriggered: root.powerKeyLongPressed();
61+ property var powerButtonPressStart: 0
6662 }
6763
68− function onKeyPressed(event) {
69− if ((event.key == Qt.Key_PowerDown || event.key == Qt.Key_PowerOff)
70− && (!event.isAutoRepeat || !powerKeyLongPressTimer.running)) {
71−
72− // FIXME: We only consider power key presses if the screen is
73− // on because of bugs 1410830/1409003. The theory is that when
74− // those bugs are encountered, there is a >2s delay between the
75− // power press event and the power release event, which causes
76− // the shutdown dialog to appear on resume. So to avoid that
77− // symptom while we investigate the root cause, we simply won't
78− // initiate any dialogs when the screen is off.
79− if (Powerd.status === Powerd.On) {
80− powerKeyLongPressTimer.restart();
64+ function onKeyPressed(event, currentEventTimestamp) {
65+ if (event.key == Qt.Key_PowerDown || event.key == Qt.Key_PowerOff) {
66+ if (event.isAutoRepeat) {
67+ if (d.powerButtonPressStart > 0
68+ && currentEventTimestamp - d.powerButtonPressStart >= powerKeyLongPressTime) {
69+ d.powerButtonPressStart = 0;
70+ root.powerKeyLongPressed();
71+ }
72+ } else {
73+ d.powerButtonPressStart = currentEventTimestamp;
8174 }
8275 } else if ((event.key == Qt.Key_MediaTogglePlayPause || event.key == Qt.Key_MediaPlay) && !event.isAutoRepeat) {
8376 event.accepted = callManager.handleMediaKey(false);
@@ -113,9 +106,9 @@ Item {
113106 }
114107 }
115108
116− function onKeyReleased(event) {
109+ function onKeyReleased(event, currentEventTimestamp) {
117110 if (event.key == Qt.Key_PowerDown || event.key == Qt.Key_PowerOff) {
118− powerKeyLongPressTimer.stop();
111+ d.powerButtonPressStart = 0;
119112 event.accepted = true;
120113 } else if (event.key == Qt.Key_VolumeDown) {
121114 if (!d.ignoreVolumeEvents) root.volumeDownTriggered();
qml/Components/PinLockscreen.qml+3−3
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−import Ubuntu.Components.ListItems 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3
2020import "../Components"
2121
2222Item {
qml/Components/PinPadButton.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020AbstractButton {
2121 id: root
qml/Components/Rating.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020/*! Rating widget bar. */
2121
qml/Components/RatingStyle.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Row {
2121 anchors.fill: parent
qml/Components/ResponsiveGridView.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020/*
2121 Essentially a GridView where you can specify the maximum number of columns it can have.
qml/Components/ResponsiveVerticalJournal.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020import Dash 0.1
2121
qml/Components/ScreenGrabber.qml+2−4
@@ -14,8 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import QtMultimedia 5.0
17+import QtQuick 2.4
1918import ScreenGrabber 0.1
2019import GlobalShortcut 1.0
2120
@@ -40,9 +39,8 @@ Rectangle {
4039 onTriggered: capture()
4140 }
4241
43− Audio {
42+ NotificationAudio {
4443 id: shutterSound
45− audioRole: MediaPlayer.alert
4644 source: "/system/media/audio/ui/camera_click.ogg"
4745 }
4846
qml/Components/ScrollCalculator.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: scrollArea
qml/Components/SearchHistoryModel/SearchHistoryModel.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717pragma Singleton
18−import QtQuick 2.0
18+import QtQuick 2.4
1919
2020// TODO sanitize input, move to persistent storage
2121
qml/Components/ShellDialog.qml+3−3
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
19−import Ubuntu.Components 1.1
20−import Ubuntu.Components.Popups 0.1
19+import Ubuntu.Components 1.3
20+import Ubuntu.Components.Popups 1.3
2121
2222/*
2323 A Dialog configured for use as a proper in-scene Dialog
qml/Components/Showable.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Item {
2020 id: showable
qml/Components/StandardAnimation.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919NumberAnimation {
2020 duration: 200
qml/Components/UbuntuShapeForItem.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020/* FIXME: This component is duplicating the UbuntuShape from the SDK, but shapes more
2121 * general (Item-based) components. This ability should be incorporated into the SDK's
qml/Components/Unity8Settings.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import GSettings 1.0
1919
2020QtObject {
qml/Components/UnityInputInfo/UnityInputInfo.qml+2−2
@@ -16,10 +16,10 @@
1616
1717pragma Singleton
1818
19−import QtQuick 2.3
19+import QtQuick 2.4
2020import Unity.InputInfo 0.1
2121// Workaround https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1473471
22−import Ubuntu.Components 1.2
22+import Ubuntu.Components 1.3
2323
2424Item {
2525 id: root
qml/Components/WindowControlButtons.qml+5−2
@@ -16,8 +16,8 @@
1616 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
1717 */
1818
19−import QtQuick 2.3
20−import Ubuntu.Components 1.1
19+import QtQuick 2.4
20+import Ubuntu.Components 1.3
2121
2222Row {
2323 id: root
@@ -28,6 +28,7 @@ Row {
2828 signal maximize()
2929
3030 Rectangle {
31+ objectName: "closeWindowButton"
3132 height: parent.height; width: height; radius: height / 2
3233 gradient: Gradient {
3334 GradientStop { color: "#F49073"; position: 0 }
@@ -38,6 +39,7 @@ Row {
3839 MouseArea { anchors.fill: parent; onClicked: root.close() }
3940 }
4041 Rectangle {
42+ objectName: "minimizeWindowButton"
4143 height: parent.height; width: height; radius: height / 2
4244 gradient: Gradient {
4345 GradientStop { color: "#92918C"; position: 0 }
@@ -48,6 +50,7 @@ Row {
4850 MouseArea { anchors.fill: parent; onClicked: root.minimize() }
4951 }
5052 Rectangle {
53+ objectName: "maximizeWindowButton"
5154 height: parent.height; width: height; radius: height / 2
5255 gradient: Gradient {
5356 GradientStop { color: "#92918C"; position: 0 }
qml/Components/WindowScreenshot.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818
1919Item {
2020 id: root
qml/Components/WrongPasswordAnimation.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919SequentialAnimation {
2020 id: root
qml/Components/ZoomableImage.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121/*! \brief Zoomable for image.
qml/Dash/CardCarousel.qml+3−3
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121DashRenderer {
@@ -68,7 +68,7 @@ DashRenderer {
6868 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
6969 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
7070 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
71− item.artShapeBorderSource = "none";
71+ item.artShapeStyle = "flat";
7272 item.scopeStyle = cardCarousel.scopeStyle;
7373 }
7474
qml/Dash/CardGrid.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import "../Components"
1919
2020DashRenderer {
qml/Dash/CardHorizontalList.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121DashRenderer {
qml/Dash/CardTool.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020/*!
qml/Dash/CardVerticalJournal.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121DashRenderer {
qml/Dash/Dash.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import Unity 0.2
2121import Utils 0.1
qml/Dash/DashApplication.qml+4−3
@@ -14,15 +14,16 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.0
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Thumbnailer 0.1 // Register support for image://thumbnailer/ and image://albumart/
2020
2121MainView {
2222 implicitWidth: units.gu(40)
2323 implicitHeight: units.gu(68)
2424
25− useDeprecatedToolbar: false
25+ // Workaround bug #1475643
26+ headerColor: Qt.rgba(0, 0, 0, 0)
2627
2728 Dash {
2829 anchors.fill: parent
qml/Dash/DashBackground.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Image {
2020 source: anchors.fill.width > anchors.fill.height ? "graphics/paper_landscape.png" : "graphics/paper_portrait.png"
qml/Dash/DashCategoryBase.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 width: parent.width
qml/Dash/DashContent.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Unity 0.2
2020import Utils 0.1
2121import "../Components"
qml/Dash/DashContentTabBarStyle.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import Ubuntu.Components.Themes.Ambiance 0.1
17+import Ubuntu.Components.Themes.Ambiance 1.3
1818
1919TabBarStyle {
2020 indicatorImageSource: "graphics/tabbarchevron.png"
qml/Dash/DashNavigation.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Dash 0.1
2020import "../Components"
2121
@@ -48,7 +48,7 @@ Item {
4848 id: d
4949 readonly property color foregroundColor: root.scopeStyle
5050 ? root.scopeStyle.getTextColor(backgroundItem.luminance)
51− : Theme.palette.normal.baseText
51+ : theme.palette.normal.baseText
5252 readonly property bool bothVisible: altNavigationButton.visible && navigationButton.visible
5353 readonly property real navigationWidth: root.width >= units.gu(60) ? units.gu(40) : root.width
5454 readonly property real buttonWidth: navigationWidth / (bothVisible ? 2 : 1)
qml/Dash/DashNavigationButton.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020AbstractButton {
2121 id: root
@@ -24,7 +24,7 @@ AbstractButton {
2424 // Set by parent
2525 property var scope: null
2626 property var scopeStyle: null
27− property color foregroundColor: Theme.palette.normal.baseText
27+ property color foregroundColor: theme.palette.normal.baseText
2828 property bool isAltNavigation: false
2929 property bool showDivider: false
3030
qml/Dash/DashNavigationList.qml+5−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.ListItems 0.1 as ListItem
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3 as ListItem
2020import "../Components"
2121
2222Item {
@@ -24,7 +24,7 @@ Item {
2424 property var navigation: null
2525 property var currentNavigation: null
2626 property var scopeStyle: null
27− property color foregroundColor: Theme.palette.normal.baseText
27+ property color foregroundColor: theme.palette.normal.baseText
2828 signal enterNavigation(var newNavigationId, bool hasChildren)
2929 signal goBackToParentClicked()
3030 signal allNavigationClicked()
qml/Dash/PageHeader.qml → qml/Dash/DashPageHeader.qmlrenamed+12−16
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.Themes.Ambiance 1.1
20−import Ubuntu.Components.Popups 1.0
21−import Ubuntu.Components.ListItems 1.0
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.Themes.Ambiance 1.3
20+import Ubuntu.Components.Popups 1.3
21+import Ubuntu.Components.ListItems 1.3
2222import "../Components"
2323import "../Components/SearchHistoryModel"
2424
@@ -136,7 +136,7 @@ Item {
136136 objectName: "headerContainer"
137137 clip: contentY < height
138138 anchors { left: parent.left; top: parent.top; right: parent.right }
139− height: units.gu(7)
139+ height: header.contentHeight
140140 contentHeight: headersColumn.height
141141 interactive: false
142142 contentY: showSearch ? 0 : height
@@ -171,18 +171,15 @@ Item {
171171 PageHeadStyle {
172172 id: searchHeader
173173 anchors { left: parent.left; right: parent.right }
174− height: headerContainer.height
175− contentHeight: height
176174 opacity: headerContainer.clip || headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
177175 __separator_visible: false
178176 // Required to keep PageHeadStyle noise down as it expects the Page's properties around.
179177 property var styledItem: searchHeader
180− property string title
181178 property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections
182179 property color panelColor: background.topColor
183180 panelForegroundColor: config.foregroundColor
184− property var config: PageHeadConfiguration {
185− foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : Theme.palette.normal.baseText
181+ config: PageHeadConfiguration {
182+ foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
186183 backAction: Action {
187184 iconName: "back"
188185 onTriggered: {
@@ -247,16 +244,15 @@ Item {
247244 objectName: "innerPageHeader"
248245 anchors { left: parent.left; right: parent.right }
249246 height: headerContainer.height
250− contentHeight: height
251247 opacity: headerContainer.clip || !headerContainer.showSearch ? 1 : 0 // setting visible false cause column to relayout
252248 __separator_visible: false
253249 property var styledItem: header
254− property string title: root.title
255250 property color dividerColor: "transparent" // Doesn't matter as we don't have PageHeadSections
256251 property color panelColor: background.topColor
257252 panelForegroundColor: config.foregroundColor
258− property var config: PageHeadConfiguration {
259− foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : Theme.palette.normal.baseText
253+ config: PageHeadConfiguration {
254+ title: root.title
255+ foregroundColor: root.scopeStyle ? root.scopeStyle.headerForeground : theme.palette.normal.baseText
260256 backAction: Action {
261257 iconName: backIsClose ? "close" : "back"
262258 visible: root.showBackButton
qml/Dash/DashRenderer.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Item {
2020 property real collapsedHeight
qml/Dash/GenericScopeView.qml+6−6
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Utils 0.1
2020import Unity 0.2
2121import Dash 0.1
@@ -573,7 +573,7 @@ FocusScope {
573573 }
574574 fontSize: "small"
575575 font.weight: Font.Bold
576− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
576+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
577577 }
578578 }
579579
@@ -610,7 +610,7 @@ FocusScope {
610610 width: categoryView.width
611611 height: section != "" ? units.gu(5) : 0
612612 text: section
613− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
613+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
614614 iconName: delegate && delegate.headerLink ? "go-next" : ""
615615 onClicked: {
616616 if (delegate.headerLink) scopeView.scope.performQuery(delegate.headerLink);
@@ -624,7 +624,7 @@ FocusScope {
624624 sourceComponent: scopeView.showPageHeader ? pageHeaderComponent : undefined
625625 Component {
626626 id: pageHeaderComponent
627− PageHeader {
627+ DashPageHeader {
628628 objectName: "scopePageHeader"
629629 width: parent.width
630630 title: scopeView.scope ? scopeView.scope.name : ""
@@ -731,7 +731,7 @@ FocusScope {
731731 }
732732 fontSize: "small"
733733 font.weight: Font.Bold
734− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
734+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
735735 }
736736
737737 Connections {
qml/Dash/PreviewListView.qml+3−3
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Unity 0.2
2020import "../Components"
2121import "Previews" as Previews
@@ -43,7 +43,7 @@ Item {
4343
4444 signal backClicked()
4545
46− PageHeader {
46+ DashPageHeader {
4747 id: header
4848 objectName: "pageHeader"
4949 width: parent.width
qml/Dash/Previews/Preview.qml+13−20
@@ -14,8 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import "../../Components"
1920
2021/*! \brief This component constructs the Preview UI.
2122 *
@@ -72,18 +73,10 @@ Item {
7273 }
7374 width: row.columnWidth
7475 spacing: row.spacing
75− bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
76− property var makeSureVisibleItem
77− property real previousVisibleHeight: 0
78− property real visibleHeight: height - bottomMargin
79− onVisibleHeightChanged: {
80− if (makeSureVisibleItem && makeSureVisibleItem.activeFocus && previousVisibleHeight > visibleHeight) {
81− var textAreaPos = makeSureVisibleItem.mapToItem(column, 0, 0);
82− if (textAreaPos.y + makeSureVisibleItem.height > column.visibleHeight) {
83− column.contentY += textAreaPos.y + makeSureVisibleItem.height - column.visibleHeight
84− }
85− }
86− previousVisibleHeight = visibleHeight;
76+
77+ ListViewOSKScroller {
78+ id: oskScroller
79+ list: column
8780 }
8881
8982 model: columnModel
@@ -100,17 +93,17 @@ Item {
10093 anchors {
10194 left: parent.left
10295 right: parent.right
103− leftMargin: units.gu(1)
104− rightMargin: units.gu(1)
96+ leftMargin: widgetMargins
97+ rightMargin: widgetMargins
10598 }
10699
107100 onTriggered: {
108101 previewModel.triggered(widgetId, actionId, data);
109102 }
110− onMakeSureVisible: {
111− column.previousVisibleHeight=column.visibleHeight
112− column.makeSureVisibleItem=item
113− }
103+
104+ onMakeSureVisible: {
105+ oskScroller.setMakeSureVisibleItem(item);
106+ }
114107
115108 onFocusChanged: if (focus) column.positionViewAtIndex(index, ListView.Contain)
116109
qml/Dash/Previews/PreviewActionButton.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Button {
2121 signal triggeredAction(var actionData)
qml/Dash/Previews/PreviewActionCombo.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: root
@@ -33,7 +33,7 @@ Item {
3333
3434 objectName: "moreLessButton"
3535 text: !expanded ? i18n.tr("More...") : i18n.tr("Less...")
36− strokeColor: Theme.palette.normal.baseText
36+ strokeColor: theme.palette.normal.baseText
3737 onClicked: expanded = !expanded
3838 width: parent.width
3939 }
qml/Dash/Previews/PreviewActions.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020/*! This preview widget shows either one button, two buttons or one button
2121 * and a combo button depending on the number of items in widgetData["actions"].
@@ -50,7 +50,7 @@ PreviewWidget {
5050 Binding {
5151 target: loader.item
5252 property: "strokeColor"
53− value: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
53+ value: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
5454 }
5555 Connections {
5656 target: loader.item
qml/Dash/Previews/PreviewAudioPlayback.qml+7−7
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtMultimedia 5.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020
2121/*! \brief Preview widget for audio tracks.
2222
@@ -139,7 +139,7 @@ PreviewWidget {
139139 objectName: "trackTitleLabel"
140140 anchors { top: parent.top; left: parent.left; right: parent.right }
141141 opacity: 0.9
142− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
142+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
143143 fontSize: "small"
144144 horizontalAlignment: Text.AlignLeft
145145 text: modelData["title"]
@@ -152,7 +152,7 @@ PreviewWidget {
152152 anchors { top: trackTitleLabel.bottom; left: parent.left; right: parent.right }
153153 visible: text !== ""
154154 opacity: 0.9
155− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
155+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
156156 font.weight: Font.Light
157157 fontSize: "small"
158158 horizontalAlignment: Text.AlignLeft
@@ -175,7 +175,7 @@ PreviewWidget {
175175 }
176176 height: units.dp(2)
177177 visible: progressBarImage.visible
178− color: UbuntuColors.orange
178+ backgroundColor: UbuntuColors.orange
179179 }
180180
181181 Image {
@@ -193,7 +193,7 @@ PreviewWidget {
193193 anchors.verticalCenter: parent.verticalCenter
194194 width: parent.column3Width
195195 opacity: 0.9
196− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
196+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
197197 fontSize: "small"
198198 horizontalAlignment: Text.AlignRight
199199 text: audio.lengthToString(modelData["length"])
qml/Dash/Previews/PreviewComment.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.2
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020/*! \brief Preview widget for comments.
2121
qml/Dash/Previews/PreviewCommentInput.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121/*! \brief Preview widget for commenting.
qml/Dash/Previews/PreviewExpandable.qml+5−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121/*! \brief Preview widget for expandable widgets.
@@ -41,7 +41,7 @@ PreviewWidget {
4141 right: expandButton.left
4242 }
4343 fontSize: "large"
44− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
44+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
4545 visible: text !== ""
4646 opacity: .8
4747 text: widgetData["title"] || ""
@@ -62,7 +62,7 @@ PreviewWidget {
6262 width: units.gu(3)
6363 height: units.gu(3)
6464 name: root.expanded ? "view-collapse" : "view-expand"
65− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
65+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
6666 }
6767 }
6868
qml/Dash/Previews/PreviewHeader.qml+10−10
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Dash 0.1
2020import "../"
2121
@@ -40,10 +40,10 @@ PreviewWidget {
4040 readonly property string title: root.widgetData["title"] || ""
4141 readonly property string subtitle: root.widgetData["subtitle"] || ""
4242 readonly property var attributes: root.widgetData["attributes"] || null
43− readonly property color fontColor: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
43+ readonly property color fontColor: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
4444
4545 // Rewire the source since we may have unwired it on onStatusChanged
46− onMascotChanged: if (mascotShapeLoader.item) mascotShapeLoader.item.image.source = mascot;
46+ onMascotChanged: if (mascotShapeLoader.item) mascotShapeLoader.item.source.source = mascot;
4747
4848 implicitHeight: row.height + row.margins * 2
4949 width: parent.width
@@ -77,16 +77,16 @@ PreviewWidget {
7777
7878 sourceComponent: UbuntuShape {
7979 objectName: "mascotShape"
80− visible: image.status === Image.Ready
81− image: Image {
80+ visible: source.status === Image.Ready
81+ sourceFillMode: UbuntuShape.PreserveAspectCrop
82+ sourceHorizontalAlignment: UbuntuShape.AlignHCenter
83+ sourceVerticalAlignment: UbuntuShape.AlignVCenter
84+ source: Image {
8285 source: headerRoot.mascot
8386 width: source ? mascotShapeLoader.width : 0
8487 height: mascotShapeLoader.height
8588
8689 sourceSize { width: mascotShapeLoader.maxSize; height: mascotShapeLoader.maxSize }
87− fillMode: Image.PreserveAspectCrop
88− horizontalAlignment: Image.AlignHCenter
89− verticalAlignment: Image.AlignVCenter
9090 onStatusChanged: if (status === Image.Error) source = headerRoot.fallback;
9191 }
9292 }
qml/Dash/Previews/PreviewIconActions.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020/*! This preview widget icons+label for number of items in widgetData["actions"].
2121 * For each of the items we recognize the fields "label", "icon", "temporaryIcon" and "id".
qml/Dash/Previews/PreviewImageGallery.qml+3−3
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121/*! This preview widget shows a horizontal list of images.
@@ -62,7 +62,7 @@ PreviewWidget {
6262 source: modelData ? modelData : ""
6363 scaleTo: "height"
6464 initialWidth: units.gu(13)
65− borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
65+ pressed: mouseArea.pressed
6666
6767 MouseArea {
6868 id: mouseArea
qml/Dash/Previews/PreviewMediaToolbar.qmlnew file+36
@@ -0,0 +1,36 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import "../../Components"
20+
21+Rectangle {
22+ property alias shareData: sharingWidget.shareData
23+
24+ implicitHeight: units.gu(6)
25+ color: Qt.rgba(0, 0, 0, 0.8)
26+ visible: sharingWidget.visible
27+
28+ PreviewSharing {
29+ id: sharingWidget
30+ anchors {
31+ left: parent.left
32+ verticalCenter: parent.verticalCenter
33+ leftMargin: units.gu(1)
34+ }
35+ }
36+}
qml/Dash/Previews/PreviewOverlay.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121Rectangle {
@@ -158,7 +158,7 @@ Rectangle {
158158 anchors.centerIn: parent
159159 width: units.gu(2.5)
160160 height: width
161− color: Theme.palette.normal.foregroundText
161+ color: theme.palette.normal.foregroundText
162162 name: "close"
163163 }
164164 }
qml/Dash/Previews/PreviewPayments.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Payments 0.1
2020
2121/*! \brief Preview widget for a purchase button.
qml/Dash/Previews/PreviewProgress.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.DownloadDaemonListener 0.1
2020
2121/*! \brief Preview widget for a progress bar.
qml/Dash/Previews/PreviewRatingDisplay.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121/*! \brief Preview widget for rating display.
@@ -60,7 +60,7 @@ PreviewWidget {
6060 urlIconEmpty: widgetData["rating-icon-empty"]
6161 urlIconFull: widgetData["rating-icon-full"]
6262 urlIconHalf: widgetData["rating-icon-half"]
63− labelColor: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
63+ labelColor: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
6464 }
6565 }
6666 }
qml/Dash/Previews/PreviewRatingEdit.qml+2−2
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.4
18−import Ubuntu.Components 0.1
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121/*! \brief Preview widget for editable rating.
@@ -56,7 +56,7 @@ PreviewWidget {
5656 urlIconEmpty: widgetData["rating-icon-empty"]
5757 urlIconFull: widgetData["rating-icon-full"]
5858 urlIconHalf: widgetData["rating-icon-half"]
59− labelColor: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
59+ labelColor: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
6060 }
6161
6262 PreviewRatingInput {
qml/Dash/Previews/PreviewRatingInput.qml+6−6
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121/*! \brief Preview widget for rating.
@@ -79,7 +79,7 @@ PreviewWidget {
7979 verticalCenter: parent.verticalCenter
8080 left: parent.left
8181 }
82− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
82+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
8383 opacity: .8
8484 text: widgetData["rating-label"] || i18n.tr("Rate this")
8585 }
@@ -124,7 +124,7 @@ PreviewWidget {
124124 left: parent.left
125125 right: parent.right
126126 }
127− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
127+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
128128 opacity: .8
129129 text: widgetData["review-label"] || i18n.tr("Add a review")
130130 }
@@ -170,7 +170,7 @@ PreviewWidget {
170170 top: parent.top
171171 right: parent.right
172172 }
173− color: readyToSubmit ? Theme.palette.selected.base : Theme.palette.normal.base
173+ color: readyToSubmit ? theme.palette.selected.base : theme.palette.normal.base
174174 text: widgetData["submit-label"] || i18n.tr("Send")
175175 onClicked: {
176176 if (readyToSubmit) root.submit()
qml/Dash/Previews/PreviewRatingSingleDisplay.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717import QtQuick 2.4
18−import Ubuntu.Components 0.1
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121Column {
qml/Dash/Previews/PreviewSharing.qmlnew file+105
@@ -0,0 +1,105 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Content 1.1
20+
21+Item {
22+ id: root
23+ implicitHeight: button.height
24+ implicitWidth: button.width
25+
26+ property var shareData
27+ readonly property bool isUrlExternal: url && url.indexOf("file:///") != 0 && url.indexOf("/") != 0
28+ readonly property string contentType: shareData ? shareData["contentType"] : ""
29+ readonly property var url: shareData ? shareData["uri"] : ""
30+ readonly property Item rootItem: QuickUtils.rootItem(root)
31+
32+ visible: url != ""
33+
34+ AbstractButton {
35+ id: button
36+ height: units.gu(4)
37+ width: units.gu(4)
38+ onClicked: peerPicker.visible = true
39+
40+ Icon {
41+ anchors.centerIn: parent
42+ height: units.gu(3)
43+ width: units.gu(3)
44+ source: "image://theme/share"
45+ }
46+ }
47+
48+ Component {
49+ id: exportItemComponent
50+ ContentItem {
51+ name: i18n.tr("Preview Share Item")
52+ }
53+ }
54+
55+ Component {
56+ id: contentPeerComponent
57+ ContentPeerPicker {
58+ handler: ContentHandler.Share
59+ contentType: {
60+ // for now, treat all external urls as Links, or it will break contenthub
61+ if (root.isUrlExternal) return ContentType.Links;
62+
63+ switch(root.contentType) {
64+ case "all": return ContentType.All;
65+ case "contacts": return ContentType.Contacts;
66+ case "documents": return ContentType.Documents;
67+ case "links": return ContentType.Links;
68+ case "music": return ContentType.Music;
69+ case "pictures": return ContentType.Pictures;
70+ case "text": return ContentType.Text;
71+ default:
72+ case "unknown": return ContentType.Unknown;
73+ case "videos": return ContentType.Videos;
74+ }
75+ }
76+
77+ onPeerSelected: {
78+ var transfer = peer.request();
79+ if (transfer.state === ContentTransfer.InProgress) {
80+ var items = new Array();
81+ for (var i = 0; i < url.length; i++) {
82+ var exportItem = exportItemComponent.createObject();
83+ exportItem.url = url[i];
84+ items.push(exportItem);
85+ }
86+ transfer.items = items;
87+ transfer.state = ContentTransfer.Charged;
88+ }
89+ peerPicker.visible = false;
90+ }
91+ onCancelPressed: peerPicker.visible = false;
92+ }
93+ }
94+
95+ Loader {
96+ id: peerPicker
97+ objectName: "peerPicker"
98+ parent: rootItem
99+ anchors.fill: parent
100+ visible: false
101+ active: root.visible
102+
103+ sourceComponent: contentPeerComponent
104+ }
105+}
qml/Dash/Previews/PreviewTable.qml+5−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import "../../Components"
2121
2222/*! \brief Preview widget for table.
@@ -48,7 +48,7 @@ PreviewWidget {
4848 }
4949 height: visible ? implicitHeight : 0
5050 fontSize: "large"
51− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
51+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
5252 visible: text !== ""
5353 opacity: .8
5454 text: widgetData["title"] || ""
@@ -72,7 +72,7 @@ PreviewWidget {
7272 fontSize: "small"
7373 text: perRowRepeater.model[index]
7474 visible: root.expanded || rowIndex < maximumCollapsedRowCount
75− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
75+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
7676 font.bold: index == 0
7777 wrapMode: Text.Wrap
7878 Layout.alignment: Qt.AlignTop
qml/Dash/Previews/PreviewTextSummary.qml+5−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121/*! \brief Preview widget for text.
@@ -39,7 +39,7 @@ PreviewWidget {
3939 }
4040 height: visible ? implicitHeight : 0
4141 fontSize: "large"
42− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
42+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
4343 visible: text !== ""
4444 opacity: .8
4545 text: widgetData["title"] || ""
@@ -61,7 +61,7 @@ PreviewWidget {
6161 clip: true
6262 fontSize: "small"
6363 lineHeight: 1.2
64− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText
64+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText
6565 opacity: .8
6666 text: widgetData["text"] || ""
6767 wrapMode: Text.Wrap
qml/Dash/Previews/PreviewVideoPlayback.qml+15−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Thumbnailer 0.1
2020import "../../Components"
2121
@@ -30,6 +30,8 @@ PreviewWidget {
3030 implicitWidth: units.gu(35)
3131 implicitHeight: childrenRect.height
3232
33+ widgetMargins: -units.gu(1)
34+
3335 LazyImage {
3436 objectName: "screenshot"
3537 anchors {
@@ -51,6 +53,7 @@ PreviewWidget {
5153 return "";
5254 }
5355 initialHeight: width * 10 / 16
56+ useUbuntuShape: false
5457
5558 Image {
5659 objectName: "playButton"
@@ -70,5 +73,15 @@ PreviewWidget {
7073 anchors.fill: parent
7174 onClicked: Qt.openUrlExternally(widgetData["source"])
7275 }
76+
77+ PreviewMediaToolbar {
78+ id: toolbar
79+ anchors {
80+ left: parent.left
81+ right: parent.right
82+ bottom: parent.bottom
83+ }
84+ shareData: widgetData["shareData"]
85+ }
7386 }
7487}
qml/Dash/Previews/PreviewWidget.qml+4−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919/*! Interface for preview widgets. */
2020
@@ -34,6 +34,9 @@ Item {
3434 //! Should the widget show in expanded mode (For those that support it)
3535 property bool expanded: true
3636
37+ //! Set margins width.
38+ property real widgetMargins: units.gu(1)
39+
3740 /*! \brief This signal should be emitted when a preview action was triggered.
3841 *
3942 * \param widgetId, actionId Respective identifiers from widgetData.
qml/Dash/Previews/PreviewWidgetFactory.qml+4−1
@@ -15,7 +15,7 @@
1515 *
1616 */
1717
18−import QtQuick 2.0
18+import QtQuick 2.4
1919
2020//! \brief This component loads the widgets based on widgetData["type"].
2121
@@ -40,6 +40,9 @@ Loader {
4040 //! Set to true if the parent preview is displayed.
4141 property bool isCurrentPreview: false
4242
43+ //! Set margins width.
44+ property real widgetMargins: status === Loader.Ready ? item.widgetMargins : units.gu(1)
45+
4346 //! Triggered signal forwarded from the widgets.
4447 signal triggered(string widgetId, string actionId, var data)
4548
qml/Dash/Previews/PreviewZoomableImage.qml+21−9
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../Components"
2020
2121/*! \brief Preview widget for image.
@@ -27,7 +27,10 @@ import "../../Components"
2727
2828PreviewWidget {
2929 id: root
30− implicitHeight: units.gu(22)
30+ implicitWidth: units.gu(35)
31+ implicitHeight: lazyImage.height
32+
33+ widgetMargins: -units.gu(1)
3134
3235 property Item rootItem: QuickUtils.rootItem(root)
3336
@@ -35,15 +38,14 @@ PreviewWidget {
3538 id: lazyImage
3639 objectName: "lazyImage"
3740 anchors {
38− top: parent.top
39− bottom: parent.bottom
40− horizontalCenter: parent.horizontalCenter
41+ left: parent.left
42+ right: parent.right
4143 }
42− scaleTo: "height"
44+ scaleTo: "width"
4345 source: widgetData["source"]
4446 asynchronous: true
45−
46− borderSource: mouseArea.pressed ? "radius_pressed.sci" : "radius_idle.sci"
47+ useUbuntuShape: false
48+ pressed: mouseArea.pressed
4749
4850 MouseArea {
4951 id: mouseArea
@@ -62,6 +64,16 @@ PreviewWidget {
6264 // But at the moment the model never changes
6365 onStatusChanged: if (lazyImage.sourceImage.status === Image.Error) lazyImage.sourceImage.source = widgetData["fallback"];
6466 }
67+
68+ PreviewMediaToolbar {
69+ id: toolbar
70+ anchors {
71+ left: parent.left
72+ right: parent.right
73+ bottom: parent.bottom
74+ }
75+ shareData: widgetData["shareData"]
76+ }
6577 }
6678
6779 PreviewOverlay {
qml/Dash/PullToRefreshScopeStyle.qml+3−3
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.Styles 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.Styles 1.3
2020
2121/**
2222 * TODO: Once the SDK version of PullToRefreshStyle doesn't have bug 1375799
qml/Dash/ScopeListView.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020ListViewWithPageHeader {
qml/Dash/ScopeSettings/ScopeSetting.qml+11−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020/*! Interface for settings widgets. */
2121
@@ -32,6 +32,15 @@ Item {
3232 */
3333 signal updated(var value)
3434
35+ /*! \brief This signal should be emitted when widget gains the focus
36+ * and input method popups.
37+ * And preview widget should reposition in visible area to avoid
38+ * keyboard appears over the widget.
39+ *
40+ * \param item, id of specified item which is needed to reposition.
41+ */
42+ signal makeSureVisible(var item)
43+
3544 //! \internal
3645 readonly property real settingMargins: units.gu(2)
3746}
qml/Dash/ScopeSettings/ScopeSettingBoolean.qml+5−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.ListItems 1.0 as ListItem
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3 as ListItem
2020
2121ScopeSetting {
2222 id: root
@@ -44,7 +44,7 @@ ScopeSetting {
4444 elide: Text.ElideMiddle
4545 maximumLineCount: 2
4646 wrapMode: Text.Wrap
47− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
47+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
4848 }
4949
5050 CheckBox {
qml/Dash/ScopeSettings/ScopeSettingList.qml+3−3
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.ListItems 1.0 as ListItem
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3 as ListItem
2020
2121ScopeSetting {
2222 id: root
qml/Dash/ScopeSettings/ScopeSettingNumber.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818
1919ScopeSettingString {
2020 mode: "number"
qml/Dash/ScopeSettings/ScopeSettingString.qml+12−6
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.ListItems 1.0 as ListItem
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3 as ListItem
2020
2121ScopeSetting {
2222 id: root
@@ -44,7 +44,7 @@ ScopeSetting {
4444 elide: Text.ElideMiddle
4545 maximumLineCount: 2
4646 wrapMode: Text.Wrap
47− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
47+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
4848 }
4949
5050 TextField {
@@ -57,7 +57,7 @@ ScopeSetting {
5757 }
5858 width: root.mode == "number" ? units.gu(8) : units.gu(12)
5959 text: widgetData.value
60− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.fieldText
60+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.fieldText
6161 validator: root.mode == "number" ? doubleValidator : null
6262 hasClearButton: root.mode == "number" ? false : true
6363
@@ -78,6 +78,12 @@ ScopeSetting {
7878 updateText();
7979 }
8080 }
81+
82+ readonly property bool inputMethodVisible: Qt.inputMethod.visible
83+ onInputMethodVisibleChanged: {
84+ if(inputMethodVisible && activeFocus)
85+ root.makeSureVisible(control);
86+ }
8187 }
8288 }
8389}
qml/Dash/ScopeSettings/ScopeSettingsWidgetFactory.qml+5−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818
1919//! \brief This component loads the widgets based on type.
2020
@@ -30,6 +30,9 @@ Loader {
3030 //! Triggered signal forwarded from the widgets.
3131 signal updated(var value)
3232
33+ //! makeSureVisible signal forwarded from the widgets.
34+ signal makeSureVisible(var item)
35+
3336 source: widgetSource
3437
3538 //! \cond private
@@ -53,5 +56,6 @@ Loader {
5356 Connections {
5457 target: root.item
5558 onUpdated: if (value !== widgetData.value) root.updated(value)
59+ onMakeSureVisible: root.makeSureVisible(item)
5660 }
5761}
qml/Dash/ScopeSettingsPage.qml+12−3
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Unity 0.2
2020import "../Components"
2121import "ScopeSettings"
@@ -28,7 +28,7 @@ Item {
2828
2929 signal backClicked()
3030
31− PageHeader {
31+ DashPageHeader {
3232 id: header
3333 objectName: "pageHeader"
3434 width: parent.width
@@ -51,6 +51,11 @@ Item {
5151 model: root.scope ? root.scope.settings : null
5252 clip: true
5353
54+ ListViewOSKScroller {
55+ id: oskScroller
56+ list: scopeSettings
57+ }
58+
5459 delegate: ScopeSettingsWidgetFactory {
5560 objectName: "scopeSettingItem" + index
5661 width: root.width
@@ -58,6 +63,10 @@ Item {
5863 scopeStyle: root.scopeStyle
5964
6065 onUpdated: model.value = value;
66+
67+ onMakeSureVisible: { // var item
68+ oskScroller.setMakeSureVisibleItem(item);
69+ }
6170 }
6271 }
6372}
qml/Dash/ScopesList.qml+2−2
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Item {
@@ -61,7 +61,7 @@ Item {
6161 value: root.scope ? root.scope.searchQuery : ""
6262 }
6363
64− PageHeader {
64+ DashPageHeader {
6565 id: header
6666 objectName: "pageHeader"
6767 title: i18n.tr("Manage")
qml/Dash/ScopesListCategory.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Dash 0.1
2020import "../Components/ListItems" as ListItems
2121
@@ -43,7 +43,7 @@ Item {
4343 id: header
4444 width: root.width
4545 height: units.gu(5)
46− color: scopeStyle ? scopeStyle.foreground : Theme.palette.normal.baseText
46+ color: scopeStyle ? scopeStyle.foreground : theme.palette.normal.baseText
4747 }
4848
4949 readonly property double listItemHeight: units.gu(6)
qml/Dash/ScopesListCategoryItem.qml+4−4
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020
2121MouseArea {
2222 id: root
@@ -49,10 +49,10 @@ MouseArea {
4949 width: units.gu(5)
5050 height: units.gu(5)
5151 visible: !hideChildren
52− image: Image {
52+ sourceFillMode: UbuntuShape.PreserveAspectCrop
53+ source: Image {
5354 id: shapeImage
5455 cache: true
55− fillMode: Image.PreserveAspectCrop
5656 sourceSize { width: shape.width; height: shape.height }
5757 }
5858 }
qml/DeviceConfiguration.qml+87−65
@@ -14,81 +14,103 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
19−StateGroup {
19+QtObject {
2020 id: root
2121
2222 readonly property int useNativeOrientation: -1
2323
24− property int primaryOrientation: useNativeOrientation
24+ // The only writable property in the API
25+ // all other properties are set according to the device name
26+ property alias name: priv.state
2527
26− property int supportedOrientations: Qt.PortraitOrientation
27− | Qt.InvertedPortraitOrientation
28− | Qt.LandscapeOrientation
29− | Qt.InvertedLandscapeOrientation
28+ readonly property alias primaryOrientation: priv.primaryOrientation
29+ readonly property alias supportedOrientations: priv.supportedOrientations
30+ readonly property alias landscapeOrientation: priv.landscapeOrientation
31+ readonly property alias invertedLandscapeOrientation: priv.invertedLandscapeOrientation
32+ readonly property alias portraitOrientation: priv.portraitOrientation
33+ readonly property alias invertedPortraitOrientation: priv.invertedPortraitOrientation
3034
31− // Supported values so far:
32− // "phone", "tablet" or "desktop"
33− property string category: "phone"
35+ readonly property alias category: priv.category
3436
35− property int ignoredMice: 0
37+ readonly property alias ignoredMice: priv.ignoredMice
3638
39+ readonly property var priv: StateGroup {
40+ id: priv
3741
38− property alias name: root.state
42+ property int primaryOrientation: root.useNativeOrientation
3943
40− states: [
41− State {
42− name: "mako"
43− PropertyChanges {
44− target: root
45− supportedOrientations: Qt.PortraitOrientation
46− | Qt.LandscapeOrientation
47− | Qt.InvertedLandscapeOrientation
48− }
49− },
50− State {
51− name: "krillin"
52− PropertyChanges {
53− target: root
54− supportedOrientations: Qt.PortraitOrientation
55− | Qt.LandscapeOrientation
56− | Qt.InvertedLandscapeOrientation
57− }
58− },
59− State {
60− name: "arale"
61− PropertyChanges {
62− target: root
63− supportedOrientations: Qt.PortraitOrientation
64− | Qt.LandscapeOrientation
65− | Qt.InvertedLandscapeOrientation
66− ignoredMice: 1
67− }
68− },
69− State {
70− name: "manta"
71− PropertyChanges {
72− target: root
73− category: "tablet"
74− }
75− },
76− State {
77− name: "flo"
78− PropertyChanges {
79− target: root
80− primaryOrientation: Qt.InvertedLandscapeOrientation
81− category: "tablet"
82− }
83− },
84− State {
85− name: "desktop"
86− PropertyChanges {
87− target: root
88− category: "desktop"
89− supportedOrientations: root.useNativeOrientation
90− }
91− }
92− ]
44+ property int supportedOrientations: Qt.PortraitOrientation
45+ | Qt.InvertedPortraitOrientation
46+ | Qt.LandscapeOrientation
47+ | Qt.InvertedLandscapeOrientation
48+
49+ property int landscapeOrientation: Qt.LandscapeOrientation
50+ property int invertedLandscapeOrientation: Qt.InvertedLandscapeOrientation
51+ property int portraitOrientation: Qt.PortraitOrientation
52+ property int invertedPortraitOrientation: Qt.InvertedPortraitOrientation
53+
54+ // Supported values so far:
55+ // "phone", "tablet" or "desktop"
56+ property string category: "phone"
9357
58+ property int ignoredMice: 0
59+
60+ states: [
61+ State {
62+ name: "mako"
63+ PropertyChanges {
64+ target: priv
65+ supportedOrientations: Qt.PortraitOrientation
66+ | Qt.LandscapeOrientation
67+ | Qt.InvertedLandscapeOrientation
68+ }
69+ },
70+ State {
71+ name: "krillin"
72+ PropertyChanges {
73+ target: priv
74+ supportedOrientations: Qt.PortraitOrientation
75+ | Qt.LandscapeOrientation
76+ | Qt.InvertedLandscapeOrientation
77+ }
78+ },
79+ State {
80+ name: "arale"
81+ PropertyChanges {
82+ target: priv
83+ supportedOrientations: Qt.PortraitOrientation
84+ | Qt.LandscapeOrientation
85+ | Qt.InvertedLandscapeOrientation
86+ ignoredMice: 1
87+ }
88+ },
89+ State {
90+ name: "manta"
91+ PropertyChanges {
92+ target: priv
93+ category: "tablet"
94+ }
95+ },
96+ State {
97+ name: "flo"
98+ PropertyChanges {
99+ target: priv
100+ landscapeOrientation: Qt.InvertedLandscapeOrientation
101+ invertedLandscapeOrientation: Qt.LandscapeOrientation
102+ primaryOrientation: Qt.InvertedLandscapeOrientation
103+ category: "tablet"
104+ }
105+ },
106+ State {
107+ name: "desktop"
108+ PropertyChanges {
109+ target: priv
110+ category: "desktop"
111+ supportedOrientations: root.useNativeOrientation
112+ }
113+ }
114+ ]
115+ }
94116}
qml/Greeter/Clock.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Panel/Indicators"
2020import Unity.Indicators 0.1 as Indicators
2121
qml/Greeter/CoverPage.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import "../Components"
2121
qml/Greeter/Dot.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Image {
2020 states: [
qml/Greeter/Greeter.qml+2−2
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import AccountsService 0.1
1919import GSettings 1.0
20−import Ubuntu.Components 1.1
20+import Ubuntu.Components 1.3
2121import Ubuntu.SystemImage 0.1
2222import Unity.Launcher 0.1
2323import "." 0.1
qml/Greeter/Infographics.qml+2−2
@@ -16,8 +16,8 @@
1616
1717import "../Components"
1818import "Gradient.js" as Gradient
19−import QtQuick 2.0
20−import Ubuntu.Components 0.1
19+import QtQuick 2.4
20+import Ubuntu.Components 1.3
2121
2222Item {
2323 id: infographic
qml/Greeter/IntegratedLightDMImpl.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import LightDM.IntegratedLightDM 0.1 as LightDM
17+import QtQuick 2.4
18+import IntegratedLightDM 0.1 as LightDM
1919
2020Item{
2121 id: implementation
qml/Greeter/LightDMService.qml+1−1
@@ -20,7 +20,7 @@
2020 */
2121
2222pragma Singleton
23−import QtQuick 2.3
23+import QtQuick 2.4
2424
2525Loader {
2626 id: loader
qml/Greeter/LoginList.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121Item {
qml/Greeter/NarrowView.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121FocusScope {
qml/Greeter/ObjectPositioner.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 property int count
qml/Greeter/ShimGreeter.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818
1919/*
2020 * This is a shim greeter that is only used to provide a shell,
qml/Greeter/WideView.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020FocusScope {
2121 id: root
qml/Launcher/FoldingLauncherDelegate.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020LauncherDelegate {
2121 id: root
qml/Launcher/Launcher.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import "../Components"
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Ubuntu.Gestures 0.1
2121import Unity.Launcher 0.1
2222
qml/Launcher/LauncherDelegate.qml+7−8
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: root
@@ -130,13 +130,12 @@ Item {
130130 anchors.fill: parent
131131 anchors.margins: units.gu(1)
132132 radius: "medium"
133− borderSource: "none"
134−
135− image: Image {
133+ aspect: UbuntuShape.Flat
134+ sourceFillMode: UbuntuShape.PreserveAspectCrop
135+ source: Image {
136136 id: iconImage
137137 sourceSize.width: iconShape.width
138138 sourceSize.height: iconShape.height
139− fillMode: Image.PreserveAspectCrop
140139 source: root.iconName
141140 }
142141 }
@@ -159,9 +158,9 @@ Item {
159158 }
160159 width: Math.min(root.itemWidth, Math.max(units.gu(2), countLabel.implicitWidth + units.gu(1)))
161160 height: units.gu(2)
162− color: UbuntuColors.orange
161+ backgroundColor: UbuntuColors.orange
163162 visible: root.countVisible
164− borderSource: "none"
163+ aspect: UbuntuShape.Flat
165164
166165 Label {
167166 id: countLabel
qml/Launcher/LauncherPanel.qml+6−6
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.2
19−import Ubuntu.Components.ListItems 1.0 as ListItems
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3 as ListItems
2020import Unity.Launcher 0.1
21−import Ubuntu.Components.Popups 0.1
21+import Ubuntu.Components.Popups 1.3
2222import "../Components/ListItems"
2323import "../Components/"
2424
@@ -61,8 +61,8 @@ Rectangle {
6161 fill: parent
6262 topMargin: -units.gu(2)
6363 }
64− borderSource: "none"
65− color: UbuntuColors.orange
64+ aspect: UbuntuShape.Flat
65+ backgroundColor: UbuntuColors.orange
6666 }
6767
6868 Image {
qml/Notifications/Notification.qml+14−15
@@ -14,14 +14,14 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import QtMultimedia 5.0
17+import QtQuick 2.4
1918import Powerd 0.1
20−import Ubuntu.Components 1.2
19+import Ubuntu.Components 1.3
20+import Ubuntu.Components.ListItems 1.3 as ListItem
2121import Unity.Notifications 1.0
2222import QMenuModel 0.1
2323import Utils 0.1
24−import Ubuntu.Components.ListItems 0.1 as ListItem
24+import "../Components"
2525
2626Item {
2727 id: notification
@@ -80,10 +80,9 @@ Item {
8080 return result;
8181 }
8282
83− Audio {
83+ NotificationAudio {
8484 id: sound
8585 objectName: "sound"
86− audioRole: MediaPlayer.alert
8786 source: hints["suppress-sound"] !== "true" && hints["sound-file"] !== undefined ? hints["sound-file"] : ""
8887 }
8988
@@ -153,10 +152,10 @@ Item {
153152 rightMargin: notification.margins
154153 topMargin: type === Notification.Confirmation ? units.gu(.5) : 0
155154 }
156− color: parent.color
155+ backgroundColor: parent.color
157156 opacity: parent.opacity
158157 radius: "medium"
159− borderSource: "none"
158+ aspect: UbuntuShape.Flat
160159 }
161160
162161 Rectangle {
@@ -282,7 +281,7 @@ Item {
282281 }
283282 visible: type !== Notification.Confirmation
284283 fontSize: "medium"
285− color: darkOnBright ? sdFontColor : Theme.palette.selected.backgroundText
284+ color: darkOnBright ? sdFontColor : theme.palette.selected.backgroundText
286285 elide: Text.ElideRight
287286 textFormat: Text.PlainText
288287 }
@@ -297,7 +296,7 @@ Item {
297296 }
298297 visible: body != "" && type !== Notification.Confirmation
299298 fontSize: "small"
300− color: darkOnBright ? sdFontColor : Theme.palette.selected.backgroundText
299+ color: darkOnBright ? sdFontColor : theme.palette.selected.backgroundText
301300 wrapMode: Text.WordWrap
302301 maximumLineCount: type == Notification.SnapDecision ? 12 : 2
303302 elide: Text.ElideRight
@@ -338,7 +337,7 @@ Item {
338337 anchors.horizontalCenter: parent.horizontalCenter
339338 visible: type === Notification.Confirmation && body !== ""
340339 fontSize: "medium"
341− color: darkOnBright ? sdFontColor : Theme.palette.selected.backgroundText
340+ color: darkOnBright ? sdFontColor : theme.palette.selected.backgroundText
342341 wrapMode: Text.WordWrap
343342 maximumLineCount: 1
344343 elide: Text.ElideRight
@@ -358,8 +357,8 @@ Item {
358357 }
359358
360359 height: units.gu(1)
361− color: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
362− borderSource: "none"
360+ backgroundColor: darkOnBright ? UbuntuColors.darkGrey : UbuntuColors.lightGrey
361+ aspect: UbuntuShape.Flat
363362 radius: "small"
364363
365364 UbuntuShape {
@@ -367,8 +366,8 @@ Item {
367366 objectName: "innerBar"
368367 width: valueIndicator.width * valueIndicator.value / 100
369368 height: units.gu(1)
370− color: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
371− borderSource: "none"
369+ backgroundColor: notification.hints["x-canonical-value-bar-tint"] === "true" ? UbuntuColors.orange : darkOnBright ? UbuntuColors.lightGrey : "white"
370+ aspect: UbuntuShape.Flat
372371 radius: "small"
373372 }
374373 }
qml/Notifications/NotificationMenuItemFactory.qml+2−2
@@ -17,8 +17,8 @@
1717 * Nick Dedekind <nick.dedekind@canonical.com>
1818 */
1919
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
20+import QtQuick 2.4
21+import Ubuntu.Components 1.3
2222import QMenuModel 0.1
2323import "../Components"
2424
qml/Notifications/Notifications.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Unity.Notifications 1.0 as UnityNotifications
2020import Utils 0.1
2121import "../Components"
qml/Notifications/OptionToggle.qml+7−7
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−import Ubuntu.Components.ListItems 0.1 as ListItem
20−import Ubuntu.Components.Popups 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3 as ListItem
20+import Ubuntu.Components.Popups 1.3
2121
2222UbuntuShape {
2323 id: optionToggle
@@ -29,8 +29,8 @@ UbuntuShape {
2929
3030 signal triggered(string id)
3131
32− color: Theme.palette.normal.base
33− borderSource: "none"
32+ backgroundColor: theme.palette.normal.base
33+ aspect: UbuntuShape.Flat
3434 height: expanded ? (optionToggleRepeater.count - startIndex) * itemHeight : itemHeight
3535 width: parent.width
3636 radius: "medium"
qml/Notifications/ShapedIcon.qml+3−3
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.2
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 property string fileSource
qml/Notifications/SwipeToAct.qml+10−10
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.2
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: swipeToAct
@@ -98,8 +98,8 @@ Item {
9898 id: row
9999 width: parent.width
100100 height: priv.sliderHeight
101− color: priv.sliderBGColor
102− borderSource: "none"
101+ backgroundColor: priv.sliderBGColor
102+ aspect: UbuntuShape.Flat
103103 visible: !clickToAct
104104
105105 UbuntuShape {
@@ -108,8 +108,8 @@ Item {
108108 anchors.top: parent.top
109109 anchors.left: parent.left
110110 anchors.margins: priv.gap
111− color: UbuntuColors.red
112− borderSource: "none"
111+ backgroundColor: UbuntuColors.red
112+ aspect: UbuntuShape.Flat
113113
114114 state: "normal"
115115 height: units.gu(6)
@@ -187,10 +187,10 @@ Item {
187187 }
188188
189189 z: 1
190− color: priv.sliderMainColor
190+ backgroundColor: priv.sliderMainColor
191191 height: units.gu(6)
192192 width: units.gu(6)
193− borderSource: "none"
193+ aspect: UbuntuShape.Flat
194194 radius: "medium"
195195 Icon {
196196 anchors.fill: parent
@@ -226,8 +226,8 @@ Item {
226226 anchors.top: parent.top
227227 anchors.right: parent.right
228228 anchors.margins: priv.gap
229− color: UbuntuColors.green
230− borderSource: "none"
229+ backgroundColor: UbuntuColors.green
230+ aspect: UbuntuShape.Flat
231231
232232 state: "normal"
233233 height: units.gu(6)
qml/OrientedShell.qml+37−27
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import QtQuick.Window 2.0
17+import QtQuick 2.4
18+import QtQuick.Window 2.2
1919import Unity.Session 0.1
2020import GSettings 1.0
2121import "Components"
@@ -23,7 +23,7 @@ import "Components/UnityInputInfo"
2323import "Rotation"
2424// Backup Workaround https://bugs.launchpad.net/ubuntu/+source/unity8/+bug/1473471
2525// in case we remove the UnityInputInfo import
26−import Ubuntu.Components 1.2
26+import Ubuntu.Components 1.3
2727
2828Rectangle {
2929 id: root
@@ -32,20 +32,31 @@ Rectangle {
3232 implicitWidth: units.gu(40)
3333 implicitHeight: units.gu(71)
3434
35− // NB: native and primary orientations here don't map exactly to their QScreen counterparts
36− readonly property int nativeOrientation: width > height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
37−
38− readonly property int primaryOrientation:
39− deviceConfiguration.primaryOrientation == deviceConfiguration.useNativeOrientation
40− ? nativeOrientation : deviceConfiguration.primaryOrientation
41−
4235 DeviceConfiguration {
4336 id: deviceConfiguration
4437 name: applicationArguments.deviceName
4538 }
4639
40+ property alias orientations: d.orientations
41+
42+ Item {
43+ id: d
44+
45+ property Orientations orientations: Orientations {
46+ id: orientations
47+ // NB: native and primary orientations here don't map exactly to their QScreen counterparts
48+ native_: root.width > root.height ? Qt.LandscapeOrientation : Qt.PortraitOrientation
4749
48− // to be overwritten by tests
50+ primary: deviceConfiguration.primaryOrientation == deviceConfiguration.useNativeOrientation
51+ ? native_ : deviceConfiguration.primaryOrientation
52+
53+ landscape: deviceConfiguration.landscapeOrientation
54+ invertedLandscape: deviceConfiguration.invertedLandscapeOrientation
55+ portrait: deviceConfiguration.portraitOrientation
56+ invertedPortrait: deviceConfiguration.invertedPortraitOrientation
57+ }
58+ }
59+ // to be overwritten by tests
4960 property var unity8Settings: Unity8Settings {}
5061 property var oskSettings: GSettings { schema.id: "com.canonical.keyboard.maliit" }
5162
@@ -78,8 +89,8 @@ Rectangle {
7889
7990 // we must rotate to a supported orientation regardless of shell's preference
8091 property bool orientationChangesEnabled:
81− (orientation & supportedOrientations) === 0 ? true
82− : shell.orientationChangesEnabled
92+ (shell.orientation & supportedOrientations) === 0 ? true
93+ : shell.orientationChangesEnabled
8394
8495
8596 Binding {
@@ -96,12 +107,12 @@ Rectangle {
96107
97108 readonly property int supportedOrientations: shell.supportedOrientations
98109 & (deviceConfiguration.supportedOrientations == deviceConfiguration.useNativeOrientation
99− ? nativeOrientation
110+ ? orientations.native_
100111 : deviceConfiguration.supportedOrientations)
101112
102113 property int acceptedOrientationAngle: {
103114 if (orientation & supportedOrientations) {
104− return Screen.angleBetween(nativeOrientation, orientation);
115+ return Screen.angleBetween(orientations.native_, orientation);
105116 } else if (shell.orientation & supportedOrientations) {
106117 // stay where we are
107118 return shell.orientationAngle;
@@ -111,16 +122,16 @@ Rectangle {
111122 // rotate to some supported orientation as we can't stay where we currently are
112123 // TODO: Choose the closest to the current one
113124 if (supportedOrientations & Qt.PortraitOrientation) {
114− return Screen.angleBetween(nativeOrientation, Qt.PortraitOrientation);
125+ return Screen.angleBetween(orientations.native_, Qt.PortraitOrientation);
115126 } else if (supportedOrientations & Qt.LandscapeOrientation) {
116− return Screen.angleBetween(nativeOrientation, Qt.LandscapeOrientation);
127+ return Screen.angleBetween(orientations.native_, Qt.LandscapeOrientation);
117128 } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
118− return Screen.angleBetween(nativeOrientation, Qt.InvertedPortraitOrientation);
129+ return Screen.angleBetween(orientations.native_, Qt.InvertedPortraitOrientation);
119130 } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
120− return Screen.angleBetween(nativeOrientation, Qt.InvertedLandscapeOrientation);
131+ return Screen.angleBetween(orientations.native_, Qt.InvertedLandscapeOrientation);
121132 } else {
122133 // if all fails, fallback to primary orientation
123− return Screen.angleBetween(nativeOrientation, primaryOrientation);
134+ return Screen.angleBetween(orientations.native_, orientations.primary);
124135 }
125136 }
126137 }
@@ -128,19 +139,19 @@ Rectangle {
128139 function angleToOrientation(angle) {
129140 switch (angle) {
130141 case 0:
131− return nativeOrientation;
142+ return orientations.native_;
132143 case 90:
133− return nativeOrientation === Qt.PortraitOrientation ? Qt.InvertedLandscapeOrientation
144+ return orientations.native_ === Qt.PortraitOrientation ? Qt.InvertedLandscapeOrientation
134145 : Qt.PortraitOrientation;
135146 case 180:
136− return nativeOrientation === Qt.PortraitOrientation ? Qt.InvertedPortraitOrientation
147+ return orientations.native_ === Qt.PortraitOrientation ? Qt.InvertedPortraitOrientation
137148 : Qt.InvertedLandscapeOrientation;
138149 case 270:
139− return nativeOrientation === Qt.PortraitOrientation ? Qt.LandscapeOrientation
150+ return orientations.native_ === Qt.PortraitOrientation ? Qt.LandscapeOrientation
140151 : Qt.InvertedPortraitOrientation;
141152 default:
142153 console.warn("angleToOrientation: Invalid orientation angle: " + angle);
143− return primaryOrientation;
154+ return orientations.primary;
144155 }
145156 }
146157
@@ -159,8 +170,7 @@ Rectangle {
159170 width: root.width
160171 height: root.height
161172 orientation: root.angleToOrientation(orientationAngle)
162− primaryOrientation: root.primaryOrientation
163− nativeOrientation: root.nativeOrientation
173+ orientations: root.orientations
164174 nativeWidth: root.width
165175 nativeHeight: root.height
166176 mode: applicationArguments.mode
qml/Panel/ActiveCallHint.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Ubuntu.Telephony 0.1 as Telephony
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Unity.Application 0.1
2121import "../Components"
2222
qml/Panel/Handle.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Rectangle {
2121 id: handle
qml/Panel/IndicatorItem.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Settings.Components 0.1
2020import "Indicators"
2121
qml/Panel/IndicatorItemRow.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: root
qml/Panel/IndicatorPage.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1 as Components
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3 as Components
1919import Unity.Indicators 0.1 as Indicators
2020import "Indicators"
2121
qml/Panel/Indicators/IndicatorBase.qml+1−1
@@ -17,7 +17,7 @@
1717 * Nick Dedekind <nick.dedekind@canonical.com>
1818 */
1919
20−import QtQuick 2.0
20+import QtQuick 2.4
2121import Unity.Indicators 0.1
2222
2323Item {
qml/Panel/Indicators/IndicatorDelegate.qml+1−1
@@ -17,7 +17,7 @@
1717 * Nick Dedekind <nick.dedekind@canonical.com>
1818 */
1919
20−import QtQuick 2.0
20+import QtQuick 2.4
2121
2222IndicatorBase {
2323 readonly property bool indicatorVisible: rootActionState.indicatorVisible
qml/Panel/Indicators/IndicatorsLight.qml+1−1
@@ -17,7 +17,7 @@
1717 * Renato Araujo Oliveira Filho <renato@canonical.com>
1818 */
1919
20−import QtQuick 2.0
20+import QtQuick 2.4
2121import Powerd 0.1
2222import Lights 0.1
2323import QMenuModel 0.1 as QMenuModel
qml/Panel/Indicators/MenuItemFactory.qml+5−5
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Ubuntu.Settings.Menus 0.1 as Menus
1919import Ubuntu.Settings.Components 0.1
2020import QMenuModel 0.1
2121import Utils 0.1 as Utils
22−import Ubuntu.Components.ListItems 0.1 as ListItems
22+import Ubuntu.Components.ListItems 1.3 as ListItems
2323import Ubuntu.Components 1.3
2424import Unity.Session 0.1
2525
@@ -249,7 +249,7 @@ Item {
249249 name: "settings"
250250 height: units.gu(3)
251251 width: height
252− color: Theme.palette.selected.backgroundText
252+ color: theme.palette.selected.backgroundText
253253 }
254254 }
255255 }
@@ -281,7 +281,7 @@ Item {
281281 source: menuData.icon
282282 height: units.gu(3)
283283 width: height
284− color: Theme.palette.selected.backgroundText
284+ color: theme.palette.selected.backgroundText
285285 }
286286 }
287287 }
@@ -928,7 +928,7 @@ Item {
928928 enabled: menuData && menuData.sensitive || false
929929 highlightWhenPressed: false
930930 text: menuData && menuData.label || ""
931− foregroundColor: Theme.palette.normal.backgroundText
931+ foregroundColor: theme.palette.normal.backgroundText
932932
933933 onMenuModelChanged: {
934934 loadAttributes();
qml/Panel/Indicators/MessageMenuItemFactory.qml+1−1
@@ -18,7 +18,7 @@
1818 * Olivier Tilloy <olivier.tilloy@canonical.com>
1919 */
2020
21−import QtQuick 2.0
21+import QtQuick 2.4
2222import Ubuntu.Components 1.3
2323import Ubuntu.Settings.Menus 0.1 as Menus
2424import QMenuModel 0.1 as QMenuModel
qml/Panel/Indicators/ModemInfoItem.qml+6−6
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 0.1
20−import Ubuntu.Components.ListItems 0.1 as ListItem
19+import Ubuntu.Components 1.3
20+import Ubuntu.Components.ListItems 1.3 as ListItem
2121
2222ListItem.Empty {
2323 id: menu
@@ -65,7 +65,7 @@ ListItem.Empty {
6565 height: parent.height
6666 Icon {
6767 id: statusIcon
68− color: Theme.palette.selected.backgroundText
68+ color: theme.palette.selected.backgroundText
6969
7070 Layout.preferredHeight: parent.height
7171 Layout.preferredWidth: Layout.preferredHeight
@@ -75,7 +75,7 @@ ListItem.Empty {
7575
7676 Icon {
7777 id: iconConnectivity
78− color: Theme.palette.selected.backgroundText
78+ color: theme.palette.selected.backgroundText
7979
8080 Layout.preferredHeight: parent.height
8181 Layout.preferredWidth: Layout.preferredHeight
qml/Panel/Indicators/RoamingIndication.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020
2121RowLayout {
2222 spacing: units.gu(0.5)
@@ -30,7 +30,7 @@ RowLayout {
3030
3131 Icon {
3232 id: iconRoaming
33− color: Theme.palette.selected.backgroundText
33+ color: theme.palette.selected.backgroundText
3434
3535 Layout.preferredHeight: parent.height
3636 Layout.preferredWidth: Layout.preferredHeight
qml/Panel/Indicators/client/IndicatorRepresentation.qml+3−3
@@ -18,9 +18,9 @@
1818 * Nick Dedekind <nick.dedekind@canonical.com>
1919 */
2020
21−import QtQuick 2.0
22−import Ubuntu.Components 0.1
23−import Ubuntu.Components.ListItems 0.1 as ListItem
21+import QtQuick 2.4
22+import Ubuntu.Components 1.3
23+import Ubuntu.Components.ListItems 1.3 as ListItem
2424import "../.."
2525
2626Page {
qml/Panel/Indicators/client/IndicatorsClient.qml+4−4
@@ -17,16 +17,16 @@
1717 * Renato Araujo Oliveira Filho <renato@canonical.com>
1818 */
1919
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
22−import Ubuntu.Components.ListItems 0.1 as ListItem
20+import QtQuick 2.4
21+import Ubuntu.Components 1.3
22+import Ubuntu.Components.ListItems 1.3 as ListItem
2323
2424Rectangle {
2525 color: "black"
2626 id: root
2727
2828 Component.onCompleted: {
29− Theme.name = "Ubuntu.Components.Themes.SuruGradient"
29+ theme.name = "Ubuntu.Components.Themes.SuruGradient"
3030 }
3131
3232 PageStack {
qml/Panel/Indicators/client/IndicatorsList.qml+3−3
@@ -17,9 +17,9 @@
1717 * Renato Araujo Oliveira Filho <renato@canonical.com>
1818 */
1919
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
22−import Ubuntu.Components.ListItems 0.1 as ListItem
20+import QtQuick 2.4
21+import Ubuntu.Components 1.3
22+import Ubuntu.Components.ListItems 1.3 as ListItem
2323import Unity.Indicators 0.1 as Indicators
2424import "../.."
2525
qml/Panel/Indicators/client/IndicatorsTree.qml+2−2
@@ -17,8 +17,8 @@
1717 * Nick Dedekind <nick.dededkind@canonical.com>
1818 */
1919
20−import QtQuick 2.0
21−import Ubuntu.Components 0.1
20+import QtQuick 2.4
21+import Ubuntu.Components 1.3
2222import Unity.Indicators 0.1 as Indicators
2323import ".."
2424
qml/Panel/IndicatorsBar.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121Item {
qml/Panel/IndicatorsMenu.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import "../Components"
2121import "Indicators"
qml/Panel/MenuContent.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import Unity.Indicators 0.1 as Indicators
2121import Utils 0.1
2222import "../Components"
qml/Panel/Panel.qml+7−5
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Unity.Application 0.1
2020import "../Components"
2121import "../Components/PanelState"
@@ -28,6 +28,7 @@ Item {
2828 property alias callHint: __callHint
2929 property bool fullscreenMode: false
3030 property real indicatorAreaShowProgress: 1.0
31+ property bool locked: false
3132
3233 opacity: fullscreenMode && indicators.fullyClosed ? 0.0 : 1.0
3334
@@ -136,7 +137,7 @@ Item {
136137 }
137138
138139 shown: false
139− width: root.width - (PanelState.buttonsVisible ? windowControlButtons.width : 0)
140+ width: root.width - (windowControlButtons.visible ? windowControlButtons.width : 0)
140141 minimizedPanelHeight: units.gu(3)
141142 expandedPanelHeight: units.gu(7)
142143 openedHeight: root.height - indicatorOrangeLine.height
@@ -164,13 +165,14 @@ Item {
164165
165166 WindowControlButtons {
166167 id: windowControlButtons
168+ objectName: "panelWindowControlButtons"
167169 anchors {
168170 left: parent.left
169171 top: parent.top
170172 margins: units.gu(0.7)
171173 }
172174 height: indicators.minimizedPanelHeight - anchors.margins * 2
173− visible: PanelState.buttonsVisible
175+ visible: PanelState.buttonsVisible && !root.locked
174176 onClose: PanelState.close()
175177 onMinimize: PanelState.minimize()
176178 onMaximize: PanelState.maximize()
@@ -189,7 +191,7 @@ Item {
189191 id: __callHint
190192 anchors {
191193 top: parent.top
192− left: PanelState.buttonsVisible ? windowControlButtons.right : parent.left
194+ left: windowControlButtons.visible ? windowControlButtons.right : parent.left
193195 }
194196 height: indicators.minimizedPanelHeight
195197 visible: active && indicators.state == "initial"
qml/Panel/PanelBackground.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Rectangle {
2020 color: "black"
qml/Panel/PanelSeparatorLine.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Rectangle {
2020 property real saturation: 1.0
qml/Panel/PanelVelocityCalculator.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import Ubuntu.Gestures 0.1
1919
2020Item {
qml/Rotation/HalfLoopRotationAnimation.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818
1919SequentialAnimation {
2020 id: root
qml/Rotation/ImmediateRotationAction.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818
1919ScriptAction {
2020 property var info
qml/Rotation/NinetyRotationAnimation.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818
1919SequentialAnimation {
2020 id: root
qml/Rotation/RotationStates.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Powerd 0.1
2020
2121// Why the state machine is done that way:
qml/ScopeTool.qml+3−3
@@ -14,9 +14,9 @@
1414* along with this program. If not, see <http://www.gnu.org/licenses/>.
1515*/
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
19−import Ubuntu.Components.Popups 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.Popups 1.3
2020import Ubuntu.Thumbnailer 0.1 // Register support for image://thumbnailer/ and image://albumart/
2121import Utils 0.1
2222import Unity 0.2
qml/Shell.qml+15−19
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import QtQuick.Window 2.0
17+import QtQuick 2.4
18+import QtQuick.Window 2.2
1919import AccountsService 0.1
2020import Unity.Application 0.1
21−import Ubuntu.Components 0.1
22−import Ubuntu.Components.Popups 1.0
21+import Ubuntu.Components 1.3
22+import Ubuntu.Components.Popups 1.3
2323import Ubuntu.Gestures 0.1
2424import Ubuntu.Telephony 0.1 as Telephony
2525import Unity.Connectivity 0.1
@@ -49,14 +49,14 @@ Item {
4949 // to be set from outside
5050 property int orientationAngle: 0
5151 property int orientation
52− property int primaryOrientation
53− property int nativeOrientation
52+ property Orientations orientations
5453 property real nativeWidth
5554 property real nativeHeight
5655 property alias indicatorAreaShowProgress: panel.indicatorAreaShowProgress
5756 property bool beingResized
5857 property string usageScenario: "phone" // supported values: "phone", "tablet" or "desktop"
5958 property string mode: "full-greeter"
59+ property bool cursorVisible: false
6060 function updateFocusedAppOrientation() {
6161 applicationsDisplayLoader.item.updateFocusedAppOrientation();
6262 }
@@ -85,7 +85,7 @@ Item {
8585 } else if (greeter && greeter.shown) {
8686 return Qt.PrimaryOrientation;
8787 } else if (mainApp) {
88− return mainApp.supportedOrientations;
88+ return shell.orientations.map(mainApp.supportedOrientations);
8989 } else {
9090 // we just don't care
9191 return Qt.PortraitOrientation
@@ -139,7 +139,7 @@ Item {
139139 }
140140
141141 Component.onCompleted: {
142− Theme.name = "Ubuntu.Components.Themes.SuruGradient"
142+ theme.name = "Ubuntu.Components.Themes.SuruGradient"
143143 if (ApplicationManager.count > 0) {
144144 ApplicationManager.focusApplication(ApplicationManager.get(0).appId);
145145 }
@@ -171,8 +171,8 @@ Item {
171171 }
172172
173173 WindowKeysFilter {
174− Keys.onPressed: physicalKeysMapper.onKeyPressed(event);
175− Keys.onReleased: physicalKeysMapper.onKeyReleased(event);
174+ Keys.onPressed: physicalKeysMapper.onKeyPressed(event, currentEventTimestamp);
175+ Keys.onReleased: physicalKeysMapper.onKeyReleased(event, currentEventTimestamp);
176176 }
177177
178178 HomeKeyWatcher {
@@ -297,18 +297,13 @@ Item {
297297 }
298298 Binding {
299299 target: applicationsDisplayLoader.item
300− property: "background"
301− value: wallpaperResolver.background
300+ property: "orientations"
301+ value: shell.orientations
302302 }
303303 Binding {
304304 target: applicationsDisplayLoader.item
305− property: "shellPrimaryOrientation"
306− value: shell.primaryOrientation
307− }
308− Binding {
309− target: applicationsDisplayLoader.item
310− property: "nativeOrientation"
311− value: shell.nativeOrientation
305+ property: "background"
306+ value: wallpaperResolver.background
312307 }
313308 Binding {
314309 target: applicationsDisplayLoader.item
@@ -535,6 +530,7 @@ Item {
535530
536531 fullscreenMode: (topmostApplicationIsFullscreen && !LightDMService.greeter.active && launcher.progress == 0)
537532 || greeter.hasLockedApp
533+ locked: greeter && greeter.active
538534 }
539535
540536 Launcher {
qml/Stages/AbstractStage.qmlnew file+63
@@ -0,0 +1,63 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import GSettings 1.0
20+
21+Rectangle {
22+ id: root
23+
24+ color: "#111111"
25+
26+ // Controls to be set from outside
27+ property bool altTabPressed
28+ property url background
29+ property bool beingResized
30+ property int dragAreaWidth
31+ property bool interactive
32+ property real inverseProgress // This is the progress for left edge drags, in pixels.
33+ property bool keepDashRunning: true
34+ property real maximizedAppTopMargin
35+ property real nativeHeight
36+ property real nativeWidth
37+ property QtObject orientations
38+ property int shellOrientation
39+ property int shellOrientationAngle
40+ property bool spreadEnabled: true // If false, animations and right edge will be disabled
41+ property bool suspended
42+
43+ // To be read from outside
44+ property var mainApp: null
45+ property int mainAppWindowOrientationAngle
46+ property bool orientationChangesEnabled
47+
48+ // Shared code for use in stage implementations
49+ GSettings {
50+ id: lifecycleExceptions
51+ schema.id: "com.canonical.qtmir"
52+ }
53+
54+ function isExemptFromLifecycle(appId) {
55+ var shortAppId = appId.split('_')[0];
56+ for (var i = 0; i < lifecycleExceptions.lifecycleExemptAppids.length; i++) {
57+ if (shortAppId === lifecycleExceptions.lifecycleExemptAppids[i]) {
58+ return true;
59+ }
60+ }
61+ return false;
62+ }
63+}
qml/Stages/Animations/BaseSessionAnimation.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919/* This is the base case for surface animations, used when adding/removing * child surfaces.
2020 * The class is meant to be overridden and changes/animations provided for state changes.
qml/Stages/Animations/SwipeFromBottomAnimation.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020BaseSessionAnimation {
2121 id: animation
qml/Stages/ApplicationWindow.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Unity.Application 0.1
2020
2121FocusScope {
qml/Stages/DecoratedWindow.qml+2−2
@@ -16,8 +16,8 @@
1616 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
1717 */
1818
19−import QtQuick 2.3
20−import Ubuntu.Components 1.1
19+import QtQuick 2.4
20+import Ubuntu.Components 1.3
2121import Unity.Application 0.1
2222
2323FocusScope {
qml/Stages/DesktopSpread.qml+1−1
@@ -16,7 +16,7 @@
1616
1717import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 1.2
19+import Ubuntu.Components 1.3
2020import Ubuntu.Gestures 0.1
2121import Unity.Application 0.1
2222
qml/Stages/DesktopSpreadDelegate.qml+2−2
@@ -16,8 +16,8 @@
1616 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
1717 */
1818
19−import QtQuick 2.3
20−import Ubuntu.Components 1.1
19+import QtQuick 2.4
20+import Ubuntu.Components 1.3
2121import Unity.Application 0.1
2222
2323Item {
qml/Stages/DesktopStage.qml+93−32
@@ -18,43 +18,25 @@
1818
1919import QtQuick 2.4
2020import QtQuick.Layouts 1.1
21−import Ubuntu.Components 1.1
21+import Ubuntu.Components 1.3
2222import Unity.Application 0.1
2323import "../Components"
2424import "../Components/PanelState"
25+import "../Components"
2526import Utils 0.1
2627import Ubuntu.Gestures 0.1
2728
28−Rectangle {
29+AbstractStage {
2930 id: root
3031 anchors.fill: parent
3132
32− // Controls to be set from outside
33− property int dragAreaWidth // just to comply with the interface shared between stages
34− property real maximizedAppTopMargin
35− property bool interactive
36− property bool spreadEnabled // just to comply with the interface shared between stages
37− property real inverseProgress: 0 // just to comply with the interface shared between stages
38− property int shellOrientationAngle: 0
39− property int shellOrientation
40− property int shellPrimaryOrientation
41− property int nativeOrientation
42− property bool beingResized: false
43− property bool keepDashRunning: true
44− property bool suspended: false
45− property alias background: wallpaper.source
46− property alias altTabPressed: spread.altTabPressed
47−
4833 // functions to be called from outside
4934 function updateFocusedAppOrientation() { /* TODO */ }
5035 function updateFocusedAppOrientationAnimated() { /* TODO */}
5136
52− // To be read from outside
53− readonly property var mainApp: ApplicationManager.focusedApplicationId
37+ mainApp: ApplicationManager.focusedApplicationId
5438 ? ApplicationManager.findApplication(ApplicationManager.focusedApplicationId)
5539 : null
56− property int mainAppWindowOrientationAngle: 0
57− readonly property bool orientationChangesEnabled: false
5840
5941 Connections {
6042 target: ApplicationManager
@@ -86,6 +68,22 @@ Rectangle {
8668 var index = indexOf(focusedAppId);
8769 return index >= 0 && index < appRepeater.count ? appRepeater.itemAt(index) : null
8870 }
71+ property int foregroundMaximizedAppIdIndex: -1
72+
73+ function updateForegroundMaximizedApp() {
74+ for (var i = 0; i < appRepeater.count; i++) {
75+ var item = appRepeater.itemAt(i);
76+
77+ if (item && item.visuallyMaximized) {
78+ var app = ApplicationManager.get(i);
79+ if (app) {
80+ foregroundMaximizedAppIdIndex = i;
81+ return;
82+ }
83+ }
84+ }
85+ foregroundMaximizedAppIdIndex = -1;
86+ }
8987
9088 function indexOf(appId) {
9189 for (var i = 0; i < ApplicationManager.count; i++) {
@@ -111,6 +109,7 @@ Rectangle {
111109 property: "buttonsVisible"
112110 value: priv.focusedAppDelegate !== null && priv.focusedAppDelegate.state === "maximized"
113111 }
112+ Component.onDestruction: PanelState.buttonsVisible = false;
114113
115114 FocusScope {
116115 id: appContainer
@@ -121,6 +120,7 @@ Rectangle {
121120 CrossFadeImage {
122121 id: wallpaper
123122 anchors.fill: parent
123+ source: root.background
124124 sourceSize { height: root.height; width: root.width }
125125 fillMode: Image.PreserveAspectCrop
126126 }
@@ -130,8 +130,12 @@ Rectangle {
130130 model: ApplicationManager
131131 objectName: "appRepeater"
132132
133+ onItemAdded: priv.updateForegroundMaximizedApp()
134+ onItemRemoved: priv.updateForegroundMaximizedApp()
135+
133136 delegate: FocusScope {
134137 id: appDelegate
138+ objectName: "stageDelegate_" + model.appId
135139 z: ApplicationManager.count - index
136140 y: units.gu(3)
137141 width: units.gu(60)
@@ -140,6 +144,10 @@ Rectangle {
140144
141145 property bool maximized: false
142146 property bool minimized: false
147+ property bool animationsEnabled: true
148+
149+ property bool visuallyMaximized: false
150+ property bool visuallyMinimized: false
143151
144152 onFocusChanged: {
145153 if (focus && ApplicationManager.focusedApplicationId !== model.appId) {
@@ -147,6 +155,16 @@ Rectangle {
147155 }
148156 }
149157
158+ onZChanged: priv.updateForegroundMaximizedApp()
159+ onVisuallyMaximizedChanged: priv.updateForegroundMaximizedApp()
160+
161+ visible: !visuallyMinimized &&
162+ !greeter.fullyShown &&
163+ (priv.foregroundMaximizedAppIdIndex === -1 || priv.foregroundMaximizedAppIdIndex >= index) ||
164+ (spread.state == "altTab" && index === spread.highlightedIndex)
165+
166+ onVisibleChanged: console.log("VISIBLE", model.appId, visible)
167+
150168 Binding {
151169 target: ApplicationManager.get(index)
152170 property: "requestedState"
@@ -158,37 +176,78 @@ Rectangle {
158176 value: ApplicationInfoInterface.RequestedRunning // Always running for now
159177 }
160178
161− function maximize() {
179+ function maximize(animated) {
180+ animationsEnabled = (animated === undefined) || animated;
162181 minimized = false;
163182 maximized = true;
164183 }
165− function minimize() {
184+ function minimize(animated) {
185+ animationsEnabled = (animated === undefined) || animated;
166186 maximized = false;
167187 minimized = true;
168188 }
169− function unmaximize() {
189+ function unmaximize(animated) {
190+ animationsEnabled = (animated === undefined) || animated;
170191 minimized = false;
171192 maximized = false;
172193 }
173194
174195 states: [
175196 State {
176− name: "normal"; when: !appDelegate.maximized && !appDelegate.minimized
197+ name: "normal";
198+ when: !appDelegate.maximized && !appDelegate.minimized
199+ PropertyChanges {
200+ target: appDelegate;
201+ visuallyMinimized: false;
202+ visuallyMaximized: false
203+ }
177204 },
178205 State {
179206 name: "maximized"; when: appDelegate.maximized
180− PropertyChanges { target: appDelegate; x: 0; y: 0; width: root.width; height: root.height }
207+ PropertyChanges {
208+ target: appDelegate;
209+ x: 0; y: 0;
210+ width: root.width; height: root.height;
211+ visuallyMinimized: false;
212+ visuallyMaximized: true
213+ }
181214 },
182215 State {
183216 name: "minimized"; when: appDelegate.minimized
184− PropertyChanges { target: appDelegate; x: -appDelegate.width / 2; scale: units.gu(5) / appDelegate.width; opacity: 0 }
217+ PropertyChanges {
218+ target: appDelegate;
219+ x: -appDelegate.width / 2;
220+ scale: units.gu(5) / appDelegate.width;
221+ opacity: 0
222+ visuallyMinimized: true;
223+ visuallyMaximized: false
224+ }
185225 }
186226 ]
187227 transitions: [
188228 Transition {
189− from: "maximized,minimized,normal,"
190− to: "maximized,minimized,normal,"
191− PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale" }
229+ to: "normal"
230+ enabled: appDelegate.animationsEnabled
231+ PropertyAction { target: appDelegate; properties: "visuallyMinimized,visuallyMaximized" }
232+ PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale,opacity" }
233+ },
234+ Transition {
235+ to: "maximized"
236+ enabled: appDelegate.animationsEnabled
237+ PropertyAction { target: appDelegate; property: "visuallyMinimized" }
238+ SequentialAnimation {
239+ PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale,opacity" }
240+ PropertyAction { target: appDelegate; property: "visuallyMaximized" }
241+ }
242+ },
243+ Transition {
244+ to: "minimized"
245+ enabled: appDelegate.animationsEnabled
246+ PropertyAction { target: appDelegate; property: "visuallyMaximized" }
247+ SequentialAnimation {
248+ PropertyAnimation { target: appDelegate; properties: "x,y,opacity,width,height,scale,opacity" }
249+ PropertyAction { target: appDelegate; property: "visuallyMinimized" }
250+ }
192251 },
193252 Transition {
194253 from: ""
@@ -213,6 +272,7 @@ Rectangle {
213272 }
214273
215274 WindowResizeArea {
275+ objectName: "windowResizeArea"
216276 target: appDelegate
217277 minWidth: units.gu(10)
218278 minHeight: units.gu(10)
@@ -234,7 +294,7 @@ Rectangle {
234294 focus: true
235295
236296 onClose: ApplicationManager.stopApplication(model.appId)
237− onMaximize: appDelegate.maximize()
297+ onMaximize: appDelegate.maximized ? appDelegate.unmaximize() : appDelegate.maximize()
238298 onMinimize: appDelegate.minimize()
239299 onDecorationPressed: { ApplicationManager.focusApplication(model.appId) }
240300 }
@@ -269,5 +329,6 @@ Rectangle {
269329 anchors.fill: parent
270330 workspace: appContainer
271331 focus: state == "altTab"
332+ altTabPressed: root.altTabPressed
272333 }
273334}
qml/Stages/MainViewStyle.qml+35−27
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2012 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU Lesser General Public License as published by
@@ -13,51 +13,60 @@
1313 * You should have received a copy of the GNU Lesser General Public License
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
16−import QtQuick 2.0
17−import Ubuntu.Components 1.1
16+import QtQuick 2.4
17+import Ubuntu.Components 1.3
1818
1919// FIXME: copied with slight modifications from Ubuntu UI Toolkit's Ambiance's theme
2020Item {
21− // styling properties
2221 anchors.fill: parent
2322 z: -1
2423 id: mainViewStyle
2524
25+ property var theme
26+
27+ /*!
28+ Color of the header's background.
29+
30+ \sa backgroundColor, footerColor
31+ */
32+ property color headerColor: styledItem.headerColor
33+
2634 /*!
27− The background texture of the main view. The image will be drawn over the background color,
28− so if it has (semi-)transparent pixels, in those pixels the background color will be visible.
29− */
30− property url backgroundSource: "graphics/background_paper.png"
31− property var theme
35+ Color of the background.
36+
37+ The background is usually a single color. However if \l headerColor
38+ or \l footerColor are set then a gradient of colors will be drawn.
39+
40+ \sa footerColor, headerColor
41+ */
42+ property color backgroundColor: styledItem.backgroundColor
43+
44+ /*!
45+ Color of the footer's background.
46+
47+ \sa backgroundColor, headerColor
48+ */
49+ property color footerColor: styledItem.footerColor
3250
3351 Gradient {
3452 id: backgroundGradient
35− GradientStop { position: 0.0; color: styledItem.headerColor }
36− GradientStop { position: 0.83; color: styledItem.backgroundColor }
37− GradientStop { position: 1.0; color: styledItem.footerColor }
53+ GradientStop { position: 0.0; color: mainViewStyle.headerColor }
54+ GradientStop { position: 0.83; color: mainViewStyle.backgroundColor }
55+ GradientStop { position: 1.0; color: mainViewStyle.footerColor }
3856 }
3957
4058 Rectangle {
4159 id: backgroundColor
4260 anchors.fill: parent
43− color: styledItem.backgroundColor
61+ color: mainViewStyle.backgroundColor
4462 gradient: internals.isGradient ? backgroundGradient : null
4563 }
4664
47− Image {
48− id: backgroundTexture
49− anchors.fill: parent
50− source: mainViewStyle.theme.name === "Ambiance" ? mainViewStyle.backgroundSource : ""
51− fillMode: Image.Tile
52− asynchronous: true
53− cache: false
54− visible: status === Image.Ready
55− }
56−
5765 QtObject {
5866 id: internals
59− property bool isGradient: styledItem.backgroundColor != styledItem.headerColor ||
60− styledItem.backgroundColor != styledItem.footerColor
67+ property bool isGradient: mainViewStyle.backgroundColor != mainViewStyle.headerColor ||
68+ mainViewStyle.backgroundColor != mainViewStyle.footerColor
69+
6170 /*
6271 As we don't know the order the property bindings and onXXXChanged signals are evaluated
6372 we should rely only on one property when changing the theme to avoid intermediate
@@ -65,8 +74,7 @@ Item {
6574
6675 Qt bug: https://bugreports.qt-project.org/browse/QTBUG-11712
6776 */
68− property string theme: (ColorUtils.luminance(styledItem.backgroundColor) >= 0.85) ? "Ambiance" :
69− (isGradient ? "SuruGradient" : "SuruDark")
77+ property string theme: (ColorUtils.luminance(styledItem.backgroundColor) >= 0.85) ? "Ambiance" : "SuruDark"
7078 }
7179
7280 // automatically select the appropriate theme depending on the background colors
qml/Stages/OrientationChangeAnimation.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818
1919QtObject {
2020 id: root
qml/Stages/PageHeadStyle.qmldeleted−76
@@ -1,76 +0,0 @@
1−/*
2− * Copyright 2014 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−import QtQuick 2.2
17−import Ubuntu.Components 1.1
18−import Ubuntu.Components.Styles 1.1 as Style
19−
20−// FIXME: copied with large modifications from Ubuntu UI Toolkit's Ambiance's theme
21−Style.PageHeadStyle {
22− id: headerStyle
23−
24− contentHeight: units.gu(7)
25− separatorSource: "graphics/PageHeaderBaseDividerLight.sci"
26− separatorBottomSource: "graphics/PageHeaderBaseDividerBottom.png"
27− fontWeight: Font.Light
28− fontSize: "x-large"
29− textColor: styledItem.config.foregroundColor
30− textLeftMargin: units.gu(2)
31−
32− implicitHeight: headerStyle.contentHeight
33−
34− property var theme
35−
36− Label {
37− anchors {
38− left: parent.left
39− leftMargin: headerStyle.textLeftMargin
40− right: parent.right
41− verticalCenter: parent.verticalCenter
42− }
43− LayoutMirroring.enabled: Qt.application.layoutDirection == Qt.RightToLeft
44− text: styledItem.title
45− font.weight: headerStyle.fontWeight
46− fontSize: headerStyle.fontSize
47− color: headerStyle.textColor
48− elide: Text.ElideRight
49− }
50−
51− BorderImage {
52− id: separator
53− anchors {
54− top: parent.bottom
55− topMargin: separatorBottom.height
56− left: parent.left
57− right: parent.right
58− }
59− source: headerStyle.separatorSource
60− height: styledItem.config.sections.model !== undefined ? units.gu(3) : units.gu(2)
61− asynchronous: true
62− cache: true
63− }
64−
65− Image {
66− id: separatorBottom
67− anchors {
68− top: separator.bottom
69− left: parent.left
70− right: parent.right
71− }
72− source: headerStyle.separatorBottomSource
73− asynchronous: true
74− cache: true
75− }
76−}
qml/Stages/PhoneStage.qml+38−40
@@ -14,37 +14,24 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import Unity.Application 0.1
2121import Unity.Session 0.1
2222import Utils 0.1
23+import Powerd 0.1
2324import "../Components"
2425
25−Rectangle {
26+AbstractStage {
2627 id: root
2728
28− // Controls to be set from outside
29− property int dragAreaWidth
30− property real maximizedAppTopMargin
31− property bool interactive
32− property bool spreadEnabled: true // If false, animations and right edge will be disabled
33− property real inverseProgress: 0 // This is the progress for left edge drags, in pixels.
3429 property QtObject applicationManager: ApplicationManager
3530 property bool focusFirstApp: true // If false, focused app will appear on right edge like other apps
3631 property bool altTabEnabled: true
3732 property real startScale: 1.1
3833 property real endScale: 0.7
39− property bool keepDashRunning: true
40− property bool suspended: false
41− property int shellOrientationAngle: 0
42− property int shellOrientation
43− property int shellPrimaryOrientation
44− property int nativeOrientation
45− property real nativeWidth
46− property real nativeHeight
47− property bool beingResized: false
34+
4835 onBeingResizedChanged: {
4936 if (beingResized) {
5037 // Brace yourselves for impact!
@@ -56,6 +43,8 @@ Rectangle {
5643 priv.reset();
5744 }
5845 }
46+
47+ // Functions to be called from outside
5948 function updateFocusedAppOrientation() {
6049 if (spreadRepeater.count > 0) {
6150 spreadRepeater.itemAt(0).matchShellOrientation();
@@ -71,7 +60,7 @@ Rectangle {
7160
7261 var supportedOrientations = spreadDelegate.application.supportedOrientations;
7362 if (supportedOrientations === Qt.PrimaryOrientation) {
74− supportedOrientations = spreadDelegate.shellPrimaryOrientation;
63+ supportedOrientations = root.orientations.primary;
7564 }
7665
7766 if (delta === 180 && (supportedOrientations & spreadDelegate.shellOrientation)) {
@@ -85,16 +74,14 @@ Rectangle {
8574 }
8675 }
8776
88− // To be read from outside
89− readonly property var mainApp: applicationManager.focusedApplicationId
77+ mainApp: applicationManager.focusedApplicationId
9078 ? applicationManager.findApplication(applicationManager.focusedApplicationId)
9179 : null
9280
93− property int mainAppWindowOrientationAngle: 0
94− readonly property bool orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled
95− && !priv.focusedAppDelegateIsDislocated
96− && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
97− && spreadView.phase === 0
81+ orientationChangesEnabled: priv.focusedAppOrientationChangesEnabled
82+ && !priv.focusedAppDelegateIsDislocated
83+ && !(priv.focusedAppDelegate && priv.focusedAppDelegate.xBehavior.running)
84+ && spreadView.phase === 0
9885
9986 // How far left the stage has been dragged
10087 readonly property real dragProgress: spreadRepeater.count > 0 ? -spreadRepeater.itemAt(0).xTranslate : 0
@@ -106,8 +93,6 @@ Rectangle {
10693
10794 signal opened()
10895
109− color: "#111111"
110−
11196 function select(appId) {
11297 spreadView.snapTo(priv.indexOf(appId));
11398 }
@@ -198,7 +183,8 @@ Rectangle {
198183 }
199184 }
200185
201− property bool focusedAppDelegateIsDislocated: focusedAppDelegate && focusedAppDelegate.x !== 0
186+ property bool focusedAppDelegateIsDislocated: focusedAppDelegate &&
187+ (focusedAppDelegate.x !== 0 || focusedAppDelegate.xBehavior.running)
202188
203189 function indexOf(appId) {
204190 for (var i = 0; i < root.applicationManager.count; i++) {
@@ -438,16 +424,21 @@ Rectangle {
438424 dropShadow: spreadView.active || priv.focusedAppDelegateIsDislocated
439425 focusFirstApp: root.focusFirstApp
440426
427+ readonly property bool isDash: model.appId == "unity8-dash"
428+
429+ readonly property bool canSuspend: model.isTouchApp
430+ && !isExemptFromLifecycle(model.appId)
431+
441432 Binding {
442433 target: appDelegate.application
443434 property: "requestedState"
444− value: (isDash && root.keepDashRunning) || (!root.suspended && appDelegate.focus)
445− ? ApplicationInfoInterface.RequestedRunning
446− : ApplicationInfoInterface.RequestedSuspended
435+ value: !canSuspend
436+ || (isDash && root.keepDashRunning)
437+ || (!root.suspended && appDelegate.focus)
438+ ? ApplicationInfoInterface.RequestedRunning
439+ : ApplicationInfoInterface.RequestedSuspended
447440 }
448441
449− readonly property bool isDash: model.appId == "unity8-dash"
450−
451442 z: isDash && !spreadView.active ? -1 : behavioredIndex
452443
453444 x: {
@@ -484,7 +475,6 @@ Rectangle {
484475
485476 property var xBehavior: xBehavior
486477 Behavior on x {
487− id: xBehavior
488478 enabled: root.spreadEnabled &&
489479 !spreadView.active &&
490480 !snapAnimation.running &&
@@ -492,6 +482,7 @@ Rectangle {
492482 priv.animateX &&
493483 !root.beingResized
494484 UbuntuNumberAnimation {
485+ id: xBehavior
495486 duration: UbuntuAnimation.BriskDuration
496487 }
497488 }
@@ -531,15 +522,22 @@ Rectangle {
531522 return progress;
532523 }
533524
534− // Hiding tiles when their progress is negative or reached the maximum
535− visible: (progress >= 0 && progress < 1.7)
536− || (isDash && priv.focusedAppDelegateIsDislocated)
525+ // Hide tile when progress is such that it will be off screen.
526+ property bool occluded: {
527+ if (spreadView.active && (progress >= 0 && progress < 1.7)) return false;
528+ else if (!spreadView.active && isFocused) return false;
529+ else if (xBehavior.running) return false;
530+ else if (z <= 1 && priv.focusedAppDelegateIsDislocated) return false;
531+ return true;
532+ }
537533
534+ visible: Powerd.status == Powerd.On &&
535+ !greeter.fullyShown &&
536+ !occluded
538537
539538 shellOrientationAngle: root.shellOrientationAngle
540539 shellOrientation: root.shellOrientation
541− shellPrimaryOrientation: root.shellPrimaryOrientation
542− nativeOrientation: root.nativeOrientation
540+ orientations: root.orientations
543541
544542 onClicked: {
545543 if (root.altTabEnabled && spreadView.phase == 2) {
qml/Stages/SessionContainer.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515*/
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import "Animations"
1919
2020FocusScope {
qml/Stages/ShimStage.qml+3−3
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
20−Rectangle {
20+AbstractStage {
2121 id: shimStage
2222
2323 anchors.fill: parent
qml/Stages/Splash.qml+25−30
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515*/
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.Themes 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.Themes 1.3
2020import "../Components"
2121
22−import Ubuntu.Components.Themes.Ambiance 1.1 as Ambiance
22+import Ubuntu.Components.Themes.Ambiance 1.3 as Ambiance
2323
2424Item {
2525 id: root
@@ -29,7 +29,7 @@ Item {
2929 property color footerColor: d.undefinedColor
3030 property alias imageSource: overlaidImage.source
3131 property url icon
32− property alias title: header.title
32+ property alias title: headerConfig.title
3333 property alias showHeader: header.visible
3434
3535 Ambiance.Palette {
@@ -62,40 +62,36 @@ Item {
6262 : root.footerColor
6363
6464 // FIXME: fake a Theme object as to expose the Palette corresponding to the backgroundColor (see MainViewStyle.qml)
65− property var theme: QtObject {
65+ readonly property var fakeTheme: QtObject {
6666 property string name
67− property Palette palette: Qt.createQmlObject("import QtQuick 2.2;\
68− import Ubuntu.Components.Themes.%1 1.1;\
69− Palette {}".arg(styledItem.theme.name),
67+ property Palette palette: Qt.createQmlObject("import QtQuick 2.4;\
68+ import Ubuntu.Components.Themes.%1 1.3;\
69+ Palette {}".arg(styledItem.fakeTheme.name),
7070 styledItem, "dynamicPalette");
7171 }
7272
7373 // FIXME: should instead use future toolkit API:
7474 // style: theme.createStyleComponent("MainViewStyle.qml", styledItem)
75− style: Component { MainViewStyle {theme: styledItem.theme} }
75+ style: Component { MainViewStyle {theme: styledItem.fakeTheme} }
7676 }
7777
78− StyledItem {
78+ Ambiance.PageHeadStyle {
7979 id: header
8080 anchors {
81− left: parent.left
81+ left: parent.left;
8282 right: parent.right
8383 }
84− visible: false
85−
86− // mimic API of toolkit's AppHeader component required by PageHeadStyle
87− property Item pageStack
88− property Item contents
89− property string title
90− property var tabsModel
91− property var config: QtObject {
92− property color foregroundColor: styledItem.theme.palette.selected.backgroundText
93− property var sections: QtObject {}
84+ property var styledItem: header
85+ // FIXME Keep in sync with SDK's MainView.qml values of these two colors
86+ property color dividerColor: Qt.darker(styledItem.backgroundColor, 1.1)
87+ property color panelColor: Qt.lighter(styledItem.backgroundColor, 1.1)
88+ panelForegroundColor: config.foregroundColor
89+ config: PageHeadConfiguration {
90+ id: headerConfig
91+ foregroundColor: styledItem.fakeTheme.palette.selected.backgroundText
9492 }
9593
96− // FIXME: should instead use future toolkit API:
97− // style: theme.createStyleComponent("PageHeadStyle.qml", header)
98− style: Component { PageHeadStyle {theme: styledItem.theme} }
94+ property var contents: null
9995 }
10096
10197 Image {
@@ -121,14 +117,13 @@ Item {
121117 visible: d.showIcon
122118
123119 radius: "medium"
124− borderSource: "none"
125−
126− image: Image {
120+ aspect: UbuntuShape.Flat
121+ sourceFillMode: Image.PreserveAspectCrop
122+ source: Image {
127123 id: iconImage
128124 sourceSize.width: iconShape.width
129125 sourceSize.height: iconShape.height
130126 source: d.showIcon ? root.icon : ""
131− fillMode: Image.PreserveAspectCrop
132127 }
133128 }
134129
@@ -139,7 +134,7 @@ Item {
139134 anchors.topMargin: units.gu(2)
140135 fontSize: "large"
141136
142− color: styledItem.theme.palette.selected.backgroundText
137+ color: styledItem.fakeTheme.palette.selected.backgroundText
143138 visible: d.showIcon
144139 }
145140
qml/Stages/SpreadDelegate.qml+11−12
@@ -17,9 +17,9 @@
1717 * Daniel d'Andrada <daniel.dandrada@canonical.com>
1818 */
1919
20−import QtQuick 2.0
21−import QtQuick.Window 2.0
22−import Ubuntu.Components 1.1
20+import QtQuick 2.4
21+import QtQuick.Window 2.2
22+import Ubuntu.Components 1.3
2323import "../Components"
2424
2525FocusScope {
@@ -42,8 +42,7 @@ FocusScope {
4242 property alias application: appWindow.application
4343 property int shellOrientationAngle
4444 property int shellOrientation
45− property int shellPrimaryOrientation
46− property int nativeOrientation
45+ property QtObject orientations
4746
4847 function matchShellOrientation() {
4948 if (!root.application)
@@ -157,7 +156,7 @@ FocusScope {
157156 var supportedOrientations = root.application.supportedOrientations;
158157
159158 if (supportedOrientations === Qt.PrimaryOrientation) {
160− supportedOrientations = root.shellPrimaryOrientation;
159+ supportedOrientations = root.orientations.primary;
161160 }
162161
163162 // If it doesn't support shell's current orientation
@@ -166,18 +165,18 @@ FocusScope {
166165 if (supportedOrientations & root.shellOrientation) {
167166 chosenOrientation = root.shellOrientation;
168167 } else if (supportedOrientations & Qt.PortraitOrientation) {
169− chosenOrientation = Qt.PortraitOrientation;
168+ chosenOrientation = root.orientations.portrait;
170169 } else if (supportedOrientations & Qt.LandscapeOrientation) {
171− chosenOrientation = Qt.LandscapeOrientation;
170+ chosenOrientation = root.orientations.landscape;
172171 } else if (supportedOrientations & Qt.InvertedPortraitOrientation) {
173− chosenOrientation = Qt.InvertedPortraitOrientation;
172+ chosenOrientation = root.orientations.invertedPortrait;
174173 } else if (supportedOrientations & Qt.InvertedLandscapeOrientation) {
175− chosenOrientation = Qt.InvertedLandscapeOrientation;
174+ chosenOrientation = root.orientations.invertedLandscape;
176175 } else {
177− chosenOrientation = root.shellPrimaryOrientation;
176+ chosenOrientation = root.orientations.primary;
178177 }
179178
180− return Screen.angleBetween(root.nativeOrientation, chosenOrientation);
179+ return Screen.angleBetween(root.orientations.native_, chosenOrientation);
181180 }
182181
183182 rotation: normalizeAngle(appWindowWithShadow.orientationAngle - root.shellOrientationAngle)
qml/Stages/SpreadMaths.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Utils 0.1
2020
2121Item {
qml/Stages/SurfaceContainer.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515*/
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1 // For TouchGate
2020import Utils 0.1 // for InputWatcher
2121import Unity.Application 0.1 // for MirSurfaceItem
qml/Stages/TabletStage.qml+43−39
@@ -1,4 +1,4 @@
1−/*
1+/*
22 * Copyright (C) 2014-2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
@@ -14,36 +14,20 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import Unity.Application 0.1
2121import Utils 0.1
22+import Powerd 0.1
2223import "../Components"
2324
24−Rectangle {
25+AbstractStage {
2526 id: root
2627 objectName: "stages"
2728 anchors.fill: parent
28− color: "#111111"
29−
30− // Controls to be set from outside
31− property int dragAreaWidth
32− property real maximizedAppTopMargin
33− property bool interactive
34− property alias beingResized: spreadView.beingResized
35−
36− property bool spreadEnabled: true // If false, animations and right edge will be disabled
37−
38− property real inverseProgress: 0 // This is the progress for left edge drags, in pixels.
39− property bool keepDashRunning: true
40− property bool suspended: false
41− property int shellOrientationAngle: 0
42− property int shellOrientation
43− property int shellPrimaryOrientation
44− property int nativeOrientation
45− property real nativeWidth
46− property real nativeHeight
29+
30+ // Functions to be called from outside
4731 function updateFocusedAppOrientation() {
4832 var mainStageAppIndex = priv.indexOf(priv.mainStageAppId);
4933 if (mainStageAppIndex >= 0 && mainStageAppIndex < spreadRepeater.count) {
@@ -64,7 +48,7 @@ Rectangle {
6448
6549 var supportedOrientations = spreadDelegate.application.supportedOrientations;
6650 if (supportedOrientations === Qt.PrimaryOrientation) {
67− supportedOrientations = spreadDelegate.shellPrimaryOrientation;
51+ supportedOrientations = spreadDelegate.orientations.primary;
6852 }
6953
7054 if (delta === 180 && (supportedOrientations & spreadDelegate.shellOrientation)) {
@@ -86,10 +70,7 @@ Rectangle {
8670 }
8771 }
8872
89− // To be read from outside
90− property var mainApp: null
91− property int mainAppWindowOrientationAngle: 0
92− readonly property bool orientationChangesEnabled: priv.mainAppOrientationChangesEnabled
73+ orientationChangesEnabled: priv.mainAppOrientationChangesEnabled
9374
9475 onWidthChanged: {
9576 spreadView.selectedIndex = -1;
@@ -130,7 +111,7 @@ Rectangle {
130111 property string oldFocusedAppId: ""
131112 property bool mainAppOrientationChangesEnabled: false
132113
133− property real landscapeHeight: root.nativeOrientation == Qt.LandscapeOrientation ?
114+ property real landscapeHeight: root.orientations.native_ == Qt.LandscapeOrientation ?
134115 root.nativeHeight : root.nativeWidth
135116
136117 property bool shellIsLandscape: root.shellOrientation === Qt.LandscapeOrientation
@@ -166,6 +147,8 @@ Rectangle {
166147 }
167148 }
168149
150+ property bool focusedAppDelegateIsDislocated: focusedAppDelegate &&
151+ (focusedAppDelegate.dragOffset !== 0 || focusedAppDelegate.xTranslateAnimating)
169152 function indexOf(appId) {
170153 for (var i = 0; i < ApplicationManager.count; i++) {
171154 if (ApplicationManager.get(i).appId == appId) {
@@ -302,7 +285,7 @@ Rectangle {
302285 }
303286
304287 property bool animateX: true
305− property bool beingResized: false
288+ property bool beingResized: root.beingResized
306289 onBeingResizedChanged: {
307290 if (beingResized) {
308291 // Brace yourselves for impact!
@@ -629,15 +612,18 @@ Rectangle {
629612
630613 readonly property bool isDash: model.appId == "unity8-dash"
631614
615+ readonly property bool canSuspend: model.isTouchApp
616+ && !isExemptFromLifecycle(model.appId)
617+
632618 Binding {
633619 target: spreadTile.application
634620 property: "requestedState"
635− value: (spreadTile.isDash && root.keepDashRunning)
636− ||
637− (!root.suspended && (model.appId == priv.mainStageAppId
638− || model.appId == priv.sideStageAppId))
639− ? ApplicationInfoInterface.RequestedRunning
640− : ApplicationInfoInterface.RequestedSuspended
621+ value: !canSuspend
622+ || (isDash && root.keepDashRunning)
623+ || (!root.suspended && (model.appId == priv.mainStageAppId
624+ || model.appId == priv.sideStageAppId))
625+ ? ApplicationInfoInterface.RequestedRunning
626+ : ApplicationInfoInterface.RequestedSuspended
641627 }
642628
643629 // FIXME: A regular binding doesn't update any more after closing an app.
@@ -676,6 +662,19 @@ Rectangle {
676662 return tileProgress;
677663 }
678664
665+ // TODO: Hiding tile when progress is such that it will be off screen.
666+ property bool occluded: {
667+ if (spreadView.active) return false;
668+ else if (spreadTile.active) return false;
669+ else if (xTranslateAnimating) return false;
670+ else if (z <= 1 && priv.focusedAppDelegateIsDislocated) return false;
671+ return true;
672+ }
673+
674+ visible: Powerd.status == Powerd.On &&
675+ !greeter.fullyShown &&
676+ !occluded
677+
679678 animatedProgress: {
680679 if (spreadView.phase == 0 && (spreadTile.active || spreadView.nextInStack == index)) {
681680 if (progress < spreadView.positionMarker1) {
@@ -691,9 +690,14 @@ Rectangle {
691690
692691 shellOrientationAngle: wantsMainStage ? root.shellOrientationAngle : 0
693692 shellOrientation: wantsMainStage ? root.shellOrientation : Qt.PortraitOrientation
694− shellPrimaryOrientation: wantsMainStage ? root.shellPrimaryOrientation : Qt.PortraitOrientation
695− nativeOrientation: wantsMainStage ? root.nativeOrientation : Qt.PortraitOrientation
696−
693+ orientations: Orientations {
694+ primary: spreadTile.wantsMainStage ? root.orientations.primary : Qt.PortraitOrientation
695+ native_: spreadTile.wantsMainStage ? root.orientations.native_ : Qt.PortraitOrientation
696+ portrait: root.orientations.portrait
697+ invertedPortrait: root.orientations.invertedPortrait
698+ landscape: root.orientations.landscape
699+ invertedLandscape: root.orientations.invertedLandscape
700+ }
697701
698702 onClicked: {
699703 if (spreadView.phase == 2) {
qml/Stages/TransformedSpreadDelegate.qml+2−2
@@ -16,9 +16,9 @@
1616 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
1717*/
1818
19−import QtQuick 2.0
19+import QtQuick 2.4
2020import Utils 0.1
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222
2323SpreadDelegate {
2424 id: root
qml/Stages/TransformedTabletSpreadDelegate.qml+4−2
@@ -16,9 +16,9 @@
1616 * Authors: Michael Zanetti <michael.zanetti@canonical.com>
1717*/
1818
19−import QtQuick 2.0
19+import QtQuick 2.4
2020import Utils 0.1
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Application 0.1
2323
2424SpreadDelegate {
@@ -48,6 +48,7 @@ SpreadDelegate {
4848 property bool isInSideStage: false
4949
5050 property int dragOffset: 0
51+ readonly property alias xTranslateAnimating: xTranslateAnimation.running
5152
5253 dropShadow: spreadView.active ||
5354 (active
@@ -144,6 +145,7 @@ SpreadDelegate {
144145 spreadView.animateX &&
145146 !spreadView.beingResized
146147 UbuntuNumberAnimation {
148+ id: xTranslateAnimation
147149 duration: UbuntuAnimation.FastDuration
148150 }
149151 }
qml/Stages/WindowDecoration.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import Unity.Application 0.1 // For Mir singleton
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import "../Components"
2121
2222MouseArea {
qml/Stages/WindowResizeArea.qml+42−9
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Utils 0.1
2020import Unity.Application 0.1 // for Mir.cursorName
2121
@@ -36,18 +36,51 @@ MouseArea {
3636 property int minWidth: 0
3737 property int minHeight: 0
3838
39+ QtObject {
40+ id: priv
41+ objectName: "priv"
42+
43+ property int normalX: 0
44+ property int normalY: 0
45+ property int normalWidth: 0
46+ property int normalHeight: 0
47+
48+ function updateNormalGeometry() {
49+ if (root.target.state == "normal") {
50+ normalX = root.target.x
51+ normalY = root.target.y
52+ normalWidth = root.target.width
53+ normalHeight = root.target.height
54+ }
55+ }
56+ }
57+
58+ Connections {
59+ target: root.target
60+ onXChanged: priv.updateNormalGeometry();
61+ onYChanged: priv.updateNormalGeometry();
62+ onWidthChanged: priv.updateNormalGeometry();
63+ onHeightChanged: priv.updateNormalGeometry();
64+ }
65+
3966 Component.onCompleted: {
40− var windowState = windowStateStorage.getGeometry(root.windowId, Qt.rect(target.x, target.y, target.width, target.height))
41− if (windowState !== undefined) {
42− target.x = windowState.x
43− target.y = windowState.y
44− target.width = windowState.width
45− target.height = windowState.height
67+ var windowGeometry = windowStateStorage.getGeometry(root.windowId, Qt.rect(target.x, target.y, target.width, target.height))
68+ if (windowGeometry !== undefined) {
69+ target.x = windowGeometry.x
70+ target.y = windowGeometry.y
71+ target.width = windowGeometry.width
72+ target.height = windowGeometry.height
73+ }
74+ var windowState = windowStateStorage.getState(root.windowId, WindowStateStorage.WindowStateNormal)
75+ if (windowState === WindowStateStorage.WindowStateMaximized) {
76+ target.maximize(false)
4677 }
78+ priv.updateNormalGeometry();
4779 }
4880
4981 Component.onDestruction: {
50− windowStateStorage.saveGeometry(root.windowId, Qt.rect(target.x, target.y, target.width, target.height))
82+ windowStateStorage.saveState(root.windowId, target.state == "maximized" ? WindowStateStorage.WindowStateMaximized : WindowStateStorage.WindowStateNormal)
83+ windowStateStorage.saveGeometry(root.windowId, Qt.rect(priv.normalX, priv.normalY, priv.normalWidth, priv.normalHeight))
5184 }
5285
5386 QtObject {
qml/Stages/graphics/background_paper@27.pngdeleted
Binary file not shown.
qml/Tutorial/Arrow.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: root
qml/Tutorial/Slider.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: root
qml/Tutorial/Tick.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020MouseArea {
2121 implicitHeight: tick.height
qml/Tutorial/Tutorial.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: root
qml/Tutorial/TutorialBottom.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import "../Components"
2121import "." as LocalComponents
qml/Tutorial/TutorialBottomFinish.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "." as LocalComponents
2020
2121TutorialPage {
qml/Tutorial/TutorialContent.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 id: root
qml/Tutorial/TutorialLeft.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "." as LocalComponents
2020
2121TutorialPage {
qml/Tutorial/TutorialLeftFinish.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "." as LocalComponents
2020
2121TutorialPage {
qml/Tutorial/TutorialPage.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121Showable {
qml/Tutorial/TutorialRight.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import Unity.Application 0.1
2121import "../Components"
qml/Wizard/CheckableSetting.qml+5−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.ListItems 1.0 as ListItem
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3 as ListItem
2020
2121ListItem.Empty {
2222 id: listItem
@@ -77,7 +77,7 @@ ListItem.Empty {
7777 rightMargin: listItem.rightMargin
7878 }
7979 wrapMode: Text.Wrap
80− linkColor: Theme.palette.normal.foregroundText
80+ linkColor: theme.palette.normal.foregroundText
8181 onLinkActivated: listItem.linkActivated(link)
8282 }
8383 }
qml/Wizard/Page.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020Item {
2121 readonly property real buttonMargin: units.gu(2)
@@ -57,7 +57,7 @@ Item {
5757 }
5858 wrapMode: Text.Wrap
5959 text: title
60− color: Theme.palette.normal.baseText
60+ color: theme.palette.normal.baseText
6161 font.pixelSize: units.gu(4)
6262 }
6363
qml/Wizard/Pages.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.SystemSettings.SecurityPrivacy 1.0
2020import Wizard 0.1
2121import "../Components"
qml/Wizard/Pages/10-welcome.qml+3−3
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.ListItems 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3
2020import Ubuntu.SystemSettings.LanguagePlugin 1.0
2121import Wizard 0.1
2222import ".." as LocalComponents
qml/Wizard/Pages/20-sim.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import MeeGo.QOfono 0.2
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import ".." as LocalComponents
2121
2222LocalComponents.Page {
qml/Wizard/Pages/30-passwd-type.qml+7−7
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
19−import Ubuntu.Components.ListItems 1.0
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
19+import Ubuntu.Components.ListItems 1.3
2020import Ubuntu.SystemSettings.SecurityPrivacy 1.0
2121import ".." as LocalComponents
2222
@@ -111,13 +111,13 @@ LocalComponents.Page {
111111
112112 Component.onCompleted: {
113113 // A visible selected background looks bad in ListItem widgets with our theme
114− originalBackground = Theme.palette.selected.background
115− Theme.palette.selected.background = "transparent"
114+ originalBackground = theme.palette.selected.background
115+ theme.palette.selected.background = "transparent"
116116 }
117117
118118 Component.onDestruction: {
119119 // Restore original theme background
120− Theme.palette.selected.background = originalBackground
120+ theme.palette.selected.background = originalBackground
121121 }
122122 }
123123 }
qml/Wizard/Pages/40-wifi.qml+3−3
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QMenuModel 0.1 as QMenuModel
1919import QtSystemInfo 5.0
20−import Ubuntu.Components 0.1
21−import Ubuntu.Components.ListItems 0.1 as ListItem
20+import Ubuntu.Components 1.3
21+import Ubuntu.Components.ListItems 1.3 as ListItem
2222import Ubuntu.Settings.Menus 0.1 as Menus
2323import ".." as LocalComponents
2424
qml/Wizard/Pages/50-location.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013,2014 Canonical, Ltd.
2+ * Copyright (C) 2013-2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import AccountsService 0.1
1919import QMenuModel 0.1 as QMenuModel
2020import Qt.labs.folderlistmodel 2.1
21−import Ubuntu.Components 1.1
21+import Ubuntu.Components 1.3
2222import ".." as LocalComponents
2323
2424LocalComponents.Page {
@@ -98,7 +98,7 @@ LocalComponents.Page {
9898 anchors.leftMargin: hereCheck.labelOffset
9999 anchors.right: parent.right
100100 wrapMode: Text.Wrap
101− linkColor: Theme.palette.normal.foregroundText
101+ linkColor: theme.palette.normal.foregroundText
102102 // Translators: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
103103 text: i18n.tr("By selecting this option you agree to the Nokia HERE <a href='#'>terms and conditions</a>.")
104104 onLinkActivated: pageStack.load(Qt.resolvedUrl("here-terms.qml"))
qml/Wizard/Pages/60-reporting.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.SystemSettings.Diagnostics 1.0
2020import ".." as LocalComponents
2121
qml/Wizard/Pages/80-finished.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import ".." as LocalComponents
2020
2121LocalComponents.Page {
qml/Wizard/Pages/here-terms.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import AccountsService 0.1
1919import Qt.labs.folderlistmodel 2.1
20−import Ubuntu.Components 1.1
20+import Ubuntu.Components 1.3
2121import Ubuntu.Web 0.2
2222import ".." as LocalComponents
2323
@@ -102,7 +102,7 @@ LocalComponents.Page {
102102 anchors.left: parent.left
103103 anchors.right: parent.right
104104 wrapMode: Text.Wrap
105− linkColor: Theme.palette.normal.foregroundText
105+ linkColor: theme.palette.normal.foregroundText
106106 onLinkActivated: {
107107 webview.url = link
108108 termsLabel.visible = false
qml/Wizard/Pages/passwd-confirm.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.SystemSettings.SecurityPrivacy 1.0
2020import ".." as LocalComponents
2121import "../../Components" as UnityComponents
qml/Wizard/Pages/passwd-set.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.SystemSettings.SecurityPrivacy 1.0
2020import ".." as LocalComponents
2121import "../../Components" as UnityComponents
qml/Wizard/StackButton.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2014 Canonical, Ltd.
2+ * Copyright (C) 2014,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919
2020AbstractButton {
2121 id: stackButton
@@ -32,7 +32,7 @@ AbstractButton {
3232 anchors.verticalCenter: parent.verticalCenter
3333 anchors.left: parent.left
3434 anchors.right: parent.right
35− color: enabled ? Theme.palette.selected.backgroundText : Qt.darker(Theme.palette.selected.backgroundText, 1.5)
35+ color: enabled ? theme.palette.selected.backgroundText : Qt.darker(theme.palette.selected.backgroundText, 1.5)
3636 text: {
3737 if (backArrow) {
3838 // Translators: This is the arrow for "Back" buttons
qml/Wizard/Wizard.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Wizard 0.1
2020import "../Components"
2121
qml/graphics/applicationIcons/libreoffice@18.pngnew file
Binary file not shown.
tests/CMakeLists.txt+1
@@ -132,3 +132,4 @@ add_subdirectory(libs)
132132add_subdirectory(plugins)
133133add_subdirectory(qmltests)
134134add_subdirectory(whitespace)
135+add_subdirectory(imports)
tests/autopilot/unity8/dash.py+3−3
@@ -158,7 +158,7 @@ class Dash(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
158158 def enter_search_query(self, query, keyboard):
159159 current_header = self._get_current_page_header()
160160 search_button = \
161− current_header.select_single(objectName="search_header_button")
161+ current_header.select_single(objectName="search_action_button")
162162 self.pointing_device.move(
163163 search_button.globalRect.x + search_button.width / 2,
164164 search_button.globalRect.y + search_button.height / 2)
@@ -224,7 +224,7 @@ class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
224224 """
225225 category_element = self._get_category_element(category)
226226 icon = category_element.wait_select_single(
227− 'AbstractButton', title=title)
227+ 'UCAbstractButton', title=title)
228228 list_view = self.select_single(
229229 ListViewWithPageHeader, objectName='categoryListView')
230230 list_view.swipe_child_into_view(icon)
@@ -247,7 +247,7 @@ class GenericScopeView(ubuntuuitoolkit.UbuntuUIToolkitCustomProxyObjectBase):
247247 """
248248 category_element = self._get_category_element(category)
249249 see_all = category_element.select_single(objectName='seeAll')
250− application_cards = category_element.select_many('AbstractButton')
250+ application_cards = category_element.select_many('UCAbstractButton')
251251
252252 application_cards = sorted(
253253 (card for card in application_cards
tests/autopilot/unity8/process_helpers.py+1−1
@@ -146,7 +146,7 @@ def stop_job(name):
146146 :raises CalledProcessError: if the job failed to stop.
147147
148148 """
149− logger.info('Stoping job {}.'.format(name))
149+ logger.info('Stopping job {}.'.format(name))
150150 command = ['/sbin/initctl', 'stop', name]
151151 try:
152152 output = subprocess.check_output(
tests/imports/CMakeLists.txtnew file+5
@@ -0,0 +1,5 @@
1+
2+#
3+# Test that all imports for QtQuick and Ubuntu.Components use the wanted version
4+#
5+add_test(imports ${CMAKE_CURRENT_SOURCE_DIR}/check_imports.py ${CMAKE_SOURCE_DIR} ${CMAKE_BINARY_DIR})
tests/imports/check_imports.pynew file+125
@@ -0,0 +1,125 @@
1+#! /usr/bin/env python3
2+
3+#
4+# Copyright (C) 2015 Canonical Ltd
5+#
6+# This program is free software: you can redistribute it and/or modify
7+# it under the terms of the GNU General Public License version 3 as
8+# published by the Free Software Foundation.
9+#
10+# This program is distributed in the hope that it will be useful,
11+# but WITHOUT ANY WARRANTY; without even the implied warranty of
12+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13+# GNU General Public License for more details.
14+#
15+# You should have received a copy of the GNU General Public License
16+# along with this program. If not, see <http://www.gnu.org/licenses/>.
17+#
18+
19+#
20+# Little helper program to test that all source files import
21+# versions we want
22+#
23+# Usage: check_imports.py directory [ignore_prefix]
24+#
25+# The directory specifies the (recursive) location of the source files. Any
26+# files with a path that starts with ignore_prefix are not checked. This is
27+# useful to exclude files that are generated into the build directory.
28+#
29+# See the file_pat definition below for a list of files that are checked.
30+#
31+
32+from __future__ import print_function
33+
34+import argparse
35+import os
36+import re
37+import sys
38+
39+
40+# Print msg on stderr, preceded by program name and followed by newline
41+def error(msg):
42+ print(os.path.basename(sys.argv[0]) + ": " + msg, file=sys.stderr)
43+
44+
45+# Function to raise errors encountered by os.walk
46+def raise_error(e):
47+ raise e
48+
49+# Qt Quick patterns
50+# If you increase this make sure you increase
51+# the Qt version in debian/control and in CMakeLists.txt
52+quick_pat = re.compile(r'.*import QtQuick.*$')
53+quick_good_pat = re.compile(r'.*import QtQuick 2\.4.*$')
54+quick_layouts_good_pat = re.compile(r'.*import QtQuick.Layouts 1\.1.*$')
55+quick_window_good_pat = re.compile(r'.*import QtQuick.Window 2\.2.*$')
56+
57+# Ubuntu Components patterns
58+ubuntu_components_pat = re.compile(r'.*import Ubuntu.Components.*')
59+ubuntu_good_components_pat = re.compile(r'.*import Ubuntu.Components.*1\.3.*')
60+
61+def scan_for_bad_import(file_path, all_pat, good_pats):
62+ errors = []
63+ with open(file_path, 'rt', encoding='utf-8') as ifile:
64+ for lino, line in enumerate(ifile, start=1):
65+ if all_pat.match(line):
66+ good_found = False
67+ for good_pat in good_pats:
68+ if good_pat.match(line):
69+ good_found = True
70+ if not good_found:
71+ errors.append(lino)
72+ if 0 < len(errors) <= 10:
73+ if len(errors) > 1:
74+ plural = 's'
75+ else:
76+ plural = ''
77+ print(
78+ "%s: bad import version in line%s %s" % (
79+ file_path, plural, ", ".join((str(i) for i in errors))))
80+ elif errors:
81+ print("%s: bad import version in multiple lines" % file_path)
82+ return bool(errors)
83+
84+# Parse args
85+
86+parser = argparse.ArgumentParser(
87+ description='Test that source files contain the wanted import version.')
88+parser.add_argument(
89+ 'dir', nargs=1,
90+ help='The directory to (recursively) search for source files')
91+parser.add_argument(
92+ 'ignore_prefix', nargs='?', default=None,
93+ help='Ignore source files with a path that starts with the given prefix.')
94+args = parser.parse_args()
95+
96+# Files we want to check for import version.
97+
98+file_pat = (
99+ r'(.*\.(js|qml)$)')
100+pat = re.compile(file_pat)
101+
102+# Find all the files with matching file extension in the specified
103+# directory and check them
104+
105+directory = os.path.abspath(args.dir[0])
106+ignore = args.ignore_prefix and os.path.abspath(args.ignore_prefix) or None
107+
108+found_bad_import = False
109+try:
110+ for root, dirs, files in os.walk(directory, onerror=raise_error):
111+ for file in files:
112+ path = os.path.join(root, file)
113+ if not (ignore and path.startswith(ignore)) and pat.match(file):
114+ quick_good_pats = [quick_good_pat, quick_layouts_good_pat, quick_window_good_pat]
115+ if scan_for_bad_import(path, quick_pat, quick_good_pats):
116+ found_bad_import = True
117+ if scan_for_bad_import(path, ubuntu_components_pat, [ubuntu_good_components_pat]):
118+ found_bad_import = True
119+
120+except OSError as e:
121+ error("cannot create file list for \"" + dir + "\": " + e.strerror)
122+ sys.exit(1)
123+
124+if found_bad_import:
125+ sys.exit(1)
tests/mocks/GSettings.1.0/fake_gsettings.cpp+31
@@ -75,6 +75,19 @@ void GSettingsControllerQml::setLockedOutTime(qint64 timestamp)
7575 }
7676}
7777
78+QStringList GSettingsControllerQml::lifecycleExemptAppids() const
79+{
80+ return m_lifecycleExemptAppids;
81+}
82+
83+void GSettingsControllerQml::setLifecycleExemptAppids(const QStringList &appIds)
84+{
85+ if (m_lifecycleExemptAppids != appIds) {
86+ m_lifecycleExemptAppids = appIds;
87+ Q_EMIT lifecycleExemptAppidsChanged(m_lifecycleExemptAppids);
88+ }
89+}
90+
7891GSettingsSchemaQml::GSettingsSchemaQml(QObject *parent): QObject(parent) {
7992}
8093
@@ -114,6 +127,8 @@ GSettingsQml::GSettingsQml(QObject *parent)
114127 this, &GSettingsQml::usageModeChanged);
115128 connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::lockedOutTimeChanged,
116129 this, &GSettingsQml::lockedOutTimeChanged);
130+ connect(GSettingsControllerQml::instance(), &GSettingsControllerQml::lifecycleExemptAppidsChanged,
131+ this, &GSettingsQml::lifecycleExemptAppidsChanged);
117132}
118133
119134GSettingsSchemaQml * GSettingsQml::schema() const {
@@ -167,3 +182,19 @@ void GSettingsQml::setLockedOutTime(qint64 timestamp)
167182 GSettingsControllerQml::instance()->setLockedOutTime(timestamp);
168183 }
169184}
185+
186+QStringList GSettingsQml::lifecycleExemptAppids() const
187+{
188+ if (m_schema->id() == "com.canonical.qtmir") {
189+ return GSettingsControllerQml::instance()->lifecycleExemptAppids();
190+ } else {
191+ return QStringList();
192+ }
193+}
194+
195+void GSettingsQml::setLifecycleExemptAppids(const QStringList &appIds)
196+{
197+ if (m_schema->id() == "com.canonical.qtmir") {
198+ GSettingsControllerQml::instance()->setLifecycleExemptAppids(appIds);
199+ }
200+}
tests/mocks/GSettings.1.0/fake_gsettings.h+10
@@ -19,6 +19,7 @@
1919
2020#include <QList>
2121#include <QObject>
22+#include <QStringList>
2223
2324class GSettingsSchemaQml: public QObject
2425{
@@ -48,6 +49,7 @@ class GSettingsQml: public QObject
4849 Q_PROPERTY(QString pictureUri READ pictureUri WRITE setPictureUri NOTIFY pictureUriChanged)
4950 Q_PROPERTY(QString usageMode READ usageMode WRITE setUsageMode NOTIFY usageModeChanged)
5051 Q_PROPERTY(qint64 lockedOutTime READ lockedOutTime WRITE setLockedOutTime NOTIFY lockedOutTimeChanged)
52+ Q_PROPERTY(QStringList lifecycleExemptAppids READ lifecycleExemptAppids WRITE setLifecycleExemptAppids NOTIFY lifecycleExemptAppidsChanged)
5153
5254public:
5355 GSettingsQml(QObject *parent = nullptr);
@@ -56,16 +58,19 @@ public:
5658 QString pictureUri() const;
5759 QString usageMode() const;
5860 qint64 lockedOutTime() const;
61+ QStringList lifecycleExemptAppids() const;
5962
6063 void setPictureUri(const QString &str);
6164 void setUsageMode(const QString &usageMode);
6265 void setLockedOutTime(qint64 timestamp);
66+ void setLifecycleExemptAppids(const QStringList &appIds);
6367
6468Q_SIGNALS:
6569 void schemaChanged();
6670 void pictureUriChanged(const QString&);
6771 void usageModeChanged(const QString&);
6872 void lockedOutTimeChanged(qint64);
73+ void lifecycleExemptAppidsChanged(const QStringList &);
6974
7075private:
7176 GSettingsSchemaQml* m_schema;
@@ -90,10 +95,14 @@ public:
9095 qint64 lockedOutTime() const;
9196 Q_INVOKABLE void setLockedOutTime(qint64 timestamp);
9297
98+ QStringList lifecycleExemptAppids() const;
99+ Q_INVOKABLE void setLifecycleExemptAppids(const QStringList &appIds);
100+
93101Q_SIGNALS:
94102 void pictureUriChanged(const QString&);
95103 void usageModeChanged(const QString&);
96104 void lockedOutTimeChanged(qint64 timestamp);
105+ void lifecycleExemptAppidsChanged(const QStringList&);
97106
98107private:
99108 GSettingsControllerQml();
@@ -101,6 +110,7 @@ private:
101110 QString m_pictureUri;
102111 QString m_usageMode;
103112 qint64 m_lockedOutTime;
113+ QStringList m_lifecycleExemptAppids;
104114
105115 static GSettingsControllerQml* s_controllerInstance;
106116 QList<GSettingsQml *> m_registeredGSettings;
tests/mocks/MeeGo/QOfono/MockOfonoSimManager.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import MeeGo.QOfono 0.2
1919
2020Item {
tests/mocks/QMenuModel/QDBusActionGroup.qml+2−2
@@ -17,7 +17,7 @@
1717 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1818 */
1919
20−import QtQuick 2.0
20+import QtQuick 2.4
2121import Ubuntu.Settings.Menus 0.1 as Menus
2222import QMenuModel 0.1
2323
@@ -34,7 +34,7 @@ QtObject {
3434
3535 function action(actionName) {
3636 return Qt.createQmlObject("
37− import QtQuick 2.3
37+ import QtQuick 2.4
3838 import QMenuModel 0.1
3939
4040 QtObject {
tests/mocks/QMenuModel/UnityMenuAction.qml+1−1
@@ -17,7 +17,7 @@
1717 * Nick Dedekind <nick.dedekind@canonical.com>
1818 */
1919
20−import QtQuick 2.0
20+import QtQuick 2.4
2121import QMenuModel 0.1
2222
2323QtObject {
tests/mocks/Ubuntu/SystemSettings/LanguagePlugin/MockLanguagePlugin.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818
1919Item {
2020 property var languageNames: ["English", "French", "Spanish"]
tests/mocks/Ubuntu/Web/WebView.qml+1−1
@@ -15,7 +15,7 @@
1515 *
1616 */
1717
18−import QtQuick 2.0
18+import QtQuick 2.4
1919
2020Item {
2121 property url url
tests/mocks/Unity/Application/ApplicationInfo.cpp+12
@@ -41,6 +41,7 @@ ApplicationInfo::ApplicationInfo(const QString &appId, QObject *parent)
4141 Qt::InvertedLandscapeOrientation)
4242 , m_rotatesWindowContents(false)
4343 , m_requestedState(RequestedRunning)
44+ , m_isTouchApp(true)
4445 , m_manualSurfaceCreation(false)
4546{
4647}
@@ -58,6 +59,7 @@ ApplicationInfo::ApplicationInfo(QObject *parent)
5859 Qt::InvertedLandscapeOrientation)
5960 , m_rotatesWindowContents(false)
6061 , m_requestedState(RequestedRunning)
62+ , m_isTouchApp(true)
6163 , m_manualSurfaceCreation(false)
6264{
6365}
@@ -245,6 +247,16 @@ void ApplicationInfo::setRequestedState(RequestedState value)
245247 }
246248}
247249
250+bool ApplicationInfo::isTouchApp() const
251+{
252+ return m_isTouchApp;
253+}
254+
255+void ApplicationInfo::setIsTouchApp(bool isTouchApp)
256+{
257+ m_isTouchApp = isTouchApp;
258+}
259+
248260void ApplicationInfo::onSessionSurfaceChanged(MirSurface* surface)
249261{
250262 if (surface != nullptr && m_state == Starting) {
tests/mocks/Unity/Application/ApplicationInfo.h+4
@@ -89,6 +89,9 @@ public:
8989 bool manualSurfaceCreation() const { return m_manualSurfaceCreation; }
9090 void setManualSurfaceCreation(bool value);
9191
92+ bool isTouchApp() const override;
93+ void setIsTouchApp(bool isTouchApp); // only in mock
94+
9295public:
9396 void setSession(Session* session);
9497 Session* session() const { return m_session; }
@@ -121,6 +124,7 @@ private:
121124 Qt::ScreenOrientations m_supportedOrientations;
122125 bool m_rotatesWindowContents;
123126 RequestedState m_requestedState;
127+ bool m_isTouchApp;
124128
125129 bool m_manualSurfaceCreation;
126130};
tests/mocks/Unity/Application/ApplicationManager.cpp+9
@@ -105,6 +105,8 @@ QVariant ApplicationManager::data(const QModelIndex& index, int role) const {
105105 return app->state();
106106 case RoleFocused:
107107 return app->focused();
108+ case RoleIsTouchApp:
109+ return app->isTouchApp();
108110 case RoleSession:
109111 return QVariant::fromValue(app->session());
110112 case RoleFullscreen:
@@ -458,6 +460,13 @@ void ApplicationManager::buildListOfAvailableApplications()
458460 application->setName("YouTube");
459461 application->setIconId("youtube");
460462 m_availableApplications.append(application);
463+
464+ application = new ApplicationInfo(this);
465+ application->setAppId("libreoffice");
466+ application->setName("LibreOffice");
467+ application->setIconId("libreoffice");
468+ application->setIsTouchApp(false);
469+ m_availableApplications.append(application);
461470}
462471
463472
tests/mocks/Unity/Application/ApplicationManager.h+1−1
@@ -43,7 +43,7 @@ class ApplicationManager : public ApplicationManagerInterface {
4343 static ApplicationManager *singleton();
4444
4545 enum MoreRoles {
46− RoleSession = RoleFocused+1,
46+ RoleSession = RoleIsTouchApp+1,
4747 RoleFullscreen,
4848 };
4949 enum Flag {
tests/mocks/Unity/Application/MirSurface.cpp+41−14
@@ -31,7 +31,7 @@ MirSurface::MirSurface(const QString& name,
3131 , m_screenshotUrl(screenshot)
3232 , m_qmlFilePath(qmlFilePath)
3333 , m_live(true)
34− , m_viewCount(0)
34+ , m_visible(true)
3535 , m_activeFocus(false)
3636 , m_width(-1)
3737 , m_height(-1)
@@ -73,6 +73,11 @@ bool MirSurface::live() const
7373 return m_live;
7474}
7575
76+bool MirSurface::visible() const
77+{
78+ return m_visible;
79+}
80+
7681void MirSurface::setLive(bool live)
7782{
7883// qDebug().nospace() << "MirSurface::setLive("<<live<<") " << name();
@@ -82,7 +87,7 @@ void MirSurface::setLive(bool live)
8287 m_live = live;
8388 Q_EMIT liveChanged(live);
8489
85− if (!m_live && m_viewCount == 0) {
90+ if (!m_live && m_views.count() == 0) {
8691 deleteLater();
8792 }
8893}
@@ -120,27 +125,49 @@ void MirSurface::setOrientationAngle(Mir::OrientationAngle angle)
120125 Q_EMIT orientationAngleChanged(angle);
121126}
122127
123−void MirSurface::incrementViewCount()
128+
129+
130+void MirSurface::registerView(qintptr viewId)
124131{
125− ++m_viewCount;
126−// qDebug().nospace() << "MirSurface::incrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
132+ m_views.insert(viewId, MirSurface::View{false});
133+// qDebug().nospace() << "MirSurface[" << name() << "]::registerView(" << viewId << ")"
134+// << " after=" << m_views.count();
127135}
128136
129−void MirSurface::decrementViewCount()
137+void MirSurface::unregisterView(qintptr viewId)
130138{
131− --m_viewCount;
132−// qDebug().nospace() << "MirSurface::decrementViewCount() viewCount(after)=" << m_viewCount << " " << name();
133−
134− Q_ASSERT(m_viewCount >= 0);
135−
136− if (!m_live && m_viewCount == 0) {
139+// qDebug().nospace() << "MirSurface[" << name() << "]::unregisterView(" << viewId << ")"
140+// << " after=" << m_views.count() << " live=" << m_live;
141+ m_views.remove(viewId);
142+ if (!m_live && m_views.count() == 0) {
137143 deleteLater();
138144 }
145+ updateVisibility();
139146}
140147
141−int MirSurface::viewCount() const
148+void MirSurface::setViewVisibility(qintptr viewId, bool visible)
142149{
143− return m_viewCount;
150+ if (!m_views.contains(viewId)) return;
151+
152+ m_views[viewId].visible = visible;
153+ updateVisibility();
154+}
155+
156+void MirSurface::updateVisibility()
157+{
158+ bool newVisible = false;
159+ QHashIterator<qintptr, View> i(m_views);
160+ while (i.hasNext()) {
161+ i.next();
162+ newVisible |= i.value().visible;
163+ }
164+
165+ if (newVisible != visible()) {
166+// qDebug().nospace() << "MirSurface[" << name() << "]::updateVisibility(" << newVisible << ")";
167+
168+ m_visible = newVisible;
169+ Q_EMIT visibleChanged(m_visible);
170+ }
144171}
145172
146173bool MirSurface::activeFocus() const
tests/mocks/Unity/Application/MirSurface.h+14−4
@@ -19,6 +19,7 @@
1919
2020#include <QObject>
2121#include <QUrl>
22+#include <QHash>
2223
2324// unity-api
2425#include <unity/shell/application/MirSurfaceInterface.h>
@@ -58,6 +59,8 @@ public:
5859
5960 bool live() const override;
6061
62+ bool visible() const override;
63+
6164 Mir::OrientationAngle orientationAngle() const override;
6265 void setOrientationAngle(Mir::OrientationAngle) override;
6366
@@ -66,9 +69,10 @@ public:
6669
6770 Q_INVOKABLE void setLive(bool live);
6871
69− void incrementViewCount();
70− void decrementViewCount();
71− int viewCount() const;
72+ void registerView(qintptr viewId);
73+ void unregisterView(qintptr viewId);
74+ void setViewVisibility(qintptr viewId, bool visible);
75+ int viewCount() const { return m_views.count(); }
7276
7377 int width() const;
7478 int height() const;
@@ -97,6 +101,8 @@ Q_SIGNALS:
97101 void activeFocusChanged(bool);
98102
99103private:
104+ void updateVisibility();
105+
100106 const QString m_name;
101107 const Mir::Type m_type;
102108 Mir::State m_state;
@@ -104,10 +110,14 @@ private:
104110 QUrl m_screenshotUrl;
105111 QUrl m_qmlFilePath;
106112 bool m_live;
107− int m_viewCount;
113+ bool m_visible;
108114 bool m_activeFocus;
109115 int m_width;
110116 int m_height;
117+ struct View {
118+ bool visible;
119+ };
120+ QHash<qintptr, View> m_views;
111121};
112122
113123#endif // MOCK_MIR_SURFACE_H
tests/mocks/Unity/Application/MirSurfaceItem.cpp+12−2
@@ -44,6 +44,8 @@ MirSurfaceItem::MirSurfaceItem(QQuickItem *parent)
4444 Qt::ExtraButton5 | Qt::ExtraButton6 | Qt::ExtraButton7 | Qt::ExtraButton8 |
4545 Qt::ExtraButton9 | Qt::ExtraButton10 | Qt::ExtraButton11 |
4646 Qt::ExtraButton12 | Qt::ExtraButton13);
47+
48+ connect(this, &QQuickItem::visibleChanged, this, &MirSurfaceItem::updateMirSurfaceVisibility);
4749}
4850
4951MirSurfaceItem::~MirSurfaceItem()
@@ -194,17 +196,18 @@ void MirSurfaceItem::setSurface(MirSurfaceInterface* surface)
194196 m_qmlContentComponent = nullptr;
195197
196198 disconnect(m_qmlSurface, nullptr, this, nullptr);
197− m_qmlSurface->decrementViewCount();
199+ m_qmlSurface->unregisterView((qintptr)this);
198200 }
199201
200202 m_qmlSurface = static_cast<MirSurface*>(surface);
201203
202204 if (m_qmlSurface) {
203− m_qmlSurface->incrementViewCount();
205+ m_qmlSurface->registerView((qintptr)this);
204206
205207 m_qmlSurface->setActiveFocus(hasActiveFocus());
206208
207209 updateSurfaceSize();
210+ updateMirSurfaceVisibility();
208211
209212 connect(m_qmlSurface, &MirSurface::orientationAngleChanged, this, &MirSurfaceItem::orientationAngleChanged);
210213 connect(m_qmlSurface, &MirSurface::screenshotUrlChanged, this, &MirSurfaceItem::updateScreenshot);
@@ -253,6 +256,13 @@ void MirSurfaceItem::itemChange(ItemChange change, const ItemChangeData & value)
253256 }
254257}
255258
259+void MirSurfaceItem::updateMirSurfaceVisibility()
260+{
261+ if (!m_qmlSurface) return;
262+
263+ m_qmlSurface->setViewVisibility((qintptr)this, isVisible());
264+}
265+
256266void MirSurfaceItem::setConsumesInput(bool value)
257267{
258268 if (m_consumesInput != value) {
tests/mocks/Unity/Application/MirSurfaceItem.h+1
@@ -87,6 +87,7 @@ protected:
8787private Q_SLOTS:
8888 void onComponentStatusChanged(QQmlComponent::Status status);
8989 void updateScreenshot(QUrl screenshot);
90+ void updateMirSurfaceVisibility();
9091
9192private:
9293 void createQmlContentItem();
tests/mocks/Unity/Application/resources/MirSurfaceItem.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Rectangle {
2020 id: root
tests/mocks/Unity/Application/resources/VirtualKeyboard.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Unity.Application 0.1
1919
2020Item {
tests/mocks/Unity/Indicators/ActionRootState.qml+1−1
@@ -17,7 +17,7 @@
1717 * Nick Dedekind <nick.dedekind@canonical.com>
1818 */
1919
20−import QtQuick 2.0
20+import QtQuick 2.4
2121
2222QtObject {
2323 property var actionGroup
tests/mocks/Unity/Indicators/IndicatorsModel.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Unity.Indicators 0.1 as Indicators
1919
2020Indicators.FakeIndicatorsModel {
tests/mocks/Unity/Indicators/ModelActionRootState.qml+1−1
@@ -17,7 +17,7 @@
1717 * Nick Dedekind <nick.dedekind@canonical.com>
1818 */
1919
20−import QtQuick 2.0
20+import QtQuick 2.4
2121
2222Item {
2323 property var menu: null
tests/mocks/Utils/HomeKeyWatcher.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919QtObject {
2020 signal activated()
tests/mocks/Utils/windowstatestorage.cpp+17
@@ -44,3 +44,20 @@ QRect WindowStateStorage::getGeometry(const QString &windowId, const QRect &defa
4444 if (!m_geometry.contains(windowId)) return defaultValue;
4545 return m_geometry.value(windowId).toRect();
4646}
47+
48+void WindowStateStorage::clear()
49+{
50+ m_state.clear();
51+ m_geometry.clear();
52+}
53+
54+void WindowStateStorage::saveState(const QString &windowId, WindowState state)
55+{
56+ m_state[windowId] = state;
57+}
58+
59+WindowStateStorage::WindowState WindowStateStorage::getState(const QString &windowId, WindowStateStorage::WindowState defaultValue)
60+{
61+ if (!m_state.contains(windowId)) return defaultValue;
62+ return m_state.value(windowId);
63+}
tests/mocks/Utils/windowstatestorage.h+12
@@ -22,12 +22,23 @@ class WindowStateStorage: public QObject
2222{
2323 Q_OBJECT
2424 Q_PROPERTY(QVariantMap geometry READ geometry WRITE setGeometry NOTIFY geometryChanged)
25+ Q_ENUMS(WindowState)
2526public:
27+ enum WindowState {
28+ WindowStateNormal,
29+ WindowStateMaximized
30+ };
2631 WindowStateStorage(QObject *parent = 0);
2732
33+ Q_INVOKABLE void saveState(const QString &windowId, WindowState state);
34+ Q_INVOKABLE WindowState getState(const QString &windowId, WindowState defaultValue);
35+
2836 Q_INVOKABLE void saveGeometry(const QString &windowId, const QRect &rect);
2937 Q_INVOKABLE QRect getGeometry(const QString &windowId, const QRect &defaultValue);
3038
39+ // Only in the mock, to easily restore a fresh state
40+ Q_INVOKABLE void clear();
41+
3142Q_SIGNALS:
3243 void geometryChanged(const QVariantMap& geometry);
3344
@@ -35,5 +46,6 @@ private:
3546 void setGeometry(const QVariantMap& geometry);
3647 QVariantMap geometry() const;
3748
49+ QHash<QString, WindowState> m_state;
3850 QVariantMap m_geometry;
3951};
tests/plugins/Dash/cardcreator/1.res+7−8
@@ -2,7 +2,7 @@ AbstractButton {
22 id: root;
33 property var components;
44 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
66 property real fontScale: 1.0;
77 property var scopeStyle: null;
88 property int titleAlignment: Text.AlignLeft;
@@ -14,7 +14,6 @@ AbstractButton {
1414 implicitWidth: childrenRect.width;
1515 enabled: true;
1616
17−onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1817readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1918Item {
2019 id: artShapeHolder;
@@ -30,10 +29,9 @@ Item {
3029 sourceComponent: Item {
3130 id: artShape;
3231 objectName: "artShape";
33− property bool doShapeItem: components["art"]["conciergeMode"] !== true;
32+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
3433 visible: image.status == Image.Ready;
3534 readonly property alias image: artImage;
36− property alias borderSource: artShapeShape.borderSource;
3735 ShaderEffectSource {
3836 id: artShapeSource;
3937 sourceItem: artImage;
@@ -42,16 +40,17 @@ Item {
4240 height: 1;
4341 hideSource: doShapeItem;
4442 }
45− Shape {
43+ UbuntuShape {
4644 id: artShapeShape;
47− image: artShapeSource;
45+ source: artShapeSource;
4846 anchors.fill: parent;
4947 visible: doShapeItem;
5048 radius: "medium";
49+ aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
5150 }
5251 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
5352 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
54− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53+ Component.onCompleted: { updateWidthHeightBindings(); }
5554 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
5655 function updateWidthHeightBindings() {
5756 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
@@ -87,7 +86,7 @@ Label {
8786 wrapMode: Text.Wrap;
8887 maximumLineCount: 2;
8988 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
90− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
89+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
9190 visible: showHeader ;
9291 width: undefined;
9392 text: root.title;
tests/plugins/Dash/cardcreator/2.res+9−8
@@ -2,7 +2,7 @@ AbstractButton {
22 id: root;
33 property var components;
44 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
66 property real fontScale: 1.0;
77 property var scopeStyle: null;
88 property int titleAlignment: Text.AlignLeft;
@@ -23,11 +23,12 @@ Loader {
2323 sourceComponent: UbuntuShape {
2424 objectName: "background";
2525 radius: "medium";
26− color: getColor(0) || "white";
27− gradientColor: getColor(1) || color;
28− anchors.fill: parent;
29− image: backgroundImage.source ? backgroundImage : null;
30− property real luminance: Style.luminance(color);
26+ backgroundColor: getColor(0) || "white";
27+ secondaryBackgroundColor: getColor(1) || backgroundColor;
28+ backgroundMode: UbuntuShape.VerticalGradient;
29+ anchors.fill: parent;
30+ source: backgroundImage.source ? backgroundImage : null;
31+ property real luminance: Style.luminance(backgroundColor);
3132 property Image backgroundImage: Image {
3233 objectName: "backgroundImage";
3334 source: {
@@ -88,7 +89,7 @@ CroppedImageMinimumSourceSize {
8889 wrapMode: Text.Wrap;
8990 maximumLineCount: 2;
9091 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
91− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
92+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
9293 visible: showHeader ;
9394 width: undefined;
9495 text: root.title;
@@ -108,7 +109,7 @@ CroppedImageMinimumSourceSize {
108109 maximumLineCount: 1;
109110 fontSize: "x-small";
110111 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
111− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
112+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
112113 visible: titleLabel.visible && titleLabel.text;
113114 text: cardData && cardData["subtitle"] || "";
114115 font.weight: Font.Light;
tests/plugins/Dash/cardcreator/3.res+8−9
@@ -2,7 +2,7 @@ AbstractButton {
22 id: root;
33 property var components;
44 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
66 property real fontScale: 1.0;
77 property var scopeStyle: null;
88 property int titleAlignment: Text.AlignLeft;
@@ -14,7 +14,6 @@ AbstractButton {
1414 implicitWidth: childrenRect.width;
1515 enabled: true;
1616
17−onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1817readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1918Item {
2019 id: artShapeHolder;
@@ -30,10 +29,9 @@ Item {
3029 sourceComponent: Item {
3130 id: artShape;
3231 objectName: "artShape";
33− property bool doShapeItem: components["art"]["conciergeMode"] !== true;
32+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
3433 visible: image.status == Image.Ready;
3534 readonly property alias image: artImage;
36− property alias borderSource: artShapeShape.borderSource;
3735 ShaderEffectSource {
3836 id: artShapeSource;
3937 sourceItem: artImage;
@@ -42,16 +40,17 @@ Item {
4240 height: 1;
4341 hideSource: doShapeItem;
4442 }
45− Shape {
43+ UbuntuShape {
4644 id: artShapeShape;
47− image: artShapeSource;
45+ source: artShapeSource;
4846 anchors.fill: parent;
4947 visible: doShapeItem;
5048 radius: "medium";
49+ aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
5150 }
5251 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
5352 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
54− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53+ Component.onCompleted: { updateWidthHeightBindings(); }
5554 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
5655 function updateWidthHeightBindings() {
5756 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
@@ -87,7 +86,7 @@ Label {
8786 wrapMode: Text.Wrap;
8887 maximumLineCount: 2;
8988 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
90− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
89+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
9190 visible: showHeader ;
9291 width: undefined;
9392 text: root.title;
@@ -107,7 +106,7 @@ Label {
107106 maximumLineCount: 1;
108107 fontSize: "x-small";
109108 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
110− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
109+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
111110 visible: titleLabel.visible && titleLabel.text;
112111 text: cardData && cardData["subtitle"] || "";
113112 font.weight: Font.Light;
tests/plugins/Dash/cardcreator/4.res+3−3
@@ -2,7 +2,7 @@ AbstractButton {
22 id: root;
33 property var components;
44 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
66 property real fontScale: 1.0;
77 property var scopeStyle: null;
88 property int titleAlignment: Text.AlignLeft;
@@ -72,7 +72,7 @@ Label {
7272 wrapMode: Text.Wrap;
7373 maximumLineCount: 2;
7474 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
75− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
75+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
7676 visible: showHeader ;
7777 width: undefined;
7878 text: root.title;
@@ -92,7 +92,7 @@ Label {
9292 maximumLineCount: 1;
9393 fontSize: "x-small";
9494 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
95− color: root.scopeStyle ? root.scopeStyle.foreground : Theme.palette.normal.baseText;
95+ color: root.scopeStyle ? root.scopeStyle.foreground : theme.palette.normal.baseText;
9696 visible: titleLabel.visible && titleLabel.text;
9797 text: cardData && cardData["subtitle"] || "";
9898 font.weight: Font.Light;
tests/plugins/Dash/cardcreator/5.res+18−45
@@ -2,7 +2,7 @@ AbstractButton {
22 id: root;
33 property var components;
44 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
66 property real fontScale: 1.0;
77 property var scopeStyle: null;
88 property int titleAlignment: Text.AlignLeft;
@@ -14,7 +14,6 @@ AbstractButton {
1414 implicitWidth: childrenRect.width;
1515 enabled: false;
1616
17−onArtShapeBorderSourceChanged: { if (artShapeBorderSource !== undefined && artShapeLoader.item) artShapeLoader.item.borderSource = artShapeBorderSource; }
1817readonly property size artShapeSize: artShapeLoader.item ? Qt.size(artShapeLoader.item.width, artShapeLoader.item.height) : Qt.size(-1, -1);
1918Item {
2019 id: artShapeHolder;
@@ -30,10 +29,9 @@ Item {
3029 sourceComponent: Item {
3130 id: artShape;
3231 objectName: "artShape";
33− property bool doShapeItem: components["art"]["conciergeMode"] !== true;
32+ readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
3433 visible: image.status == Image.Ready;
3534 readonly property alias image: artImage;
36− property alias borderSource: artShapeShape.borderSource;
3735 ShaderEffectSource {
3836 id: artShapeSource;
3937 sourceItem: artImage;
@@ -42,16 +40,17 @@ Item {
4240 height: 1;
4341 hideSource: doShapeItem;
4442 }
45− Shape {
43+ UbuntuShape {
4644 id: artShapeShape;
47− image: artShapeSource;
45+ source: artShapeSource;
4846 anchors.fill: parent;
4947 visible: doShapeItem;
5048 radius: "medium";
49+ aspect: root.artShapeStyle === "inset" ? UbuntuShape.Inset : UbuntuShape.Flat;
5150 }
5251 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
5352 readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
54− Component.onCompleted: { updateWidthHeightBindings(); if (artShapeBorderSource !== undefined) borderSource = artShapeBorderSource; }
53+ Component.onCompleted: { updateWidthHeightBindings(); }
5554 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
5655 function updateWidthHeightBindings() {
5756 if (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) {
@@ -75,44 +74,18 @@ Item {
7574 }
7675Loader {
7776 id: overlayLoader;
78− anchors {
79− left: artShapeHolder.left;
80− right: artShapeHolder.right;
81− bottom: artShapeHolder.bottom;
82− }
83− active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false;
77+ readonly property real overlayHeight: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2);
78+ anchors.fill: artShapeHolder;
79+ active: artShapeLoader.active && artShapeLoader.item && artShapeLoader.item.image.status === Image.Ready || false;
8480 asynchronous: root.asynchronous;
8581 visible: showHeader && status == Loader.Ready;
86− sourceComponent: ShaderEffect {
82+ sourceComponent: UbuntuShapeOverlay {
8783 id: overlay;
88− height: (fixedHeaderHeight > 0 ? fixedHeaderHeight : headerHeight) + units.gu(2);
89− property real luminance: Style.luminance(overlayColor);
90− property color overlayColor: cardData && cardData["overlayColor"] || "#99000000";
91− property var source: ShaderEffectSource {
92− id: shaderSource;
93− sourceItem: artShapeLoader.item;
94− onVisibleChanged: if (visible) scheduleUpdate();
95− live: false;
96− sourceRect: Qt.rect(0, artShapeLoader.height - overlay.height, artShapeLoader.width, overlay.height);
97− }
98− vertexShader: "
99− uniform highp mat4 qt_Matrix;
100− attribute highp vec4 qt_Vertex;
101− attribute highp vec2 qt_MultiTexCoord0;
102− varying highp vec2 coord;
103− void main() {
104− coord = qt_MultiTexCoord0;
105− gl_Position = qt_Matrix * qt_Vertex;
106− }";
107− fragmentShader: "
108− varying highp vec2 coord;
109− uniform sampler2D source;
110− uniform lowp float qt_Opacity;
111− uniform highp vec4 overlayColor;
112− void main() {
113− lowp vec4 tex = texture2D(source, coord);
114− gl_FragColor = vec4(overlayColor.r, overlayColor.g, overlayColor.b, 1) * qt_Opacity * overlayColor.a * tex.a;
115− }";
84+ property real luminance: Style.luminance(overlayColor);
85+ aspect: UbuntuShape.Flat;
86+ radius: "medium";
87+ overlayColor: cardData && cardData["overlayColor"] || "#99000000";
88+ overlayRect: Qt.rect(0, 1 - overlayLoader.overlayHeight / height, 1, 1);
11689 }
11790 }
11891readonly property int headerHeight: titleLabel.height + subtitleLabel.height + subtitleLabel.anchors.topMargin;
@@ -124,14 +97,14 @@ Label {
12497 left: parent.left;
12598 leftMargin: units.gu(1);
12699 top: overlayLoader.top;
127− topMargin: units.gu(1);
100+ topMargin: units.gu(1) + overlayLoader.height - overlayLoader.overlayHeight;
128101 }
129102 elide: Text.ElideRight;
130103 fontSize: "small";
131104 wrapMode: Text.Wrap;
132105 maximumLineCount: 2;
133106 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
134− color: root.scopeStyle && overlayLoader.item ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item && overlayLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
107+ color: root.scopeStyle && overlayLoader.item ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item && overlayLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
135108 visible: showHeader && overlayLoader.active;
136109 width: undefined;
137110 text: root.title;
@@ -152,7 +125,7 @@ Label {
152125 maximumLineCount: 1;
153126 fontSize: "x-small";
154127 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
155− color: root.scopeStyle && overlayLoader.item ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item && overlayLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
128+ color: root.scopeStyle && overlayLoader.item ? root.scopeStyle.getTextColor(overlayLoader.item.luminance) : (overlayLoader.item && overlayLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
156129 visible: titleLabel.visible && titleLabel.text;
157130 text: cardData && cardData["subtitle"] || "";
158131 font.weight: Font.Light;
tests/plugins/Dash/cardcreator/6.res+10−9
@@ -2,7 +2,7 @@ AbstractButton {
22 id: root;
33 property var components;
44 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
66 property real fontScale: 1.0;
77 property var scopeStyle: null;
88 property int titleAlignment: Text.AlignLeft;
@@ -23,11 +23,12 @@ Loader {
2323 sourceComponent: UbuntuShape {
2424 objectName: "background";
2525 radius: "medium";
26− color: getColor(0) || "white";
27− gradientColor: getColor(1) || color;
28− anchors.fill: parent;
29− image: backgroundImage.source ? backgroundImage : null;
30− property real luminance: Style.luminance(color);
26+ backgroundColor: getColor(0) || "white";
27+ secondaryBackgroundColor: getColor(1) || backgroundColor;
28+ backgroundMode: UbuntuShape.VerticalGradient;
29+ anchors.fill: parent;
30+ source: backgroundImage.source ? backgroundImage : null;
31+ property real luminance: Style.luminance(backgroundColor);
3132 property Image backgroundImage: Image {
3233 objectName: "backgroundImage";
3334 source: {
@@ -67,7 +68,7 @@ Item {
6768 wrapMode: Text.Wrap;
6869 maximumLineCount: 2;
6970 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
70− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
71+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
7172 visible: showHeader ;
7273 width: undefined;
7374 text: root.title;
@@ -87,7 +88,7 @@ Item {
8788 maximumLineCount: 1;
8889 fontSize: "x-small";
8990 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
90− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
91+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
9192 visible: titleLabel.visible && titleLabel.text;
9293 text: cardData && cardData["subtitle"] || "";
9394 font.weight: Font.Light;
@@ -101,7 +102,7 @@ Item {
101102 rightMargin: units.gu(1);
102103 }
103104 source: cardData && cardData["emblem"] || "";
104− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
105+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
105106 height: source != "" ? titleLabel.font.pixelSize : 0;
106107 width: implicitWidth > 0 && implicitHeight > 0 ? (implicitWidth / implicitHeight * height) : implicitWidth;
107108 }
tests/plugins/Dash/cardcreator/7.res+10−9
@@ -2,7 +2,7 @@ AbstractButton {
22 id: root;
33 property var components;
44 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
66 property real fontScale: 1.0;
77 property var scopeStyle: null;
88 property int titleAlignment: Text.AlignLeft;
@@ -23,11 +23,12 @@ Loader {
2323 sourceComponent: UbuntuShape {
2424 objectName: "background";
2525 radius: "medium";
26− color: getColor(0) || "white";
27− gradientColor: getColor(1) || color;
28− anchors.fill: parent;
29− image: backgroundImage.source ? backgroundImage : null;
30− property real luminance: Style.luminance(color);
26+ backgroundColor: getColor(0) || "white";
27+ secondaryBackgroundColor: getColor(1) || backgroundColor;
28+ backgroundMode: UbuntuShape.VerticalGradient;
29+ anchors.fill: parent;
30+ source: backgroundImage.source ? backgroundImage : null;
31+ property real luminance: Style.luminance(backgroundColor);
3132 property Image backgroundImage: Image {
3233 objectName: "backgroundImage";
3334 source: {
@@ -89,7 +90,7 @@ CroppedImageMinimumSourceSize {
8990 wrapMode: Text.Wrap;
9091 maximumLineCount: 2;
9192 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
92− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
93+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
9394 visible: showHeader ;
9495 width: undefined;
9596 text: root.title;
@@ -109,7 +110,7 @@ CroppedImageMinimumSourceSize {
109110 maximumLineCount: 1;
110111 fontSize: "x-small";
111112 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
112− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
113+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
113114 visible: titleLabel.visible && titleLabel.text;
114115 text: cardData && cardData["subtitle"] || "";
115116 font.weight: Font.Light;
@@ -122,7 +123,7 @@ CroppedImageMinimumSourceSize {
122123 rightMargin: units.gu(1);
123124 top: subtitleLabel.bottom;
124125 }
125− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
126+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
126127 fontScale: root.fontScale;
127128 model: cardData && cardData["attributes"];
128129 }
tests/plugins/Dash/cardcreator/8.res+7−6
@@ -2,7 +2,7 @@ AbstractButton {
22 id: root;
33 property var components;
44 property var cardData;
5− property var artShapeBorderSource: undefined;
5+ property string artShapeStyle: "inset";
66 property real fontScale: 1.0;
77 property var scopeStyle: null;
88 property int titleAlignment: Text.AlignLeft;
@@ -23,11 +23,12 @@ Loader {
2323 sourceComponent: UbuntuShape {
2424 objectName: "background";
2525 radius: "medium";
26− color: getColor(0) || "white";
27− gradientColor: getColor(1) || color;
26+ backgroundColor: getColor(0) || "white";
27+ secondaryBackgroundColor: getColor(1) || backgroundColor;
28+ backgroundMode: UbuntuShape.VerticalGradient;
2829 anchors.fill: parent;
29− image: backgroundImage.source ? backgroundImage : null;
30− property real luminance: Style.luminance(color);
30+ source: backgroundImage.source ? backgroundImage : null;
31+ property real luminance: Style.luminance(backgroundColor);
3132 property Image backgroundImage: Image {
3233 objectName: "backgroundImage";
3334 source: {
@@ -80,7 +81,7 @@ left: parent.left;
8081 wrapMode: Text.Wrap;
8182 maximumLineCount: 2;
8283 font.pixelSize: Math.round(FontUtils.sizeToPixels(fontSize) * fontScale);
83− color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? Theme.palette.normal.baseText : "white");
84+ color: backgroundLoader.active && backgroundLoader.item && root.scopeStyle ? root.scopeStyle.getTextColor(backgroundLoader.item.luminance) : (backgroundLoader.item && backgroundLoader.item.luminance > 0.7 ? theme.palette.normal.baseText : "white");
8485 visible: showHeader ;
8586 width: parent.width - x;
8687 text: root.title;
tests/plugins/Dash/cardcreatortest.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import "../../../plugins/Dash/CardCreator.js" as CardCreator
1919
2020Item {
tests/plugins/Dash/horizontaljournaltest.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Item {
tests/plugins/Dash/horizontaljournaltry.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Item {
tests/plugins/Dash/listviewwithpageheadertest.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Rectangle {
tests/plugins/Dash/listviewwithpageheadertestsection.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Rectangle {
tests/plugins/Dash/listviewwithpageheadertestsectionexternalmodel.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Rectangle {
tests/plugins/Dash/organicgridtest.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Item {
tests/plugins/Dash/organicgridtry.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Item {
tests/plugins/Dash/tst_CardAttributes.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Dash 0.1
2020
tests/plugins/Dash/tst_CroppedImageMinimumSourceSize.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import Dash 0.1
2121
2222Rectangle {
tests/plugins/Dash/tst_ListViewWithPageHeaderQML.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Dash 0.1
2020
tests/plugins/Dash/tst_ScopeStyle.qml+2−2
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Dash 0.1
20−import Ubuntu.Components 1.1
20+import Ubuntu.Components 1.3
2121import Utils 0.1
2222
2323Rectangle {
tests/plugins/Dash/verticaljournaltest.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Item {
tests/plugins/Dash/verticaljournaltry.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import Dash 0.1
1919
2020Item {
tests/plugins/LightDM/IntegratedLightDM/greeter.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import LightDM.IntegratedLightDM 0.1 as LightDM
17+import QtQuick 2.4
18+import IntegratedLightDM 0.1 as LightDM
1919
2020Item {
2121 property var greeter: LightDM.Greeter
tests/plugins/Ubuntu/Gestures/DownwardsLauncher.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Ubuntu.Gestures 0.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020
2121Item {
2222
tests/plugins/Ubuntu/Gestures/LeftwardsLauncher.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Ubuntu.Gestures 0.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020
2121Item {
2222 id: root
tests/plugins/Ubuntu/Gestures/RightwardsLauncher.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Ubuntu.Gestures 0.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020
2121Item {
2222 objectName: "rightwardsLauncher"
tests/plugins/Ubuntu/Gestures/UpwardsLauncher.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Ubuntu.Gestures 0.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020
2121Item {
2222 id: root
tests/plugins/Ubuntu/Gestures/empty.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Ubuntu.Gestures 0.1
1919
2020Item {
tests/plugins/Ubuntu/Gestures/touchGateExample.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import Ubuntu.Gestures 0.1
1919
2020Rectangle {
tests/plugins/Ubuntu/Gestures/tst_DirectionalDragArea.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Unity.Test 0.1
2020
2121Rectangle {
tests/plugins/Ubuntu/Gestures/tst_FloatingFlickable.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020import Unity.Test 0.1
2121
tests/plugins/Ubuntu/Gestures/tst_PressedOutsideNotifier.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import Ubuntu.Gestures 0.1
2020
2121/*
tests/plugins/Ubuntu/Gestures/tst_TouchGate.cpp+1−5
@@ -19,9 +19,7 @@
1919#include <QQmlEngine>
2020#include <QQuickView>
2121#include <QSharedPointer>
22−#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
23− #include <private/qquickwindow_p.h>
24−#endif
22+#include <private/qquickwindow_p.h>
2523
2624// C++ std lib
2725#include <functional>
@@ -188,10 +186,8 @@ void tst_TouchGate::holdsEventsUntilGainsOwnership()
188186
189187 if (!ownershipAfterTouchEnd) {
190188 touchRegistry->removeCandidateOwnerForTouch(0, candidateItem);
191−#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
192189 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(testItem->window());
193190 wp->flushDelayedTouchEvent();
194−#endif
195191 // TouchGate should now open its flood gates and let testItem get all
196192 // events from touch 0 produced so far
197193 QCOMPARE(testItem->touchEventsReceived.count(), 2);
tests/plugins/Unity/Launcher/launchermodeltest.cpp+1
@@ -57,6 +57,7 @@ public:
5757 QColor splashColorFooter() const override { return QColor(0,0,0,0); }
5858 Qt::ScreenOrientations supportedOrientations() const override { return Qt::PortraitOrientation; }
5959 bool rotatesWindowContents() const override { return false; }
60+ bool isTouchApp() const override { return true; }
6061
6162 // Methods used for mocking (not in the interface)
6263 void setFocused(bool focused) { m_focused = focused; Q_EMIT focusedChanged(focused); }
tests/plugins/Utils/tst_UtilsStyle.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Utils 0.1
2020
tests/qmltests/CMakeLists.txt+2−1
@@ -26,7 +26,7 @@ add_unity8_qmltest(Dash CardCarousel)
2626add_unity8_qmlbenchmark(Dash CardBenchmark 1000)
2727add_unity8_qmltest(Dash CardTool)
2828add_unity8_qmltest(Dash GenericScopeView)
29−add_unity8_qmltest(Dash PageHeader)
29+add_unity8_qmltest(Dash DashPageHeader)
3030add_unity8_qmltest(Dash PreviewListView)
3131add_unity8_qmltest(Dash/Previews Preview)
3232add_unity8_qmltest(Dash/Previews PreviewActions)
@@ -42,6 +42,7 @@ add_unity8_qmltest(Dash/Previews PreviewProgress)
4242add_unity8_qmltest(Dash/Previews PreviewRatingDisplay)
4343add_unity8_qmltest(Dash/Previews PreviewRatingEdit)
4444add_unity8_qmltest(Dash/Previews PreviewRatingInput)
45+add_unity8_qmltest(Dash/Previews PreviewSharing)
4546add_unity8_qmltest(Dash/Previews PreviewTable)
4647add_unity8_qmltest(Dash/Previews PreviewTextSummary)
4748add_unity8_qmltest(Dash/Previews PreviewVideoPlayback)
tests/qmltests/Components/tst_Background.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1
2020
tests/qmltests/Components/tst_Carousel.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Components/"
2020import "../../../qml/Components/carousel.js" as Carousel
tests/qmltests/Components/tst_Dialogs.qml+3−3
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.2
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import Unity.Test 0.1
2121
2222import "../../../qml/Components"
@@ -105,7 +105,7 @@ Rectangle {
105105 var dialogsPrivate = findInvisibleChild(dialogs, "dialogsPrivate");
106106 dialogsPrivate.showPowerDialog();
107107 var dialogLoader = findInvisibleChild(dialogs, "dialogLoader");
108− tryCompare(dialogLoader.item, "focus", true);
108+ tryCompare(dialogLoader.item.__foreground, "focus", true);
109109 }
110110 }
111111}
tests/qmltests/Components/tst_DragHandle.qml+2−2
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import "../../../qml/Components"
1919import "tst_DragHandle"
20−import Ubuntu.Components 0.1
20+import Ubuntu.Components 1.3
2121import Ubuntu.Gestures 0.1
2222import Unity.Test 0.1
2323
tests/qmltests/Components/tst_DragHandle/BidirectionalShowable.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import "../../../../qml/Components"
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Ubuntu.Gestures 0.1
2121
2222Item {
tests/qmltests/Components/tst_DragHandle/HorizontalShowable.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import "../../../../qml/Components"
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Ubuntu.Gestures 0.1
2121
2222Showable {
tests/qmltests/Components/tst_DragHandle/VerticalShowable.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import "../../../../qml/Components"
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Ubuntu.Gestures 0.1
2121
2222Showable {
tests/qmltests/Components/tst_DraggingArea.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Components"
2020
tests/qmltests/Components/tst_EdgeDragEvaluator.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import "../../../qml/Components"
1919
2020Item {
tests/qmltests/Components/tst_LazyImage.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Components"
20−import Ubuntu.Components 0.1
20+import Ubuntu.Components 1.3
2121import Unity.Test 0.1 as UT
2222import "tst_LazyImage"
2323
@@ -32,7 +32,7 @@ Rectangle {
3232 rightMargin: 2 * parent.width / 3
3333 }
3434
35− color: Theme.palette.normal.baseText
35+ color: theme.palette.normal.baseText
3636
3737 Column {
3838 anchors { fill: parent; margins: units.gu(5) }
tests/qmltests/Components/tst_LazyImage/ImageControls.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 0.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../../../../qml/Components"
2020
2121Row {
tests/qmltests/Components/tst_Lockscreen.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Components"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Test 0.1 as UT
2323
2424Rectangle {
tests/qmltests/Components/tst_PhysicalKeysMapper.qml+11−10
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Components"
2020import Powerd 0.1
@@ -67,26 +67,27 @@ TestCase {
6767 Powerd.setStatus(data.status, Powerd.Unknown);
6868 physicalKeysMapper.powerKeyLongPressTime = 500;
6969
70− physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: false });
70+ physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: false }, 100);
7171
7272 // After the first key press the screen is always on
7373 // and the rest of keypresses are auto repeat
7474 Powerd.setStatus(Powerd.On, Powerd.Unknown);
7575
76− for (var i = 0; i < 3; ++i) {
77− wait(10);
78− physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: true});
79− }
76+ physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: true}, 300);
77+ physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: true}, 400);
78+ physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: true}, 500);
79+ physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: true}, 599);
8080
8181 // powerKeyLongPressed should not have been emitted yet.
8282 compare(powerSpy.count, 0);
8383
84− for (var i = 0; i < 10; ++i) {
85− wait(50);
86− physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: true});
87− }
84+ physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: true}, 600);
8885
8986 compare(powerSpy.count, 1);
87+
88+ // Confirm we only emit once
89+ physicalKeysMapper.onKeyPressed({ key: Qt.Key_PowerDown, isAutoRepeat: true}, 601);
90+ compare(powerSpy.count, 1);
9091 }
9192
9293 function test_screenshotButtons_data() {
tests/qmltests/Components/tst_Rating.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,17 +14,17 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Components"
20−import Ubuntu.Components 0.1
20+import Ubuntu.Components 1.3
2121import Unity.Test 0.1 as UT
2222
2323Rectangle {
2424 id: root
2525 width: units.gu(40)
2626 height: units.gu(10)
27− color: Theme.palette.selected.background
27+ color: theme.palette.selected.background
2828
2929 Rating {
3030 id: rating
tests/qmltests/Components/tst_ResponsiveGridView.qml+3−3
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Components"
21−import Ubuntu.Components.ListItems 0.1 as ListItem
22−import Ubuntu.Components 0.1
21+import Ubuntu.Components.ListItems 1.3 as ListItem
22+import Ubuntu.Components 1.3
2323import Unity.Test 0.1 as UT
2424
2525Item {
tests/qmltests/Components/tst_ResponsiveVerticalJournal.qml+3−3
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Components"
21−import Ubuntu.Components.ListItems 0.1 as ListItem
22−import Ubuntu.Components 0.1
21+import Ubuntu.Components.ListItems 1.3 as ListItem
22+import Ubuntu.Components 1.3
2323import Utils 0.1
2424import Unity.Test 0.1 as UT
2525
tests/qmltests/Components/tst_Showable.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Unity.Test 0.1 as UT
2121import ".."
2222import "../../../qml/Components"
tests/qmltests/Components/tst_ZoomableImage.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Components"
2020import Unity.Test 0.1 as UT
tests/qmltests/Dash/Previews/MockPreviewWidget.qml+1−1
@@ -15,7 +15,7 @@
1515 *
1616 */
1717
18−import QtQuick 2.0
18+import QtQuick 2.4
1919import "../../../../qml/Dash/Previews"
2020
2121PreviewWidget {
tests/qmltests/Dash/Previews/tst_Preview.qml+3−3
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
@@ -24,7 +24,7 @@ Rectangle {
2424 id: root
2525 width: units.gu(60)
2626 height: units.gu(60)
27− color: Theme.palette.selected.background
27+ color: theme.palette.selected.background
2828
2929 Item {
3030 id: shell
tests/qmltests/Dash/Previews/tst_PreviewActions.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222
2323
2424Rectangle {
tests/qmltests/Dash/Previews/tst_PreviewAudioPlayback.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222import QtMultimedia 5.0
@@ -25,7 +25,7 @@ Rectangle {
2525 id: root
2626 width: units.gu(60)
2727 height: units.gu(80)
28− color: Theme.palette.selected.background
28+ color: theme.palette.selected.background
2929
3030 property var tracksModel0: {
3131 "tracks": [ ]
tests/qmltests/Dash/Previews/tst_PreviewComment.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222
tests/qmltests/Dash/Previews/tst_PreviewCommentInput.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222
tests/qmltests/Dash/Previews/tst_PreviewExpandable.qml+6−6
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222
@@ -24,7 +24,7 @@ Rectangle {
2424 id: root
2525 width: units.gu(40)
2626 height: units.gu(80)
27− color: Theme.palette.selected.background
27+ color: theme.palette.selected.background
2828
2929 property string longText: "Lorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh.\nLorem ipsum dolor sit amet, consectetur adipiscing elit.\nPhasellus a mi vitae augue rhoncus lobortis ut rutrum metus.\nCurabitur tortor leo, tristique sed mollis quis, condimentum venenatis nibh."
3030 property string longText2: "This is a very very very long text. 1 This is a very very very long text. 2 This is a very very very long text. 3 This is a very very very long text. 4 This is a very very very long text. 5 This is a very very very long text. 6 This is a very very very long text. 7 This is a very very very long text. 8 This is a very very very long text. 9 This is a very very very long text. 10 This is a very very very long text. 11 This is a very very very long text."
@@ -319,9 +319,9 @@ Rectangle {
319319 previewWidgetFactory.widgetType = allWidgetsModel.get(i).type;
320320 previewWidgetFactory.active = true;
321321
322− // Wait for the height ot settle by waiting twice the time of the
322+ // Wait for the height ot settle by waiting four times the time of the
323323 // longest of the height behaviour animations
324− wait(UbuntuAnimation.SnapDuration * 2);
324+ wait(UbuntuAnimation.SnapDuration * 4);
325325
326326 // Check the item inside the expandable has the same height
327327 // as the one straight from the factory
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml+2−2
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
@@ -149,7 +149,7 @@ Rectangle {
149149 tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
150150 var mascot = findChild(previewHeader, "mascotShape");
151151 tryCompare(mascot, "visible", true);
152− tryCompare(mascot.image, "status", Image.Ready);
152+ tryCompare(mascot.source, "status", Image.Ready);
153153 }
154154 }
155155}
tests/qmltests/Dash/Previews/tst_PreviewIconActions.qml+3−3
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222
2323
2424Rectangle {
@@ -104,7 +104,7 @@ Rectangle {
104104
105105 var button = findChild(root, "button" + buttonId);
106106 var image = findChildsByType(button, "QQuickImage")[0];
107− var label = findChildsByType(button, "Label")[0];
107+ var label = findChildsByType(button, "UCLabel")[0];
108108
109109 compare(image.source, buttonIcon);
110110 compare(label.text, buttonLabel);
tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
tests/qmltests/Dash/Previews/tst_PreviewPayments.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222
2323Rectangle {
2424 id: root
tests/qmltests/Dash/Previews/tst_PreviewProgress.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222
2323Rectangle {
2424 id: root
tests/qmltests/Dash/Previews/tst_PreviewRatingDisplay.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222
@@ -24,7 +24,7 @@ Rectangle {
2424 id: root
2525 width: units.gu(40)
2626 height: units.gu(80)
27− color: Theme.palette.selected.background
27+ color: theme.palette.selected.background
2828
2929 property var reviewsModel0: {
3030 "reviews": [ ]
tests/qmltests/Dash/Previews/tst_PreviewRatingEdit.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222
@@ -24,7 +24,7 @@ Rectangle {
2424 id: root
2525 width: units.gu(40)
2626 height: units.gu(80)
27− color: Theme.palette.selected.background
27+ color: theme.palette.selected.background
2828
2929 property var widgetData0: { "visible": "both", "required": "both", author: "Some dude", rating: 4.5, review: "Very cool app" }
3030
tests/qmltests/Dash/Previews/tst_PreviewRatingInput.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222
@@ -24,7 +24,7 @@ Rectangle {
2424 id: root
2525 width: units.gu(40)
2626 height: units.gu(80)
27− color: Theme.palette.selected.background
27+ color: theme.palette.selected.background
2828
2929 property real validInputRating: 1
3030 property real invalidInputRating: -1
tests/qmltests/Dash/Previews/tst_PreviewSharing.qmlnew file+71
@@ -0,0 +1,71 @@
1+/*
2+ * Copyright 2014 Canonical Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU 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 General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import QtTest 1.0
19+import Ubuntu.Components 1.3
20+import "../../../../qml/Dash/Previews"
21+import Unity.Test 0.1 as UT
22+
23+Rectangle {
24+ id: root
25+ width: units.gu(40)
26+ height: units.gu(80)
27+ color: "black"
28+
29+ property var shareData: {
30+ "uri": [
31+ "Text here",
32+ "text here 2",
33+ "text here 3"
34+ ],
35+ "contentType": "text"
36+ }
37+
38+ property var shareDataNoUri: {
39+ "uri": "",
40+ "contentType": "text"
41+ }
42+
43+ PreviewSharing {
44+ id: previewSharing
45+ anchors { left: parent.left; bottom: parent.bottom; }
46+ shareData: root.shareData
47+ }
48+
49+ UT.UnityTestCase {
50+ name: "PreviewSharingTest"
51+ when: windowShown
52+
53+ property Item peerPicker: findChild(previewSharing.rootItem, "peerPicker")
54+
55+ function cleanup() {
56+ peerPicker.visible = false;
57+ previewSharing.shareData = root.shareData;
58+ }
59+
60+ function test_visible() {
61+ compare(previewSharing.visible, true);
62+ previewSharing.shareData = shareDataNoUri;
63+ compare(previewSharing.visible, false);
64+ }
65+
66+ function test_open_picker() {
67+ mouseClick(previewSharing);
68+ compare(peerPicker.visible, true);
69+ }
70+ }
71+}
tests/qmltests/Dash/Previews/tst_PreviewTable.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222
@@ -24,7 +24,7 @@ Rectangle {
2424 id: root
2525 width: units.gu(40)
2626 height: units.gu(80)
27− color: Theme.palette.selected.background
27+ color: theme.palette.selected.background
2828
2929 property var widgetDataComplete: {
3030 "title": "Title here longa long long long long long long long long long long",
tests/qmltests/Dash/Previews/tst_PreviewTextSummary.qml+4−4
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import "../../../../qml/Dash/Previews"
2121import Unity.Test 0.1 as UT
2222
@@ -24,7 +24,7 @@ Rectangle {
2424 id: root
2525 width: units.gu(40)
2626 height: units.gu(80)
27− color: Theme.palette.selected.background
27+ color: theme.palette.selected.background
2828
2929 property var widgetDataComplete: {
3030 "title": "Title here",
tests/qmltests/Dash/Previews/tst_PreviewVideoPlayback.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
tests/qmltests/Dash/Previews/tst_PreviewWidgetFactory.qml+3−3
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
@@ -23,7 +23,7 @@ Rectangle {
2323 id: root
2424 width: units.gu(60)
2525 height: units.gu(80)
26− color: Theme.palette.selected.background
26+ color: theme.palette.selected.background
2727
2828 PreviewWidgetFactory {
2929 id: factory
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+2−2
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../../qml/Dash/Previews"
2020import Unity.Test 0.1 as UT
@@ -41,7 +41,7 @@ Rectangle {
4141
4242 Loader {
4343 id: loader
44− anchors.centerIn: parent
44+ width: parent.width
4545 sourceComponent: PreviewZoomableImage {
4646 widgetData: widgetData0
4747 }
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingBoolean.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import QtTest 1.0
2020import "../../../../qml/Dash/ScopeSettings"
2121import Unity.Test 0.1 as UT
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingList.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import QtTest 1.0
2020import "../../../../qml/Dash/ScopeSettings"
2121import Unity.Test 0.1 as UT
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingNumber.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import QtTest 1.0
2020import "../../../../qml/Dash/ScopeSettings"
2121import Unity.Test 0.1 as UT
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingString.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import QtTest 1.0
2020import "../../../../qml/Dash/ScopeSettings"
2121import Unity.Test 0.1 as UT
tests/qmltests/Dash/ScopeSettings/tst_ScopeSettingsWidgetFactory.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import QtTest 1.0
2020import "../../../../qml/Dash/ScopeSettings"
2121import Unity.Test 0.1 as UT
tests/qmltests/Dash/tst_Card.qml+7−7
@@ -1,5 +1,5 @@
11/*
2− * Copyright (C) 2013 Canonical, Ltd.
2+ * Copyright (C) 2013,2015 Canonical, Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Unity.Test 0.1 as UT
2121import "../../../qml/Dash"
2222import "CardHelpers.js" as Helpers
@@ -443,11 +443,11 @@ Rectangle {
443443 }
444444
445445 if (data.hasOwnProperty("color")) {
446− tryCompare(background, "color", data.color);
446+ tryCompare(background, "backgroundColor", data.color);
447447 }
448448
449449 if (data.hasOwnProperty("gradientColor")) {
450− tryCompare(background, "gradientColor", data.gradientColor);
450+ tryCompare(background, "secondaryBackgroundColor", data.gradientColor);
451451 }
452452
453453 if (data.hasOwnProperty("image")) {
@@ -520,9 +520,9 @@ Rectangle {
520520 waitForRendering(selector);
521521 waitForRendering(card);
522522
523− background.color = data.tag;
523+ background.backgroundColor = data.tag;
524524
525− var fontColor = data.dark ? Theme.palette.normal.baseText : "white";
525+ var fontColor = data.dark ? theme.palette.normal.baseText : "white";
526526
527527 tryCompareFunction(function() { return Qt.colorEqual(summary.color, fontColor); }, true);
528528 tryCompareFunction(function() { return Qt.colorEqual(title.color, fontColor); }, true);
tests/qmltests/Dash/tst_CardBenchmark.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Unity.Test 0.1 as UT
2121import "../../../qml/Dash"
2222import "CardHelpers.js" as Helpers
tests/qmltests/Dash/tst_CardTool.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Unity.Test 0.1 as UT
2121import "../../../qml/Dash"
2222import "CardHelpers.js" as Helpers
tests/qmltests/Dash/tst_Dash.qml+3−3
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Dash"
20−import Ubuntu.Components 0.1
20+import Ubuntu.Components 1.3
2121import Unity.Test 0.1 as UT
2222
2323Item {
@@ -319,7 +319,7 @@ Item {
319319
320320 // Click on the store
321321 var scopesListPageHeader = findChild(scopesList, "pageHeader");
322− var searchButton = findChild(scopesListPageHeader, "store_header_button");
322+ var searchButton = findChild(scopesListPageHeader, "store_action_button");
323323 mouseClick(searchButton);
324324
325325 spy.wait();
tests/qmltests/Dash/tst_DashContent.qml+6−6
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import "../../../qml/Dash"
2020import "../../../qml/Components"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity 0.2
2323import Unity.Test 0.1 as UT
2424import Utils 0.1
@@ -215,7 +215,7 @@ Item {
215215 verify(pageHeader, "Could not find the scope page header.");
216216 var innerHeader = findChild(pageHeader, "innerPageHeader");
217217 verify(innerHeader, "Could not find the scope page header.");
218− compare(innerHeader.title, scopesModel.getScope(data.index).name);
218+ compare(innerHeader.config.title, scopesModel.getScope(data.index).name);
219219 }
220220
221221 function test_is_active_data() {
@@ -552,13 +552,13 @@ Item {
552552 }
553553
554554 function getSettledButtons() {
555− var buttons = findChildsByType(dashContent, "AbstractButton");
555+ var buttons = findChildsByType(dashContent, "UCAbstractButton");
556556 wait(2500);
557− var aux = findChildsByType(dashContent, "AbstractButton");
557+ var aux = findChildsByType(dashContent, "UCAbstractButton");
558558 while (!compareArrays(aux, buttons)) {
559559 buttons = aux;
560560 wait(2500);
561− aux = findChildsByType(dashContent, "AbstractButton");
561+ aux = findChildsByType(dashContent, "UCAbstractButton");
562562 }
563563 return buttons;
564564 }
tests/qmltests/Dash/tst_PageHeader.qml → tests/qmltests/Dash/tst_DashPageHeader.qmlrenamed+5−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Dash"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity 0.2
2323import Unity.Test 0.1 as UT
2424
@@ -244,7 +244,7 @@ Item {
244244 anchors.fill: parent
245245 spacing: units.gu(1)
246246
247− PageHeader {
247+ DashPageHeader {
248248 id: pageHeader
249249 anchors {
250250 left: parent.left
@@ -254,7 +254,7 @@ Item {
254254 searchEntryEnabled: true
255255 title: "%^$%^%^&%^&%^$%GHR%"
256256 scopeStyle: QtObject {
257− readonly property color foreground: Theme.palette.normal.baseText
257+ readonly property color foreground: theme.palette.normal.baseText
258258 readonly property url headerLogo: showImageCheckBox.checked ? pageHeader.titleImageSource : ""
259259 }
260260 showBackButton: showBackButtonCheckBox.checked
tests/qmltests/Dash/tst_GenericScopeView.qml+5−5
@@ -14,13 +14,13 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity 0.2
2020import ".."
2121import "../../../qml/Dash"
2222import "../../../qml/Components"
23−import Ubuntu.Components 1.1
23+import Ubuntu.Components 1.3
2424import Unity.Test 0.1 as UT
2525
2626Item {
@@ -429,7 +429,7 @@ Item {
429429 // open
430430 tryCompare(testCase.subPageLoader, "open", false);
431431 tryCompare(testCase.subPageLoader, "visible", false);
432− var settings = findChild(innerHeader, "settings_header_button");
432+ var settings = findChild(innerHeader, "settings_action_button");
433433 mouseClick(settings);
434434 tryCompare(testCase.subPageLoader, "open", true);
435435 tryCompareFunction(function() { return (String(subPageLoader.source)).indexOf("ScopeSettingsPage.qml") != -1; }, true);
@@ -500,7 +500,7 @@ Item {
500500 mouseClick(seeAll0);
501501 verify(category0.expanded);
502502 tryCompare(category0, "height", category0.item.expandedHeight + seeAll0.height);
503− tryCompare(genericScopeView.categoryView, "contentY", units.gu(14));
503+ tryCompare(genericScopeView.categoryView, "contentY", units.gu(13));
504504
505505 scrollToEnd();
506506
@@ -577,7 +577,7 @@ Item {
577577 verify(innerHeader, "Could not find the inner header");
578578
579579 expectFail("Apps", "Click scope should not have a favorite button");
580− var favoriteAction = findChild(innerHeader, "favorite_header_button");
580+ var favoriteAction = findChild(innerHeader, "favorite_action_button");
581581 verify(favoriteAction, "Could not find the favorite action.");
582582 mouseClick(favoriteAction);
583583
tests/qmltests/Dash/tst_PreviewListView.qml+5−5
@@ -1,5 +1,5 @@
11/*
2− * Copyright 2014 Canonical Ltd.
2+ * Copyright 2014,2015 Canonical Ltd.
33 *
44 * This program is free software; you can redistribute it and/or modify
55 * it under the terms of the GNU General Public License as published by
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import "../../../qml/Dash"
2121import Unity.Test 0.1 as UT
2222import Unity 0.2 as Unity
@@ -26,7 +26,7 @@ Rectangle {
2626 id: root
2727 width: units.gu(60)
2828 height: units.gu(60)
29− color: Theme.palette.selected.background
29+ color: theme.palette.selected.background
3030
3131 Unity.MockScope {
3232 id: mockScope
@@ -91,7 +91,7 @@ Rectangle {
9191 var header = findChild(listView, "innerPageHeader");
9292 verify(header, "Could not find the preview header");
9393
94− compare(header.title, "Mock Scope");
94+ compare(header.config.title, "Mock Scope");
9595 }
9696
9797 function test_header_style() {
tests/qmltests/Greeter/TestView.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
18−import Ubuntu.Components 1.1
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import "../Components"
2020
2121Item {
tests/qmltests/Greeter/tst_Clock.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Greeter"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Indicators 0.1 as Indicators
2323import Unity.Test 0.1 as UT
2424
tests/qmltests/Greeter/tst_Greeter.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Greeter"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import AccountsService 0.1
2323import GSettings 1.0
2424import LightDM.IntegratedLightDM 0.1 as LightDM // This is the mock
tests/qmltests/Greeter/tst_Infographics.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Greeter"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Test 0.1 as UT
2323import LightDM.IntegratedLightDM 0.1 as LightDM
2424
tests/qmltests/Greeter/tst_NarrowView.qml+3−3
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Greeter"
21−import LightDM.IntegratedLightDM 0.1 as LightDM
22−import Ubuntu.Components 0.1
21+import IntegratedLightDM 0.1 as LightDM
22+import Ubuntu.Components 1.3
2323import Unity.Test 0.1 as UT
2424
2525Item {
tests/qmltests/Greeter/tst_WideView.qml+3−3
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Greeter"
21−import LightDM.IntegratedLightDM 0.1 as LightDM
22−import Ubuntu.Components 0.1
21+import IntegratedLightDM 0.1 as LightDM
22+import Ubuntu.Components 1.3
2323import Unity.Test 0.1 as UT
2424
2525Item {
tests/qmltests/Launcher/tst_Launcher.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import Unity.Test 0.1
21−import Ubuntu.Components 1.1
21+import Ubuntu.Components 1.3
2222import ".."
2323import "../../../qml/Launcher"
2424import Unity.Launcher 0.1
tests/qmltests/Notifications/tst_Notifications.qml+1−1
@@ -20,7 +20,7 @@ import QtTest 1.0
2020import ".."
2121import "../../../qml/Notifications"
2222import "../../../qml/Components/UnityInputInfo"
23−import Ubuntu.Components 1.2
23+import Ubuntu.Components 1.3
2424import Unity.Test 0.1
2525import Unity.Notifications 1.0
2626import QtMultimedia 5.0
tests/qmltests/Notifications/tst_OptionToggle.qml+2−3
@@ -17,14 +17,13 @@
1717 * Mirco Mueller <mirco.mueller@canonical.com>
1818 */
1919
20−import QtQuick 2.0
20+import QtQuick 2.4
2121import QtTest 1.0
2222import ".."
2323import "../../../qml/Notifications"
24−import Ubuntu.Components 0.1
24+import Ubuntu.Components 1.3
2525import Unity.Test 0.1
2626import Unity.Notifications 1.0
27−import QtMultimedia 5.0
2827
2928Row {
3029 id: rootRow
tests/qmltests/Notifications/tst_SwipeToAct.qml+1−1
@@ -20,7 +20,7 @@ import QtTest 1.0
2020import ".."
2121import "../../../qml/Notifications"
2222import "../../../qml/Components/UnityInputInfo"
23−import Ubuntu.Components 0.1
23+import Ubuntu.Components 1.3
2424import Unity.Test 0.1
2525import Unity.Notifications 1.0
2626
tests/qmltests/Notifications/tst_VisualSnapDecisionsQueue.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import ".."
2020import "../../../qml/Notifications"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Test 0.1
2323import Unity.Notifications 1.0
2424
tests/qmltests/Panel/IndicatorTest.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import "../../../qml/Panel"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Test 0.1 as UT
2323import Unity.Indicators 0.1 as Indicators
2424
tests/qmltests/Panel/Indicators/tst_IndicatorsLight.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import Unity.Test 0.1 as UT
2020import Unity.Indicators 0.1 as Indicators
21−import Ubuntu.Components 1.1
21+import Ubuntu.Components 1.3
2222import Powerd 0.1
2323import Lights 0.1
2424import QMenuModel 0.1
tests/qmltests/Panel/Indicators/tst_MenuItemFactory.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import Ubuntu.Settings.Menus 0.1 as Menus
tests/qmltests/Panel/Indicators/tst_MessageMenuItemFactory.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import QMenuModel 0.1
tests/qmltests/Panel/tst_ActiveCallHint.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import Ubuntu.Telephony 0.1 as Telephony
tests/qmltests/Panel/tst_IndicatorItem.qml+2−2
@@ -14,10 +14,10 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
20−import Ubuntu.Components 0.1
20+import Ubuntu.Components 1.3
2121import Unity.Test 0.1 as UT
2222import "../../../qml/Panel"
2323
tests/qmltests/Panel/tst_IndicatorItemRow.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import "../../../qml/Panel"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Test 0.1 as UT
2323import Unity.Indicators 0.1 as Indicators
2424
tests/qmltests/Panel/tst_IndicatorPage.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import Unity.Indicators 0.1 as Indicators
tests/qmltests/Panel/tst_IndicatorsBar.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import "../../../qml/Panel"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Test 0.1 as UT
2323import Unity.Indicators 0.1 as Indicators
2424
tests/qmltests/Panel/tst_IndicatorsMenu.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import "../../../qml/Panel"
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Test 0.1 as UT
2323import Unity.Indicators 0.1 as Indicators
2424
tests/qmltests/Panel/tst_MenuContent.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import "../../../qml/Panel"
tests/qmltests/Panel/tst_Panel.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import Unity.Test 0.1
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Application 0.1
2323import Unity.Indicators 0.1 as Indicators
2424import Ubuntu.Telephony 0.1 as Telephony
tests/qmltests/Stages/ApplicationCheckBox.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import Unity.Application 0.1
2121
2222RowLayout {
tests/qmltests/Stages/RecursingChildSessionControl.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Unity.Application 0.1
2121
2222ColumnLayout {
tests/qmltests/Stages/tst_ApplicationWindow.qml+3−3
@@ -14,14 +14,14 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import Unity.Test 0.1 as UT
2121import ".."
2222import "../../../qml/Stages"
23−import Ubuntu.Components 0.1
24−import Ubuntu.Components.ListItems 1.0 as ListItem
23+import Ubuntu.Components 1.3
24+import Ubuntu.Components.ListItems 1.3 as ListItem
2525import Unity.Application 0.1
2626
2727Rectangle {
tests/qmltests/Stages/tst_DesktopStage.qml+84−8
@@ -14,33 +14,40 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 1.1
20−import Ubuntu.Components.ListItems 1.0 as ListItem
19+import Ubuntu.Components 1.3
20+import Ubuntu.Components.ListItems 1.3 as ListItem
2121import Unity.Application 0.1
2222import Unity.Test 0.1
2323import Utils 0.1
2424
2525import "../../../qml/Stages"
26+import "../../../qml/Components"
2627
2728Item {
2829 id: root
2930 width: desktopStageLoader.width + controls.width
3031 height: desktopStageLoader.height
3132
33+ property var greeter: { fullyShown: true }
34+
3235 Binding {
3336 target: MouseTouchAdaptor
3437 property: "enabled"
3538 value: false
3639 }
3740
38− Component.onCompleted: {
41+ Component.onCompleted: resetGeometry()
42+
43+ function resetGeometry() {
3944 // ensures apps which are tested decorations are in view.
45+ WindowStateStorage.clear();
4046 WindowStateStorage.geometry = {
4147 'unity8-dash': Qt.rect(0, units.gu(3), units.gu(50), units.gu(40)),
4248 'dialer-app': Qt.rect(units.gu(51), units.gu(3), units.gu(50), units.gu(40)),
4349 'camera-app': Qt.rect(0, units.gu(44), units.gu(50), units.gu(40)),
50+ 'gallery-app': Qt.rect(units.gu(51), units.gu(44), units.gu(50), units.gu(40))
4451 }
4552 }
4653
@@ -61,6 +68,7 @@ Item {
6168 Component.onDestruction: {
6269 desktopStageLoader.itemDestroyed = true;
6370 }
71+ orientations: Orientations {}
6472 }
6573 }
6674 }
@@ -110,14 +118,14 @@ Item {
110118
111119 desktopStageLoader.active = true;
112120 tryCompare(desktopStageLoader, "status", Loader.Ready);
121+ root.resetGeometry();
113122 }
114123
115124 function killAllRunningApps() {
116− while (ApplicationManager.count > 1) {
117− var appIndex = ApplicationManager.get(0).appId == "unity8-dash" ? 1 : 0
118− ApplicationManager.stopApplication(ApplicationManager.get(appIndex).appId);
125+ while (ApplicationManager.count > 0) {
126+ ApplicationManager.stopApplication(ApplicationManager.get(0).appId);
119127 }
120− compare(ApplicationManager.count, 1)
128+ compare(ApplicationManager.count, 0)
121129 }
122130
123131 function waitUntilAppSurfaceShowsUp(appId) {
@@ -210,5 +218,73 @@ Item {
210218 tap(toAppDecoration);
211219 tryCompare(ApplicationManager.findApplication(data.apps[data.focusTo]).session.surface, "activeFocus", true);
212220 }
221+
222+ function test_minimizeApplicationHidesSurface() {
223+ var dashApp = startApplication("unity8-dash");
224+
225+ var dashDelegate = findChild(desktopStage, "stageDelegate_unity8-dash");
226+ verify(dashDelegate);
227+
228+ findChild(dashDelegate, "decoratedWindow").minimize();
229+ tryCompare(dashApp.session.surface, "visible", false);
230+ }
231+
232+ function test_maximizeApplicationHidesSurfacesBehindIt() {
233+ var dashApp = startApplication("unity8-dash");
234+ var dialerApp = startApplication("dialer-app");
235+ var cameraApp = startApplication("camera-app");
236+
237+ var dashDelegate = findChild(desktopStage, "stageDelegate_unity8-dash");
238+ verify(dashDelegate);
239+ var dialerDelegate = findChild(desktopStage, "stageDelegate_dialer-app");
240+ verify(dialerDelegate);
241+ var cameraDelegate = findChild(desktopStage, "stageDelegate_camera-app");
242+ verify(cameraDelegate);
243+
244+ // maximize
245+ findChild(dialerDelegate, "decoratedWindow").maximize();
246+ tryCompare(dialerDelegate, "visuallyMaximized", true);
247+
248+ tryCompare(dashApp.session.surface, "visible", false);
249+ compare(cameraApp.session.surface.visible, true);
250+
251+ // restore
252+ findChild(dialerDelegate, "decoratedWindow").maximize();
253+ compare(dashApp.session.surface.visible, true);
254+ compare(cameraApp.session.surface.visible, true);
255+ }
256+
257+ function test_applicationsBecomeVisibleWhenOccludingAppRemoved() {
258+ var dashApp = startApplication("unity8-dash");
259+ var dashDelegate = findChild(desktopStage, "stageDelegate_unity8-dash");
260+ verify(dashDelegate);
261+
262+ var dialerApp = startApplication("dialer-app");
263+ var dialerDelegate = findChild(desktopStage, "stageDelegate_dialer-app");
264+ verify(dialerDelegate);
265+
266+ var cameraApp = startApplication("camera-app");
267+ var cameraDelegate = findChild(desktopStage, "stageDelegate_camera-app");
268+ verify(cameraDelegate);
269+ findChild(dialerDelegate, "decoratedWindow").maximize();
270+
271+ var galleryApp = startApplication("gallery-app");
272+ var galleryDelegate = findChild(desktopStage, "stageDelegate_gallery-app");
273+ verify(galleryDelegate);
274+ findChild(galleryDelegate, "decoratedWindow").maximize();
275+
276+ tryCompare(dialerDelegate, "visuallyMaximized", true);
277+ tryCompare(galleryDelegate, "visuallyMaximized", true);
278+
279+ tryCompare(dashApp.session.surface, "visible", false);
280+ tryCompare(dialerApp.session.surface, "visible", false);
281+ tryCompare(cameraApp.session.surface, "visible", false);
282+
283+ ApplicationManager.stopApplication("gallery-app");
284+
285+ compare(cameraApp.session.surface.visible, true);
286+ tryCompare(dialerApp.session.surface, "visible", true);
287+ tryCompare(dashApp.session.surface, "visible", false); // still occluded by maximised dialer
288+ }
213289 }
214290}
tests/qmltests/Stages/tst_PhoneStage.qml+6−4
@@ -14,18 +14,21 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21+import "../../../qml/Components"
2122import "../../../qml/Stages"
22−import Ubuntu.Components 0.1
23+import Ubuntu.Components 1.3
2324import Unity.Application 0.1
2425
2526Item {
2627 width: units.gu(70)
2728 height: units.gu(70)
2829
30+ property var greeter: { fullyShown: true }
31+
2932 PhoneStage {
3033 id: phoneStage
3134 anchors { fill: parent; rightMargin: units.gu(30) }
@@ -34,8 +37,7 @@ Item {
3437 maximizedAppTopMargin: units.gu(3) + units.dp(2)
3538 interactive: true
3639 shellOrientation: Qt.PortraitOrientation
37− shellPrimaryOrientation: Qt.PortraitOrientation
38− nativeOrientation: Qt.PortraitOrientation
40+ orientations: Orientations {}
3941 }
4042
4143 Binding {
tests/qmltests/Stages/tst_SessionContainer.qml+2−2
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import Unity.Test 0.1 as UT
21−import Ubuntu.Components 0.1
21+import Ubuntu.Components 1.3
2222import Unity.Application 0.1
2323import "../../../qml/Stages"
2424
tests/qmltests/Stages/tst_Splash.qml+2−2
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
2121import "../../../qml/Stages"
22−import Ubuntu.Components 0.1
22+import Ubuntu.Components 1.3
2323import Unity.Application 0.1
2424
2525Rectangle {
tests/qmltests/Stages/tst_SpreadDelegate.qml+9−5
@@ -14,13 +14,14 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1 as UT
2020import ".."
21+import "../../../qml/Components"
2122import "../../../qml/Stages"
22−import Ubuntu.Components 0.1
23−import Ubuntu.Components.ListItems 1.0 as ListItem
23+import Ubuntu.Components 1.3
24+import Ubuntu.Components.ListItems 1.3 as ListItem
2425import Unity.Application 0.1
2526
2627Rectangle {
@@ -73,8 +74,11 @@ Rectangle {
7374 return Qt.LandscapeOrientation;
7475 }
7576 }
76− shellPrimaryOrientation: Qt.PortraitOrientation
77− nativeOrientation: Qt.PortraitOrientation
77+
78+ orientations: Orientations {
79+ // the default values will do
80+ }
81+
7882 maximizedAppTopMargin: units.gu(3)
7983 Component.onDestruction: {
8084 spreadDelegateLoader.itemDestroyed = true;
tests/qmltests/Stages/tst_SurfaceContainer.qml+2−2
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import Unity.Test 0.1
2020import ".."
2121import "../../../qml/Stages"
22−import Ubuntu.Components 0.1
22+import Ubuntu.Components 1.3
2323import Unity.Application 0.1
2424
2525Rectangle {
tests/qmltests/Stages/tst_TabletStage.qml+10−5
@@ -14,14 +14,15 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 1.1
20−import Ubuntu.Components.ListItems 1.0 as ListItem
19+import Ubuntu.Components 1.3
20+import Ubuntu.Components.ListItems 1.3 as ListItem
2121import Unity.Application 0.1
2222import Unity.Test 0.1
2323
2424import "../../../qml/Stages"
25+import "../../../qml/Components"
2526
2627Rectangle {
2728 id: root
@@ -29,6 +30,8 @@ Rectangle {
2930 width: tabletStageLoader.width + controls.width
3031 height: tabletStageLoader.height
3132
33+ property var greeter: { fullyShown: true }
34+
3235 Loader {
3336 id: tabletStageLoader
3437
@@ -50,10 +53,12 @@ Rectangle {
5053 maximizedAppTopMargin: units.gu(3) + units.dp(2)
5154 interactive: true
5255 shellOrientation: Qt.LandscapeOrientation
53− shellPrimaryOrientation: Qt.LandscapeOrientation
54− nativeOrientation: Qt.LandscapeOrientation
5556 nativeWidth: width
5657 nativeHeight: height
58+ orientations: Orientations {
59+ native_: Qt.LandscapeOrientation
60+ primary: Qt.LandscapeOrientation
61+ }
5762 focus: true
5863 }
5964 }
tests/qmltests/Stages/tst_WindowResizeArea.qml+38−5
@@ -14,14 +14,14 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.1
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
2020import Unity.Test 0.1
2121import ".."
2222import "../../../qml/Stages"
23−import Ubuntu.Components 0.1
24−import Ubuntu.Components.ListItems 1.0 as ListItem
23+import Ubuntu.Components 1.3
24+import Ubuntu.Components.ListItems 1.3 as ListItem
2525import Unity.Application 0.1
2626
2727Item {
@@ -44,8 +44,11 @@ Item {
4444 width: units.gu(20)
4545 property int windowHeight: height
4646 property int windowWidth: width
47− onWindowHeightChanged: height = windowHeight
48− onWindowWidthChanged: width = windowWidth
47+ state: "normal"
48+
49+ function maximize() {
50+ state = "maximized"
51+ }
4952
5053 WindowResizeArea {
5154 id: windowResizeArea
@@ -195,5 +198,35 @@ Item {
195198 tryCompare(fakeWindow, "width", initialWindowWidth);
196199 tryCompare(fakeWindow, "height", initialWindowHeight);
197200 }
201+
202+ function test_saveRestoreMaximized() {
203+ var initialWindowX = fakeWindow.x;
204+ var initialWindowY = fakeWindow.y;
205+
206+ var moveDelta = units.gu(5);
207+
208+ fakeWindow.x = initialWindowX + moveDelta
209+ fakeWindow.y = initialWindowY + moveDelta
210+
211+ // Now change the state to maximized. The window should not keep updating the stored values
212+ fakeWindow.state = "maximized"
213+ fakeWindow.x = 31415 // 0 is too risky to pass the test even when broken
214+ fakeWindow.y = 31415
215+
216+ // This will destroy the window and recreate it
217+ windowLoader.active = false;
218+ waitForRendering(root);
219+ windowLoader.active = true;
220+
221+ // Make sure it's again where we left it in normal state before destroying
222+ tryCompare(fakeWindow, "x", initialWindowX + moveDelta)
223+ tryCompare(fakeWindow, "y", initialWindowX + moveDelta)
224+
225+ // Make sure maximize() has been called after restoring
226+ tryCompare(fakeWindow, "state", "maximized")
227+
228+ // clean up
229+ fakeWindow.state = "normal"
230+ }
198231 }
199232}
tests/qmltests/Tutorial/tst_Tutorial.qml+3−3
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import AccountsService 0.1
20−import LightDM.IntegratedLightDM 0.1 as LightDM
21−import Ubuntu.Components 1.1
20+import IntegratedLightDM 0.1 as LightDM
21+import Ubuntu.Components 1.3
2222import Unity.Application 0.1
2323import Unity.Test 0.1 as UT
2424
tests/qmltests/Wizard/tst_Wizard.qml+3−3
@@ -14,12 +14,12 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.3
17+import QtQuick 2.4
1818import QtTest 1.0
1919import AccountsService 0.1
2020import MeeGo.QOfono 0.2
2121import QMenuModel 0.1
22−import Ubuntu.Components 1.1
22+import Ubuntu.Components 1.3
2323import Ubuntu.SystemSettings.SecurityPrivacy 1.0
2424import Unity.Test 0.1 as UT
2525import Wizard 0.1
@@ -96,7 +96,7 @@ Item {
9696 }
9797
9898 Component.onCompleted: {
99− Theme.name = "Ubuntu.Components.Themes.SuruGradient";
99+ theme.name = "Ubuntu.Components.Themes.SuruGradient";
100100 setup();
101101 }
102102
tests/qmltests/tst_OrientedShell.qml+4−4
@@ -14,11 +14,11 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
1919import QtTest 1.0
20−import Ubuntu.Components 1.1
21−import Ubuntu.Components.ListItems 1.0 as ListItem
20+import Ubuntu.Components 1.3
21+import Ubuntu.Components.ListItems 1.3 as ListItem
2222import Unity.Application 0.1
2323import Unity.Test 0.1
2424import LightDM.IntegratedLightDM 0.1 as LightDM
@@ -840,7 +840,7 @@ Rectangle {
840840 // shell should remain in its primery orientation as the app in the main stage
841841 // is the one that dictates its orientation. In this case it's unity8-dash
842842 // which supports only primary orientation
843− compare(shell.orientation, orientedShell.primaryOrientation);
843+ compare(shell.orientation, orientedShell.orientations.primary);
844844 }
845845
846846 function test_sideStageAppsRemainPortraitInSpread_data() {
tests/qmltests/tst_Shell.qml+153−7
@@ -14,13 +14,13 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
1919import AccountsService 0.1
2020import GSettings 1.0
21−import LightDM.IntegratedLightDM 0.1 as LightDM
22−import Ubuntu.Components 1.1
23−import Ubuntu.Components.ListItems 1.0 as ListItem
21+import IntegratedLightDM 0.1 as LightDM
22+import Ubuntu.Components 1.3
23+import Ubuntu.Components.ListItems 1.3 as ListItem
2424import Ubuntu.Telephony 0.1 as Telephony
2525import Unity.Application 0.1
2626import Unity.Connectivity 0.1
@@ -29,8 +29,11 @@ import Unity.Notifications 1.0
2929import Unity.Test 0.1
3030import Powerd 0.1
3131import Wizard 0.1 as Wizard
32+import Utils 0.1
3233
3334import "../../qml"
35+import "../../qml/Components"
36+import "../../qml/Components/PanelState"
3437import "Stages"
3538
3639Rectangle {
@@ -58,6 +61,10 @@ Rectangle {
5861
5962 anchors.centerIn: parent
6063
64+ property int shellOrientation: Qt.PortraitOrientation
65+ property int nativeOrientation: Qt.PortraitOrientation
66+ property int primaryOrientation: Qt.PortraitOrientation
67+
6168 state: "phone"
6269 states: [
6370 State {
@@ -74,6 +81,9 @@ Rectangle {
7481 target: shellLoader
7582 width: units.gu(100)
7683 height: units.gu(71)
84+ shellOrientation: Qt.LandscapeOrientation
85+ nativeOrientation: Qt.LandscapeOrientation
86+ primaryOrientation: Qt.LandscapeOrientation
7787 }
7888 },
7989 State {
@@ -96,9 +106,13 @@ Rectangle {
96106 Shell {
97107 id: __shell
98108 usageScenario: usageScenarioSelector.model[usageScenarioSelector.selectedIndex]
99− orientation: Qt.PortraitOrientation
100− primaryOrientation: Qt.PortraitOrientation
101− nativeOrientation: Qt.PortraitOrientation
109+ nativeWidth: width
110+ nativeHeight: height
111+ orientation: shellLoader.shellOrientation
112+ orientations: Orientations {
113+ native_: shellLoader.nativeOrientation
114+ primary: shellLoader.primaryOrientation
115+ }
102116 Component.onDestruction: {
103117 shellLoader.itemDestroyed = true;
104118 }
@@ -302,6 +316,7 @@ Rectangle {
302316 mouseEmulation.checked = true;
303317 tryCompare(shell, "enabled", true); // make sure greeter didn't leave us in disabled state
304318 tearDown();
319+ WindowStateStorage.clear();
305320 }
306321
307322 function loadShell(formFactor) {
@@ -377,6 +392,8 @@ Rectangle {
377392 LightDM.Greeter.authenticate(""); // reset greeter
378393
379394 sessionSpy.clear();
395+
396+ GSettingsController.setLifecycleExemptAppids([]);
380397 }
381398
382399 function killApps() {
@@ -1707,5 +1724,134 @@ Rectangle {
17071724
17081725 keyRelease(Qt.Key_Control);
17091726 }
1727+
1728+ // regression test for http://pad.lv/1443319
1729+ function test_closeMaximizedAndRestart() {
1730+ loadDesktopShellWithApps();
1731+
1732+ var appRepeater = findChild(shell, "appRepeater")
1733+ var appId = ApplicationManager.get(0).appId;
1734+ var appDelegate = appRepeater.itemAt(0);
1735+ var maximizeButton = findChild(appDelegate, "maximizeWindowButton");
1736+
1737+ tryCompare(appDelegate, "state", "normal");
1738+ tryCompare(PanelState, "buttonsVisible", false)
1739+
1740+ mouseClick(maximizeButton, maximizeButton.width / 2, maximizeButton.height / 2);
1741+ tryCompare(appDelegate, "state", "maximized");
1742+ tryCompare(PanelState, "buttonsVisible", true)
1743+
1744+ ApplicationManager.stopApplication(appId);
1745+ tryCompare(PanelState, "buttonsVisible", false)
1746+
1747+ ApplicationManager.startApplication(appId);
1748+ tryCompare(PanelState, "buttonsVisible", true)
1749+ }
1750+
1751+ function test_newAppHasValidGeometry() {
1752+ loadDesktopShellWithApps();
1753+ var appRepeater = findChild(shell, "appRepeater");
1754+ var appId = ApplicationManager.get(0).appId;
1755+ var appDelegate = appRepeater.itemAt(0);
1756+
1757+ var resizeArea = findChild(appDelegate, "windowResizeArea");
1758+ var priv = findInvisibleChild(resizeArea, "priv");
1759+
1760+ // Make sure windows are at 0,0 or greater and they have a size that's > 0
1761+ compare(priv.normalX >= 0, true)
1762+ compare(priv.normalY >= 0, true)
1763+ compare(priv.normalWidth > 0, true)
1764+ compare(priv.normalHeight > 0, true)
1765+ }
1766+
1767+ // bug http://pad.lv/1431566
1768+ function test_switchToStagedHidesPanelButtons() {
1769+ loadDesktopShellWithApps();
1770+ var appRepeater = findChild(shell, "appRepeater")
1771+ var appId = ApplicationManager.get(0).appId;
1772+ var appDelegate = appRepeater.itemAt(0);
1773+ var panelButtons = findChild(shell, "panelWindowControlButtons")
1774+
1775+ tryCompare(appDelegate, "state", "normal");
1776+ tryCompare(panelButtons, "visible", false);
1777+
1778+ appDelegate.maximize(false);
1779+ tryCompare(panelButtons, "visible", true);
1780+
1781+ shell.usageScenario = "phone";
1782+ waitForRendering(shell);
1783+ tryCompare(panelButtons, "visible", false);
1784+
1785+ shell.usageScenario = "desktop";
1786+ waitForRendering(shell);
1787+ tryCompare(panelButtons, "visible", true);
1788+ }
1789+
1790+ function test_lockingGreeterHidesPanelButtons() {
1791+ loadDesktopShellWithApps();
1792+ var appRepeater = findChild(shell, "appRepeater")
1793+ var appId = ApplicationManager.get(0).appId;
1794+ var appDelegate = appRepeater.itemAt(0);
1795+ var panelButtons = findChild(shell, "panelWindowControlButtons")
1796+
1797+ tryCompare(appDelegate, "state", "normal");
1798+ tryCompare(panelButtons, "visible", false);
1799+
1800+ appDelegate.maximize(false);
1801+ tryCompare(panelButtons, "visible", true);
1802+
1803+ LightDM.Greeter.showGreeter();
1804+ waitForRendering(shell);
1805+ tryCompare(panelButtons, "visible", false);
1806+
1807+ LightDM.Greeter.hideGreeter();
1808+ waitForRendering(shell);
1809+ tryCompare(panelButtons, "visible", true);
1810+ }
1811+
1812+ function test_lifecyclePolicyForNonTouchApp_data() {
1813+ return [
1814+ {tag: "phone", formFactor: "phone", usageScenario: "phone"},
1815+ {tag: "tablet", formFactor: "tablet", usageScenario: "tablet"}
1816+ ]
1817+ }
1818+
1819+ function test_lifecyclePolicyForNonTouchApp(data) {
1820+ loadShell(data.formFactor);
1821+ shell.usageScenario = data.usageScenario;
1822+
1823+ var app1 = ApplicationManager.startApplication("libreoffice");
1824+ waitUntilAppWindowIsFullyLoaded(app1);
1825+ var app2 = ApplicationManager.startApplication("dialer-app");
1826+ waitUntilAppWindowIsFullyLoaded(app2);
1827+
1828+ // Make sure app1 is unfocused but still running
1829+ compare(app1.session.surface.activeFocus, false);
1830+ compare(app1.isTouchApp, false); // sanity check our mock, which sets this for us
1831+ compare(app1.requestedState, ApplicationInfoInterface.RequestedRunning);
1832+ }
1833+
1834+ function test_lifecyclePolicyExemption_data() {
1835+ return [
1836+ {tag: "phone", formFactor: "phone", usageScenario: "phone", suspendsApps: true},
1837+ {tag: "tablet", formFactor: "tablet", usageScenario: "tablet", suspendsApps: true}
1838+ ]
1839+ }
1840+
1841+ function test_lifecyclePolicyExemption(data) {
1842+ loadShell(data.formFactor);
1843+ shell.usageScenario = data.usageScenario;
1844+
1845+ GSettingsController.setLifecycleExemptAppids(["webbrowser-app"]);
1846+
1847+ var app1 = ApplicationManager.startApplication("webbrowser-app");
1848+ waitUntilAppWindowIsFullyLoaded(app1);
1849+ var app2 = ApplicationManager.startApplication("dialer-app");
1850+ waitUntilAppWindowIsFullyLoaded(app2);
1851+
1852+ // Make sure app1 is unfocused but still running
1853+ compare(app1.session.surface.activeFocus, false);
1854+ compare(app1.requestedState, ApplicationInfoInterface.RequestedRunning);
1855+ }
17101856 }
17111857}
tests/qmltests/tst_ShellWithPin.qml+2−2
@@ -14,8 +14,8 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
18−import Ubuntu.Components 1.0
17+import QtQuick 2.4
18+import Ubuntu.Components 1.3
1919import QtTest 1.0
2020import AccountsService 0.1
2121import GSettings 1.0
tests/qmltests/utils/Unity/Test/MockObjectForInstanceOfTest.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919Rectangle {
2020 property int dummy
tests/qmltests/utils/Unity/Test/MockObjectForInstanceOfTestChild.qml+1−1
@@ -14,7 +14,7 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818
1919MockObjectForInstanceOfTest {
2020 property int dummy2
tests/qmltests/utils/Unity/Test/tst_UnityTest.qml+1−1
@@ -15,7 +15,7 @@
1515 */
1616
1717
18−import QtQuick 2.0
18+import QtQuick 2.4
1919import QtTest 1.0
2020import Unity.Test 0.1
2121
tests/utils/modules/Unity/Test/MouseTouchEmulationCheckbox.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtQuick.Layouts 1.1
19−import Ubuntu.Components 1.1
19+import Ubuntu.Components 1.3
2020import Unity.Test 0.1
2121
2222RowLayout {
tests/utils/modules/Unity/Test/TouchEventSequenceWrapper.cpp−2
@@ -27,12 +27,10 @@ TouchEventSequenceWrapper::TouchEventSequenceWrapper(QTest::QTouchEventSequence
2727void TouchEventSequenceWrapper::commit(bool processEvents)
2828{
2929 m_eventSequence.commit(processEvents);
30−#if (QT_VERSION >= QT_VERSION_CHECK(5, 4, 0))
3130 if (m_item->window()) {
3231 QQuickWindowPrivate *wp = QQuickWindowPrivate::get(m_item->window());
3332 wp->flushDelayedTouchEvent();
3433 }
35−#endif
3634}
3735
3836void TouchEventSequenceWrapper::move(int touchId, int x, int y)
tests/utils/modules/Unity/Test/UnityTestCase.qml+2−2
@@ -14,9 +14,9 @@
1414 * along with this program. If not, see <http://www.gnu.org/licenses/>.
1515 */
1616
17−import QtQuick 2.0
17+import QtQuick 2.4
1818import QtTest 1.0
19−import Ubuntu.Components 0.1
19+import Ubuntu.Components 1.3
2020import Unity.Test 0.1 as UT
2121
2222TestCase {