on xenial help sign in
merge trunk, resolve conflicts
b480877Lukáš Tinkl
CMakeLists.txt+1−1
@@ -57,7 +57,7 @@ find_package(Qt5DBus 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
57find_package(Qt5Concurrent 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
58find_package(Qt5Sql 5.4 REQUIRED)
59
59
60−pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=12)
60+pkg_check_modules(APPLICATION_API REQUIRED unity-shell-application=13)
61pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
61pkg_check_modules(GIO REQUIRED gio-2.0>=2.32)
62pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
62pkg_check_modules(GLIB REQUIRED glib-2.0>=2.32)
63pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
63pkg_check_modules(QMENUMODEL REQUIRED qmenumodel)
data/unity8.conf+4−2
@@ -44,7 +44,11 @@ pre-start script
44 fi
44 fi
45
45
46 initctl set-env --global MIR_SERVER_PROMPT_FILE=1
46 initctl set-env --global MIR_SERVER_PROMPT_FILE=1
47+end script
48+
49+exec ${BINARY:-unity8} $ARGS
47
50
51+post-start script
48 initctl emit --no-wait indicator-services-start
52 initctl emit --no-wait indicator-services-start
49
53
50 # Disable Qt's stuttering 'touch compression' to fix scrolling smoothness
54 # Disable Qt's stuttering 'touch compression' to fix scrolling smoothness
@@ -58,8 +62,6 @@ pre-start script
58 # initctl set-env MIR_SERVER_NBUFFERS=2
62 # initctl set-env MIR_SERVER_NBUFFERS=2
59end script
63end script
60
64
61−exec ${BINARY:-unity8} $ARGS
62−
63post-stop script
65post-stop script
64 initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET
66 initctl set-env --global MIR_SOCKET=$UNITY_MIR_SOCKET
65 initctl unset-env --global UNITY_MIR_SOCKET
67 initctl unset-env --global UNITY_MIR_SOCKET
debian/changelog+52
@@ -4,6 +4,58 @@ unity8 (8.13+15.04.20150914-0ubuntu1) UNRELEASED; urgency=medium
4
4
5 -- Lukas Tinkl <ltinkl@canonical.com> Mon, 14 Sep 2015 19:19:23 +0200
5 -- Lukas Tinkl <ltinkl@canonical.com> Mon, 14 Sep 2015 19:19:23 +0200
6
6
7+unity8 (8.11+16.04.20160212-0ubuntu1) xenial; urgency=medium
8+
9+ [ Albert Astals Cid ]
10+ * Do not use components in card creator generated code
11+ * Forward the makesurevisible signal from the inner preview widget
12+ * Make fallback also be fallback when the image is empty and not only
13+ on error (LP: #1531913)
14+ * Make the artShapeSize assignment be updated when using dynamic grid
15+ units
16+ * Visual improvements to the dash audio play cards
17+ * We don't use the unity-scope-scopes anymore (LP: #1439172)
18+
19+ [ Andrea Cimitan ]
20+ * only request a bigger image if zoomable widget data property is
21+ true, otherwise just leave the screen size (LP: #1536814)
22+
23+ [ CI Train Bot ]
24+ * Update translation template
25+
26+ [ Daniel d'Andrada ]
27+ * Set initial surface size (LP: #1532974)
28+
29+ [ Daniel d'Andrada, Michał Sawicz ]
30+ * Window Size Hints
31+
32+ [ Florian Boucault ]
33+ * Splash screen: delay showing the ActivityIndicator by 2 seconds.
34+
35+ [ Lukáš Tinkl ]
36+ * Replace the word "phone" with a more generic term "device" in the
37+ welcome wizard (LP: #1294732, #1543527)
38+
39+ [ Michael Terry ]
40+ * Have the tablet greeter set appropriate OSK hints if the user has a
41+ passcode instead of a passphrase. (LP: #1544173)
42+
43+ [ Michael Zanetti ]
44+ * Don't eat mouse events in the edgebarrer
45+
46+ [ Michał Sawicz ]
47+ * Bump unity-api dependencies
48+
49+ [ Nick Dedekind ]
50+ * Added support for secondary indicator actions (LP: #1398888)
51+ * Remove zombie if they're not animated. (LP: #1534541)
52+ * Removed unused panel resources
53+
54+ [ Ted Gould ]
55+ * Start the indicators after Unity8 starts instead of before
56+
57+ -- Michał Sawicz <michal.sawicz@canonical.com> Fri, 12 Feb 2016 00:12:41 +0000
58+
7unity8 (8.11+16.04.20160208-0ubuntu1) xenial; urgency=medium
59unity8 (8.11+16.04.20160208-0ubuntu1) xenial; urgency=medium
8
60
9 [ Albert Astals Cid ]
61 [ Albert Astals Cid ]
debian/control+3−4
@@ -30,7 +30,7 @@ Build-Depends: cmake,
30 libsystemsettings-dev,
30 libsystemsettings-dev,
31 libtimezonemap1-dev,
31 libtimezonemap1-dev,
32 libudev-dev,
32 libudev-dev,
33− libunity-api-dev (>= 7.105),
33+ libunity-api-dev (>= 7.106),
34 libusermetricsoutput1-dev,
34 libusermetricsoutput1-dev,
35# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
35# Need those X11 libs touch emulation from mouse events in manual QML tests on a X11 desktop
36 libx11-dev[!armhf],
36 libx11-dev[!armhf],
@@ -116,7 +116,6 @@ Depends: dmz-cursor-theme,
116 ${shlibs:Depends},
116 ${shlibs:Depends},
117Recommends: unity-scope-click,
117Recommends: unity-scope-click,
118 unity-scope-mediascanner2,
118 unity-scope-mediascanner2,
119− unity-scope-scopes,
120Breaks: indicator-network (<< 0.5.1+14.10.20141014),
119Breaks: indicator-network (<< 0.5.1+14.10.20141014),
121 ubuntu-touch-session (<< 0.107),
120 ubuntu-touch-session (<< 0.107),
122 unity8-greeter (<< 7.89),
121 unity8-greeter (<< 7.89),
@@ -134,7 +133,7 @@ Depends: qml-module-qtquick-layouts,
134 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
133 qtdeclarative5-ubuntu-ui-toolkit-plugin (>= 1.3.1627) | qtdeclarative5-ubuntu-ui-toolkit-plugin-gles (>= 1.3.1627),
135 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
134 qtdeclarative5-unity-notifications-plugin (>= 0.1.2) | unity-notifications-impl,
136 ubuntu-thumbnailer-impl-0,
135 ubuntu-thumbnailer-impl-0,
137− unity-application-impl-12,
136+ unity-application-impl-13,
138 unity-notifications-impl-3,
137 unity-notifications-impl-3,
139 unity-plugin-scopes | unity-scopes-impl,
138 unity-plugin-scopes | unity-scopes-impl,
140 unity-scopes-impl-9,
139 unity-scopes-impl-9,
@@ -180,7 +179,7 @@ Pre-Depends: ${misc:Pre-Depends},
180Depends: ${misc:Depends},
179Depends: ${misc:Depends},
181 ${shlibs:Depends},
180 ${shlibs:Depends},
182Provides: unity-application-impl,
181Provides: unity-application-impl,
183− unity-application-impl-12,
182+ unity-application-impl-13,
184Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
183Replaces: unity8-autopilot (<< 8.02+15.04.20150422-0ubuntu1)
185Description: Fake environment for running Unity 8 shell
184Description: Fake environment for running Unity 8 shell
186 Provides fake implementations of some QML modules used by Unity 8 shell
185 Provides fake implementations of some QML modules used by Unity 8 shell
plugins/Dash/CardCreator.js+44−19
@@ -61,7 +61,10 @@ var kBackgroundLoaderCode = 'Loader {\n\
61// %1 is used as anchors of artShapeHolder
61// %1 is used as anchors of artShapeHolder
62// %2 is used as image width
62// %2 is used as image width
63// %3 is used as image height
63// %3 is used as image height
64+// %4 is used for artShapeSource.hideSource and inner Loader visible
65+// %5 is used as aspect ratio fallback
64−// %4 is injected as code to artImage
66+// %6 is injected as code to artImage
67+// %7 is used as image fallback
65var kArtShapeHolderCode = 'Item { \n\
68var kArtShapeHolderCode = 'Item { \n\
66 id: artShapeHolder; \n\
69 id: artShapeHolder; \n\
67 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
70 height: root.fixedArtShapeSize.height > 0 ? root.fixedArtShapeSize.height : artShapeLoader.height; \n\
@@ -70,13 +73,13 @@ var kArtShapeHolderCode = 'Item { \n\
70 Loader { \n\
73 Loader { \n\
71 id: artShapeLoader; \n\
74 id: artShapeLoader; \n\
72 objectName: "artShapeLoader"; \n\
75 objectName: "artShapeLoader"; \n\
73− active: cardData && cardData["art"] || false; \n\
76+ readonly property string cardArt: cardData && cardData["art"] || %7; \n\
77+ active: cardArt != ""; \n\
74 asynchronous: root.asynchronous; \n\
78 asynchronous: root.asynchronous; \n\
75 visible: status == Loader.Ready; \n\
79 visible: status == Loader.Ready; \n\
76 sourceComponent: Item { \n\
80 sourceComponent: Item { \n\
77 id: artShape; \n\
81 id: artShape; \n\
78 objectName: "artShape"; \n\
82 objectName: "artShape"; \n\
79− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true; \n\
80 visible: image.status == Image.Ready; \n\
83 visible: image.status == Image.Ready; \n\
81 readonly property alias image: artImage; \n\
84 readonly property alias image: artImage; \n\
82 ShaderEffectSource { \n\
85 ShaderEffectSource { \n\
@@ -85,11 +88,11 @@ var kArtShapeHolderCode = 'Item { \n\
85 anchors.centerIn: parent; \n\
88 anchors.centerIn: parent; \n\
86 width: 1; \n\
89 width: 1; \n\
87 height: 1; \n\
90 height: 1; \n\
88− hideSource: doShapeItem; \n\
91+ hideSource: %4; \n\
89 } \n\
92 } \n\
90 Loader { \n\
93 Loader { \n\
91 anchors.fill: parent; \n\
94 anchors.fill: parent; \n\
92− visible: artShape.doShapeItem; \n\
95+ visible: %4; \n\
93 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent; \n\
96 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent; \n\
94 Component { \n\
97 Component { \n\
95 id: artShapeShapeComponent; \n\
98 id: artShapeShapeComponent; \n\
@@ -113,7 +116,7 @@ var kArtShapeHolderCode = 'Item { \n\
113 } \n\
116 } \n\
114 } \n\
117 } \n\
115 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
118 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1; \n\
116− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1; \n\
119+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : %5; \n\
117 Component.onCompleted: { updateWidthHeightBindings(); } \n\
120 Component.onCompleted: { updateWidthHeightBindings(); } \n\
118 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
121 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); } \n\
119 function updateWidthHeightBindings() { \n\
122 function updateWidthHeightBindings() { \n\
@@ -128,11 +131,11 @@ var kArtShapeHolderCode = 'Item { \n\
128 CroppedImageMinimumSourceSize { \n\
131 CroppedImageMinimumSourceSize { \n\
129 id: artImage; \n\
132 id: artImage; \n\
130 objectName: "artImage"; \n\
133 objectName: "artImage"; \n\
131− source: cardData && cardData["art"] || ""; \n\
134+ source: artShapeLoader.cardArt; \n\
132 asynchronous: root.asynchronous; \n\
135 asynchronous: root.asynchronous; \n\
133 width: %2; \n\
136 width: %2; \n\
134 height: %3; \n\
137 height: %3; \n\
135− %4 \n\
138+ %6 \n\
136 } \n\
139 } \n\
137 } \n\
140 } \n\
138 } \n\
141 } \n\
@@ -152,11 +155,20 @@ var kAudioButtonCode = 'AbstractButton { \n\
152 visible: parent.pressed; \n\
155 visible: parent.pressed; \n\
153 radius: "medium"; \n\
156 radius: "medium"; \n\
154 } \n\
157 } \n\
158+ Rectangle { \n\
159+ color: Qt.rgba(0, 0, 0, 0.5); \n\
160+ anchors.centerIn: parent; \n\
161+ width: parent.width * 0.5; \n\
162+ height: width; \n\
163+ radius: width / 2; \n\
164+ } \n\
155 Icon { \n\
165 Icon { \n\
156− anchors.fill: parent; \n\
166+ anchors.centerIn: parent; \n\
157− anchors.margins: parent.height > units.gu(5) ? units.gu(2) : 0; \n\
167+ width: parent.width * 0.3; \n\
168+ height: width; \n\
158 opacity: 0.9; \n\
169 opacity: 0.9; \n\
159 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"; \n\
170 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start"; \n\
171+ color: "white"; \n\
160 } \n\
172 } \n\
161 onClicked: { \n\
173 onClicked: { \n\
162 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\
174 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) { \n\
@@ -245,11 +257,12 @@ var kMascotShapeLoaderCode = 'Loader { \n\
245// %1 is used as anchors of mascotImage
257// %1 is used as anchors of mascotImage
246// %2 is used as visible of mascotImage
258// %2 is used as visible of mascotImage
247// %3 is injected as code to mascotImage
259// %3 is injected as code to mascotImage
260+// %4 is used as fallback image
248var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\
261var kMascotImageCode = 'CroppedImageMinimumSourceSize { \n\
249 id: mascotImage; \n\
262 id: mascotImage; \n\
250 objectName: "mascotImage"; \n\
263 objectName: "mascotImage"; \n\
251 anchors { %1 } \n\
264 anchors { %1 } \n\
252− source: cardData && cardData["mascot"] || ""; \n\
265+ source: cardData && cardData["mascot"] || %4; \n\
253 width: units.gu(6); \n\
266 width: units.gu(6); \n\
254 height: units.gu(5.625); \n\
267 height: units.gu(5.625); \n\
255 horizontalAlignment: Image.AlignHCenter; \n\
268 horizontalAlignment: Image.AlignHCenter; \n\
@@ -392,7 +405,6 @@ function cardString(template, components) {
392
405
393 code = 'AbstractButton { \n\
406 code = 'AbstractButton { \n\
394 id: root; \n\
407 id: root; \n\
395− property var components; \n\
396 property var cardData; \n\
408 property var cardData; \n\
397 property string artShapeStyle: "inset"; \n\
409 property string artShapeStyle: "inset"; \n\
398 property string backgroundShapeStyle: "inset"; \n\
410 property string backgroundShapeStyle: "inset"; \n\
@@ -410,7 +422,8 @@ function cardString(template, components) {
410
422
411 var hasArt = components["art"] && components["art"]["field"] || false;
423 var hasArt = components["art"] && components["art"]["field"] || false;
412 var hasSummary = components["summary"] || false;
424 var hasSummary = components["summary"] || false;
425+ var isConciergeMode = components["art"] && components["art"]["conciergeMode"] || false;
413− var artAndSummary = hasArt && hasSummary && components["art"]["conciergeMode"] !== true;
426+ var artAndSummary = hasArt && hasSummary && !isConciergeMode;
414 var isHorizontal = template["card-layout"] === "horizontal";
427 var isHorizontal = template["card-layout"] === "horizontal";
415 var hasBackground = (!isHorizontal && (template["card-background"] || components["background"] || artAndSummary)) ||
428 var hasBackground = (!isHorizontal && (template["card-background"] || components["background"] || artAndSummary)) ||
416 (hasSummary && (template["card-background"] || components["background"]));
429 (hasSummary && (template["card-background"] || components["background"]));
@@ -480,13 +493,21 @@ function cardString(template, components) {
480 heightCode = 'width / artShape.aspect';
493 heightCode = 'width / artShape.aspect';
481 }
494 }
482
495
496+ var aspectRatio = components["art"] && components["art"]["aspect-ratio"] || 1;
497+ if (isNaN(aspectRatio)) {
498+ aspectRatio = 1;
499+ }
483 var fallback = components["art"] && components["art"]["fallback"] || "";
500 var fallback = components["art"] && components["art"]["fallback"] || "";
484 fallback = encodeURI(fallback);
501 fallback = encodeURI(fallback);
485− var fallbackCode = "";
502+ var fallbackStatusCode = "";
503+ var fallbackURICode = '""';
486 if (fallback !== "") {
504 if (fallback !== "") {
505+ // fallbackStatusCode has %6 in it because we want to substitute it for fallbackURICode
506+ // which in kArtShapeHolderCode is %7
487− fallbackCode += 'onStatusChanged: if (status === Image.Error) source = decodeURI("%1");'.arg(fallback);
507+ fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %7;';
508+ fallbackURICode = 'decodeURI("%1")'.arg(fallback);
488 }
509 }
489− code += kArtShapeHolderCode.arg(artAnchors).arg(widthCode).arg(heightCode).arg(fallbackCode);
510+ code += kArtShapeHolderCode.arg(artAnchors).arg(widthCode).arg(heightCode).arg(isConciergeMode ? "false" : "true").arg(aspectRatio).arg(fallbackStatusCode).arg(fallbackURICode);
490 } else {
511 } else {
491 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
512 code += 'readonly property size artShapeSize: Qt.size(-1, -1);\n'
492 }
513 }
@@ -580,11 +601,15 @@ function cardString(template, components) {
580 var mascotImageVisible = useMascotShape ? 'false' : 'showHeader';
601 var mascotImageVisible = useMascotShape ? 'false' : 'showHeader';
581 var fallback = components["mascot"] && components["mascot"]["fallback"] || "";
602 var fallback = components["mascot"] && components["mascot"]["fallback"] || "";
582 fallback = encodeURI(fallback);
603 fallback = encodeURI(fallback);
583− var fallbackCode = "";
604+ var fallbackStatusCode = "";
605+ var fallbackURICode = '""';
584 if (fallback !== "") {
606 if (fallback !== "") {
607+ // fallbackStatusCode has %4 in it because we want to substitute it for fallbackURICode
608+ // which in kMascotImageCode is %4
585− fallbackCode += 'onStatusChanged: if (status === Image.Error) source = decodeURI("%1");'.arg(fallback);
609+ fallbackStatusCode += 'onStatusChanged: if (status === Image.Error) source = %4;';
610+ fallbackURICode = 'decodeURI("%1")'.arg(fallback);
586 }
611 }
587− mascotCode = kMascotImageCode.arg(mascotAnchors).arg(mascotImageVisible).arg(fallbackCode);
612+ mascotCode = kMascotImageCode.arg(mascotAnchors).arg(mascotImageVisible).arg(fallbackStatusCode).arg(fallbackURICode);
588 }
613 }
589
614
590 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")';
615 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")';
plugins/Unity/Indicators/modelactionrootstate.cpp+76−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -32,6 +32,7 @@ extern "C" {
32ModelActionRootState::ModelActionRootState(QObject *parent)
32ModelActionRootState::ModelActionRootState(QObject *parent)
33 : RootStateObject(parent),
33 : RootStateObject(parent),
34 m_menu(nullptr)
34 m_menu(nullptr)
35+ , m_reentryGuard(false)
35{
36{
36}
37}
37
38
@@ -62,6 +63,7 @@ void ModelActionRootState::setMenu(UnityMenuModel* menu)
62 connect(m_menu, &UnityMenuModel::destroyed, this, &ModelActionRootState::reset);
63 connect(m_menu, &UnityMenuModel::destroyed, this, &ModelActionRootState::reset);
63 }
64 }
64 updateActionState();
65 updateActionState();
66+ updateOtherActions();
65 Q_EMIT menuChanged();
67 Q_EMIT menuChanged();
66
68
67 if (wasValid != valid())
69 if (wasValid != valid())
@@ -69,6 +71,21 @@ void ModelActionRootState::setMenu(UnityMenuModel* menu)
69 }
71 }
70}
72}
71
73
74+QString ModelActionRootState::secondaryAction() const
75+{
76+ return m_secondaryAction;
77+}
78+
79+QString ModelActionRootState::scrollAction() const
80+{
81+ return m_scrollAction;
82+}
83+
84+QString ModelActionRootState::submenuAction() const
85+{
86+ return m_submenuAction;
87+}
88+
72bool ModelActionRootState::valid() const
89bool ModelActionRootState::valid() const
73{
90{
74 return !currentState().empty();
91 return !currentState().empty();
@@ -79,6 +96,7 @@ void ModelActionRootState::onModelRowsAdded(const QModelIndex& parent, int start
79 Q_UNUSED(parent);
96 Q_UNUSED(parent);
80 if (start == 0 && end >= 0) {
97 if (start == 0 && end >= 0) {
81 updateActionState();
98 updateActionState();
99+ updateOtherActions();
82 }
100 }
83}
101}
84
102
@@ -87,6 +105,7 @@ void ModelActionRootState::onModelRowsRemoved(const QModelIndex& parent, int sta
87 Q_UNUSED(parent);
105 Q_UNUSED(parent);
88 if (start == 0 && end >= 0) {
106 if (start == 0 && end >= 0) {
89 updateActionState();
107 updateActionState();
108+ updateOtherActions();
90 }
109 }
91}
110}
92
111
@@ -99,6 +118,7 @@ void ModelActionRootState::onModelDataChanged(const QModelIndex& topLeft, const
99
118
100 if (topLeft.row() <= 0 && bottomRight.row() >= 0) {
119 if (topLeft.row() <= 0 && bottomRight.row() >= 0) {
101 updateActionState();
120 updateActionState();
121+ updateOtherActions();
102 }
122 }
103}
123}
104
124
@@ -108,10 +128,15 @@ void ModelActionRootState::reset()
108
128
109 Q_EMIT menuChanged();
129 Q_EMIT menuChanged();
110 setCurrentState(QVariantMap());
130 setCurrentState(QVariantMap());
131+
132+ updateOtherActions();
111}
133}
112
134
113void ModelActionRootState::updateActionState()
135void ModelActionRootState::updateActionState()
114{
136{
137+ if (m_reentryGuard) return;
138+ m_reentryGuard = true;
139+
115 if (m_menu && m_menu->rowCount() > 0) {
140 if (m_menu && m_menu->rowCount() > 0) {
116 ActionStateParser* oldParser = m_menu->actionStateParser();
141 ActionStateParser* oldParser = m_menu->actionStateParser();
117 m_menu->setActionStateParser(&m_parser);
142 m_menu->setActionStateParser(&m_parser);
@@ -126,4 +151,54 @@ void ModelActionRootState::updateActionState()
126 }
151 }
127 // else if m_menu->rowCount() == 0, let's leave existing cache in place
152 // else if m_menu->rowCount() == 0, let's leave existing cache in place
128 // until the new menu comes in, to avoid flashing the UI empty for a moment
153 // until the new menu comes in, to avoid flashing the UI empty for a moment
154+
155+ m_reentryGuard = false;
156+}
157+
158+void ModelActionRootState::updateOtherActions()
159+{
160+ if (m_reentryGuard) return;
161+ m_reentryGuard = true;
162+
163+ if (m_menu && m_menu->rowCount() > 0) {
164+ QVariantMap map;
165+ map[QStringLiteral("submenu-action")] = QStringLiteral("string");
166+ map[QStringLiteral("x-canonical-scroll-action")] = QStringLiteral("string");
167+ map[QStringLiteral("x-canonical-secondary-action")] = QStringLiteral("string");
168+ m_menu->loadExtendedAttributes(0, map);
169+ QVariantMap extMap = m_menu->get(0, "ext").toMap();
170+
171+ QString secondaryAction = extMap.value(QStringLiteral("xCanonicalSecondaryAction")).toString();
172+ if (m_secondaryAction != secondaryAction) {
173+ m_secondaryAction = secondaryAction;
174+ Q_EMIT secondaryActionChanged();
175+ }
176+
177+ QString scrollAction = extMap.value(QStringLiteral("xCanonicalScrollAction")).toString();
178+ if (m_scrollAction != scrollAction) {
179+ m_scrollAction = scrollAction;
180+ Q_EMIT scrollActionChanged();
181+ }
182+
183+ QString submenuAction = extMap.value(QStringLiteral("submenuAction")).toString();
184+ if (m_submenuAction != submenuAction) {
185+ m_submenuAction = submenuAction;
186+ Q_EMIT submenuActionChanged();
187+ }
188+ } else {
189+ if (!m_secondaryAction.isEmpty()) {
190+ m_secondaryAction.clear();
191+ Q_EMIT secondaryActionChanged();
192+ }
193+ if (!m_scrollAction.isEmpty()) {
194+ m_scrollAction.clear();
195+ Q_EMIT scrollActionChanged();
196+ }
197+ if (!m_submenuAction.isEmpty()) {
198+ m_submenuAction.clear();
199+ Q_EMIT submenuActionChanged();
200+ }
201+ }
202+
203+ m_reentryGuard = false;
129}
204}
plugins/Unity/Indicators/modelactionrootstate.h+15−4
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -30,6 +30,9 @@ class UNITYINDICATORS_EXPORT ModelActionRootState : public RootStateObject
30{
30{
31 Q_OBJECT
31 Q_OBJECT
32 Q_PROPERTY(UnityMenuModel* menu READ menu WRITE setMenu NOTIFY menuChanged)
32 Q_PROPERTY(UnityMenuModel* menu READ menu WRITE setMenu NOTIFY menuChanged)
33+ Q_PROPERTY(QString secondaryAction READ secondaryAction NOTIFY secondaryActionChanged)
34+ Q_PROPERTY(QString scrollAction READ scrollAction NOTIFY scrollActionChanged)
35+ Q_PROPERTY(QString submenuAction READ submenuAction NOTIFY submenuActionChanged)
33public:
36public:
34 ModelActionRootState(QObject *parent = 0);
37 ModelActionRootState(QObject *parent = 0);
35 virtual ~ModelActionRootState();
38 virtual ~ModelActionRootState();
@@ -37,14 +40,17 @@ public:
37 UnityMenuModel* menu() const;
40 UnityMenuModel* menu() const;
38 void setMenu(UnityMenuModel* menu);
41 void setMenu(UnityMenuModel* menu);
39
42
40− int index() const;
43+ QString secondaryAction() const;
41− void setIndex(int index);
44+ QString scrollAction() const;
45+ QString submenuAction() const;
42
46
43 bool valid() const override;
47 bool valid() const override;
44
48
45Q_SIGNALS:
49Q_SIGNALS:
46 void menuChanged();
50 void menuChanged();
47− void indexChanged();
51+ void secondaryActionChanged();
52+ void scrollActionChanged();
53+ void submenuActionChanged();
48
54
49private Q_SLOTS:
55private Q_SLOTS:
50 void onModelRowsAdded(const QModelIndex& parent, int start, int end);
56 void onModelRowsAdded(const QModelIndex& parent, int start, int end);
@@ -54,8 +60,13 @@ private Q_SLOTS:
54
60
55private:
61private:
56 void updateActionState();
62 void updateActionState();
63+ void updateOtherActions();
57
64
58 UnityMenuModel* m_menu;
65 UnityMenuModel* m_menu;
66+ QString m_secondaryAction;
67+ QString m_scrollAction;
68+ QString m_submenuAction;
69+ bool m_reentryGuard;
59};
70};
60
71
61#endif // MODELACTIONROOTSTATE_H
72#endif // MODELACTIONROOTSTATE_H
po/aa.ponew file+664
@@ -0,0 +1,664 @@
1+# Afar translation for unity8
2+# Copyright (c) 2016 Rosetta Contributors and Canonical Ltd 2016
3+# This file is distributed under the same license as the unity8 package.
4+# FIRST AUTHOR <EMAIL@ADDRESS>, 2016.
5+#
6+msgid ""
7+msgstr ""
8+"Project-Id-Version: unity8\n"
9+"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10+"POT-Creation-Date: 2016-02-08 09:50+0000\n"
11+"PO-Revision-Date: 2016-02-12 10:18+0000\n"
12+"Last-Translator: Charif AYFARAH <ayfarah@ymail.com>\n"
13+"Language-Team: Afar <aa@li.org>\n"
14+"MIME-Version: 1.0\n"
15+"Content-Type: text/plain; charset=UTF-8\n"
16+"Content-Transfer-Encoding: 8bit\n"
17+"Plural-Forms: nplurals=2; plural=n != 1;\n"
18+"X-Launchpad-Export-Date: 2016-02-13 05:37+0000\n"
19+"X-Generator: Launchpad (build 17925)\n"
20+
21+#: plugins/IntegratedLightDM/Greeter.cpp:112
22+msgid "Password: "
23+msgstr "Cuumita "
24+
25+#: plugins/Unity/Launcher/launcheritem.cpp:47
26+#: plugins/Unity/Launcher/launcheritem.cpp:106
27+msgid "Pin shortcut"
28+msgstr ""
29+
30+#: plugins/Unity/Launcher/launcheritem.cpp:52
31+msgid "Quit"
32+msgstr "Kat"
33+
34+#: plugins/Unity/Launcher/launcheritem.cpp:106
35+msgid "Unpin shortcut"
36+msgstr ""
37+
38+#: qml/Components/DelayedLockscreen.qml:49
39+msgid "Device Locked"
40+msgstr ""
41+
42+#: qml/Components/DelayedLockscreen.qml:64
43+msgid "You have been locked out due to too many failed passphrase attempts."
44+msgstr ""
45+
46+#: qml/Components/DelayedLockscreen.qml:65
47+msgid "You have been locked out due to too many failed passcode attempts."
48+msgstr ""
49+
50+#: qml/Components/DelayedLockscreen.qml:74
51+#, qt-format
52+msgid "Please wait %1 minute and then try again…"
53+msgid_plural "Please wait %1 minutes and then try again…"
54+msgstr[0] "Maganak %1 minit qambaalaay, kaadu gabbat"
55+msgstr[1] "Maganak %1 minit qambaalaay, kaadu gabbat"
56+
57+#: qml/Components/Dialogs.qml:144
58+msgctxt "Title: Lock/Log out dialog"
59+msgid "Log out"
60+msgstr "Eweq"
61+
62+#: qml/Components/Dialogs.qml:145
63+msgid "Are you sure you want to log out?"
64+msgstr ""
65+
66+#: qml/Components/Dialogs.qml:147
67+msgctxt "Button: Lock the system"
68+msgid "Lock"
69+msgstr "Koflis"
70+
71+#: qml/Components/Dialogs.qml:154
72+msgctxt "Button: Log out from the system"
73+msgid "Log Out"
74+msgstr "Eweq"
75+
76+#: qml/Components/Dialogs.qml:161 qml/Components/Dialogs.qml:194
77+#: qml/Components/Dialogs.qml:253
78+msgid "Cancel"
79+msgstr "Bayis"
80+
81+#: qml/Components/Dialogs.qml:173
82+msgctxt "Title: Reboot/Shut down dialog"
83+msgid "Shut down"
84+msgstr "Bargus"
85+
86+#: qml/Components/Dialogs.qml:174
87+msgid "Are you sure you want to shut down?"
88+msgstr "Bargussuh digga maay litoo?"
89+
90+#: qml/Components/Dialogs.qml:176
91+msgctxt "Button: Reboot the system"
92+msgid "Reboot"
93+msgstr "Wadir-ugus"
94+
95+#: qml/Components/Dialogs.qml:185
96+msgctxt "Button: Shut down the system"
97+msgid "Shut down"
98+msgstr "Bargus"
99+
100+#: qml/Components/Dialogs.qml:207
101+msgctxt "Title: Reboot dialog"
102+msgid "Reboot"
103+msgstr "Wadir-ugus"
104+
105+#: qml/Components/Dialogs.qml:208
106+msgid "Are you sure you want to reboot?"
107+msgstr "Wadir-ugussuh digga maay litoo?"
108+
109+#: qml/Components/Dialogs.qml:210
110+msgid "No"
111+msgstr "Maleey"
112+
113+#: qml/Components/Dialogs.qml:217
114+msgid "Yes"
115+msgstr "Yeey"
116+
117+#: qml/Components/Dialogs.qml:232
118+msgctxt "Title: Power off/Restart dialog"
119+msgid "Power"
120+msgstr "Cayla"
121+
122+#: qml/Components/Dialogs.qml:233
123+msgid ""
124+"Are you sure you would like\n"
125+"to power off?"
126+msgstr "Timmi haytuh digga maay litoo?"
127+
128+#: qml/Components/Dialogs.qml:235
129+msgctxt "Button: Power off the system"
130+msgid "Power off"
131+msgstr "Timmi hayis"
132+
133+#: qml/Components/Dialogs.qml:244
134+msgctxt "Button: Restart the system"
135+msgid "Restart"
136+msgstr "Wadir-qimbis"
137+
138+#: qml/Components/Lockscreen.qml:245
139+msgid "Return to Call"
140+msgstr "Seecol gacis"
141+
142+#: qml/Components/Lockscreen.qml:245
143+msgid "Emergency Call"
144+msgstr ""
145+
146+#: qml/Components/Lockscreen.qml:277
147+msgid "OK"
148+msgstr "Hayya"
149+
150+#: qml/Components/ModeSwitchWarningDialog.qml:32
151+msgid "Apps may have unsaved data:"
152+msgstr ""
153+
154+#: qml/Components/ModeSwitchWarningDialog.qml:57
155+msgid "Re-dock, save your work and close these apps to continue."
156+msgstr ""
157+
158+#: qml/Components/ModeSwitchWarningDialog.qml:63
159+msgid "Or force close now (unsaved data will be lost)."
160+msgstr ""
161+
162+#: qml/Components/ModeSwitchWarningDialog.qml:75
163+msgid "OK, I will reconnect"
164+msgstr ""
165+
166+#: qml/Components/ModeSwitchWarningDialog.qml:76
167+msgid "Reconnect now!"
168+msgstr ""
169+
170+#: qml/Components/ModeSwitchWarningDialog.qml:88
171+msgid "Close all"
172+msgstr "Inkih alif"
173+
174+#: qml/Dash/DashPageHeader.qml:266
175+msgctxt "Button: Open the Ubuntu Store"
176+msgid "Store"
177+msgstr ""
178+
179+#: qml/Dash/DashPageHeader.qml:273
180+msgctxt "Button: Start a search in the current dash scope"
181+msgid "Search"
182+msgstr "Goranto"
183+
184+#: qml/Dash/DashPageHeader.qml:283
185+msgctxt "Button: Show the current dash scope settings"
186+msgid "Settings"
187+msgstr "Massosu"
188+
189+#: qml/Dash/DashPageHeader.qml:290
190+msgid "Remove from Favorites"
191+msgstr ""
192+
193+#: qml/Dash/DashPageHeader.qml:290
194+msgid "Add to Favorites"
195+msgstr ""
196+
197+#: qml/Dash/GenericScopeView.qml:587 qml/Dash/GenericScopeView.qml:745
198+msgid "See less"
199+msgstr ""
200+
201+#: qml/Dash/GenericScopeView.qml:587
202+msgid "See all"
203+msgstr ""
204+
205+#: qml/Dash/GenericScopeView.qml:649
206+msgctxt "Label: Hint for dash search line edit"
207+msgid "Search"
208+msgstr "Goranto"
209+
210+#: qml/Dash/Previews/PreviewActionCombo.qml:35
211+msgid "More..."
212+msgstr ""
213+
214+#: qml/Dash/Previews/PreviewActionCombo.qml:35
215+msgid "Less..."
216+msgstr ""
217+
218+#: qml/Dash/Previews/PreviewCommentInput.qml:68
219+#: qml/Dash/Previews/PreviewRatingInput.qml:174
220+msgid "Send"
221+msgstr "Rub"
222+
223+#: qml/Dash/Previews/PreviewRatingInput.qml:84
224+msgid "Rate this"
225+msgstr ""
226+
227+#: qml/Dash/Previews/PreviewRatingInput.qml:129
228+msgid "Add a review"
229+msgstr ""
230+
231+#: qml/Dash/Previews/PreviewSharing.qml:50
232+msgid "Preview Share Item"
233+msgstr ""
234+
235+#: qml/Dash/PullToRefreshScopeStyle.qml:55
236+msgid "Pull to refresh…"
237+msgstr ""
238+
239+#: qml/Dash/PullToRefreshScopeStyle.qml:60
240+msgid "Release to refresh…"
241+msgstr ""
242+
243+#: qml/Dash/ScopeSettings/ScopeSettingBoolean.qml:43
244+msgid "Enable location data"
245+msgstr ""
246+
247+#: qml/Dash/ScopesList.qml:67
248+msgid "Manage"
249+msgstr ""
250+
251+#: qml/Dash/ScopesList.qml:113
252+msgid "Home"
253+msgstr "Dabqi"
254+
255+#: qml/Dash/ScopesList.qml:114
256+msgid "Also installed"
257+msgstr ""
258+
259+#: qml/DisabledScreenNotice.qml:87
260+msgid ""
261+"Your device is now connected to an external display. Use this screen as a "
262+"touch pad to interact with the mouse."
263+msgstr ""
264+
265+#: qml/Greeter/CoverPage.qml:107
266+msgid "Unlock"
267+msgstr ""
268+
269+#: qml/Greeter/LoginList.qml:236
270+msgid "Retry"
271+msgstr "Qagis"
272+
273+#: qml/Greeter/LoginList.qml:237
274+msgid "Tap to unlock"
275+msgstr ""
276+
277+#: qml/Greeter/NarrowView.qml:54 qml/Wizard/Pages/passwd-confirm.qml:53
278+msgid "Sorry, incorrect passphrase."
279+msgstr ""
280+
281+#: qml/Greeter/NarrowView.qml:55 qml/Wizard/Pages/passwd-confirm.qml:54
282+msgid "Sorry, incorrect passcode."
283+msgstr ""
284+
285+#: qml/Greeter/NarrowView.qml:56
286+msgid "This will be your last attempt."
287+msgstr ""
288+
289+#: qml/Greeter/NarrowView.qml:58
290+msgid ""
291+"If passphrase is entered incorrectly, your phone will conduct a factory "
292+"reset and all personal data will be deleted."
293+msgstr ""
294+
295+#: qml/Greeter/NarrowView.qml:59
296+msgid ""
297+"If passcode is entered incorrectly, your phone will conduct a factory reset "
298+"and all personal data will be deleted."
299+msgstr ""
300+
301+#: qml/Greeter/NarrowView.qml:116
302+#, qt-format
303+msgid "Enter %1"
304+msgstr "%1 culus"
305+
306+#: qml/Greeter/NarrowView.qml:117 qml/Wizard/Pages/passwd-set.qml:60
307+msgid "Enter passphrase"
308+msgstr "Tatur-maxco culus"
309+
310+#: qml/Greeter/NarrowView.qml:118
311+msgid "Enter passcode"
312+msgstr "Tatur-mudenta culus"
313+
314+#: qml/Greeter/NarrowView.qml:119
315+#, qt-format
316+msgid "Sorry, incorrect %1"
317+msgstr ""
318+
319+#: qml/Greeter/NarrowView.qml:120
320+msgid "Sorry, incorrect passphrase"
321+msgstr ""
322+
323+#: qml/Greeter/NarrowView.qml:121
324+msgctxt "passphrase"
325+msgid "Please re-enter"
326+msgstr ""
327+
328+#: qml/Greeter/NarrowView.qml:122
329+msgid "Sorry, incorrect passcode"
330+msgstr ""
331+
332+#: qml/Notifications/NotificationMenuItemFactory.qml:129
333+msgid "Show password"
334+msgstr "Cuumita uybulluy"
335+
336+#: qml/Panel/ActiveCallHint.qml:79
337+msgid "Tap to return to call..."
338+msgstr ""
339+
340+#: qml/Panel/ActiveCallHint.qml:92
341+msgid "Conference"
342+msgstr "Koboxu"
343+
344+#: qml/Panel/Indicators/MenuItemFactory.qml:753
345+msgid "Nothing is playing"
346+msgstr ""
347+
348+#: qml/Panel/Indicators/MenuItemFactory.qml:882
349+#, qt-format
350+msgid "%1 hour"
351+msgid_plural "%1 hours"
352+msgstr[0] "%1 saaqata"
353+msgstr[1] "%1 saaqata"
354+
355+#: qml/Panel/Indicators/MenuItemFactory.qml:886
356+#, qt-format
357+msgid "%1 minute"
358+msgid_plural "%1 minutes"
359+msgstr[0] "%1 miniti"
360+msgstr[1] "%1 miniti"
361+
362+#: qml/Panel/Indicators/MenuItemFactory.qml:891
363+#, qt-format
364+msgid "%1 second"
365+msgid_plural "%1 seconds"
366+msgstr[0] "%1 nammayye"
367+msgstr[1] "%1 nammayye"
368+
369+#: qml/Panel/Indicators/MenuItemFactory.qml:894
370+msgid "0 seconds"
371+msgstr "0 nammayye"
372+
373+#. Translators: String like "1 hour, 2 minutes, 3 seconds remaining"
374+#: qml/Panel/Indicators/MenuItemFactory.qml:896
375+#, qt-format
376+msgid "%1 remaining"
377+msgstr "%1 raaqe"
378+
379+#: qml/Panel/Indicators/MenuItemFactory.qml:902
380+msgid "In queue…"
381+msgstr ""
382+
383+#: qml/Panel/Indicators/MenuItemFactory.qml:906
384+msgid "Downloading"
385+msgstr "Qulluumah"
386+
387+#: qml/Panel/Indicators/MenuItemFactory.qml:908
388+msgid "Paused, tap to resume"
389+msgstr ""
390+
391+#: qml/Panel/Indicators/MenuItemFactory.qml:910
392+msgid "Canceled"
393+msgstr "Bayteh"
394+
395+#: qml/Panel/Indicators/MenuItemFactory.qml:912
396+msgid "Finished"
397+msgstr "Duudumteh"
398+
399+#: qml/Panel/Indicators/MenuItemFactory.qml:914
400+msgid "Failed, tap to retry"
401+msgstr ""
402+
403+#: qml/Panel/Indicators/MessageMenuItemFactory.qml:155
404+#: qml/Panel/Indicators/MessageMenuItemFactory.qml:214
405+msgctxt "Button: Send a reply message"
406+msgid "Send"
407+msgstr "Rub"
408+
409+#: qml/Panel/Indicators/MessageMenuItemFactory.qml:156
410+msgctxt "Label: Hint in message indicator line edit"
411+msgid "Reply"
412+msgstr ""
413+
414+#: qml/Panel/Indicators/MessageMenuItemFactory.qml:213
415+msgctxt "Button: Call back on phone"
416+msgid "Call back"
417+msgstr ""
418+
419+#: qml/Panel/Indicators/ModemInfoItem.qml:105
420+msgid "Unlock SIM"
421+msgstr ""
422+
423+#: qml/Panel/Indicators/RoamingIndication.qml:27
424+msgid "Roaming"
425+msgstr ""
426+
427+#: qml/Tutorial/TutorialBottom.qml:28
428+msgid "Open special menus"
429+msgstr ""
430+
431+#: qml/Tutorial/TutorialBottom.qml:29
432+msgid "Swipe up from the bottom edge."
433+msgstr ""
434+
435+#: qml/Tutorial/TutorialBottomFinish.qml:24
436+msgid "This action does different things for different apps"
437+msgstr ""
438+
439+#: qml/Tutorial/TutorialBottomFinish.qml:25
440+msgid "Tap here to finish."
441+msgstr ""
442+
443+#: qml/Tutorial/TutorialContent.qml:80 qml/Tutorial/TutorialLeftFinish.qml:25
444+#: qml/Tutorial/TutorialRight.qml:144
445+msgid "Tap here to continue."
446+msgstr ""
447+
448+#: qml/Tutorial/TutorialLeft.qml:26
449+msgid "Open the launcher"
450+msgstr ""
451+
452+#: qml/Tutorial/TutorialLeft.qml:27
453+msgid "Short swipe from the left edge."
454+msgstr ""
455+
456+#: qml/Tutorial/TutorialLeftFinish.qml:24
457+msgid "These are the shortcuts to favorite apps"
458+msgstr ""
459+
460+#: qml/Tutorial/TutorialPage.qml:178
461+msgid "You almost got it!"
462+msgstr ""
463+
464+#: qml/Tutorial/TutorialPage.qml:195
465+msgid "Try again."
466+msgstr ""
467+
468+#: qml/Tutorial/TutorialRight.qml:31
469+msgid "To view open apps"
470+msgstr ""
471+
472+#: qml/Tutorial/TutorialRight.qml:32
473+msgid "Long swipe from the right edge."
474+msgstr ""
475+
476+#: qml/Tutorial/TutorialRight.qml:122
477+msgid "View all your running tasks."
478+msgstr ""
479+
480+#: qml/Wizard/Page.qml:89
481+msgctxt "Button: Go back one page in the Wizard"
482+msgid "Back"
483+msgstr "Derre"
484+
485+#: qml/Wizard/Pages/10-welcome.qml:27
486+msgid "Hi!"
487+msgstr "Nagaale!"
488+
489+#: qml/Wizard/Pages/10-welcome.qml:44
490+msgid "Welcome to your Ubuntu phone."
491+msgstr "Ubuntu Telefoonul arcib"
492+
493+#: qml/Wizard/Pages/10-welcome.qml:52
494+msgid "Let’s get started."
495+msgstr "Hayya qimbisnay."
496+
497+#: qml/Wizard/Pages/10-welcome.qml:88 qml/Wizard/Pages/30-passwd-type.qml:133
498+#: qml/Wizard/Pages/40-wifi.qml:215 qml/Wizard/Pages/50-location.qml:131
499+#: qml/Wizard/Pages/60-reporting.qml:60 qml/Wizard/Pages/passwd-confirm.qml:82
500+#: qml/Wizard/Pages/passwd-set.qml:90
501+msgid "Continue"
502+msgstr "Tatur"
503+
504+#: qml/Wizard/Pages/20-sim.qml:25
505+msgid "Add a SIM card and restart your device"
506+msgstr ""
507+
508+#: qml/Wizard/Pages/20-sim.qml:59
509+msgid "Without it, you won’t be able to make calls or use text messaging."
510+msgstr ""
511+
512+#: qml/Wizard/Pages/20-sim.qml:73 qml/Wizard/Pages/40-wifi.qml:215
513+msgid "Skip"
514+msgstr "Kaqit"
515+
516+#: qml/Wizard/Pages/30-passwd-type.qml:39
517+msgid "Lock security"
518+msgstr ""
519+
520+#: qml/Wizard/Pages/30-passwd-type.qml:79
521+msgid "Please select how you’d like to unlock your phone."
522+msgstr ""
523+
524+#: qml/Wizard/Pages/30-passwd-type.qml:102
525+msgctxt "Label: Type of security method"
526+msgid "Swipe"
527+msgstr "Uysuttuc"
528+
529+#: qml/Wizard/Pages/30-passwd-type.qml:103
530+msgctxt "Label: Description of security method"
531+msgid "No security"
532+msgstr ""
533+
534+#: qml/Wizard/Pages/30-passwd-type.qml:105
535+msgctxt "Label: Type of security method"
536+msgid "Passcode"
537+msgstr ""
538+
539+#: qml/Wizard/Pages/30-passwd-type.qml:106
540+msgctxt "Label: Description of security method"
541+msgid "4 digits only"
542+msgstr ""
543+
544+#: qml/Wizard/Pages/30-passwd-type.qml:108
545+msgctxt "Label: Type of security method"
546+msgid "Passphrase"
547+msgstr ""
548+
549+#: qml/Wizard/Pages/30-passwd-type.qml:109
550+msgctxt "Label: Description of security method"
551+msgid "Numbers and letters"
552+msgstr ""
553+
554+#: qml/Wizard/Pages/40-wifi.qml:29
555+msgid "Connect to Wi‑Fi"
556+msgstr ""
557+
558+#: qml/Wizard/Pages/40-wifi.qml:168
559+msgid "Available networks…"
560+msgstr ""
561+
562+#: qml/Wizard/Pages/40-wifi.qml:169
563+msgid "No available networks."
564+msgstr ""
565+
566+#: qml/Wizard/Pages/50-location.qml:27
567+msgid "Location"
568+msgstr ""
569+
570+#: qml/Wizard/Pages/50-location.qml:62
571+msgid "Let the phone detect your location:"
572+msgstr ""
573+
574+#: qml/Wizard/Pages/50-location.qml:69
575+msgid "Using GPS only (less accurate)"
576+msgstr ""
577+
578+#: qml/Wizard/Pages/50-location.qml:86
579+msgid "Using GPS, anonymized Wi-Fi and cellular network info (recommended)"
580+msgstr ""
581+
582+#. Translators: HERE is a trademark for Nokia's location service, you probably shouldn't translate it
583+#: qml/Wizard/Pages/50-location.qml:103
584+msgid ""
585+"By selecting this option you agree to the Nokia HERE <a href='#'>terms and "
586+"conditions</a>."
587+msgstr ""
588+
589+#: qml/Wizard/Pages/50-location.qml:112
590+msgid "Not at all"
591+msgstr ""
592+
593+#: qml/Wizard/Pages/50-location.qml:124
594+msgid "You can change your mind later in <b>System Settings</b>."
595+msgstr ""
596+
597+#: qml/Wizard/Pages/60-reporting.qml:26
598+msgid "Improving your experience"
599+msgstr ""
600+
601+#: qml/Wizard/Pages/60-reporting.qml:46
602+msgid ""
603+"Your phone is set up to automatically report errors to Canonical and its "
604+"partners, the makers of the operating system."
605+msgstr ""
606+
607+#: qml/Wizard/Pages/60-reporting.qml:53
608+msgid ""
609+"This can be disabled in <b>System Settings</b> under <b>Security &amp; "
610+"Privacy</b>"
611+msgstr ""
612+
613+#: qml/Wizard/Pages/80-finished.qml:24
614+msgid "All done"
615+msgstr ""
616+
617+#: qml/Wizard/Pages/80-finished.qml:39
618+msgid "Nice work!"
619+msgstr ""
620+
621+#: qml/Wizard/Pages/80-finished.qml:46
622+msgid "Your phone is now ready to use."
623+msgstr ""
624+
625+#: qml/Wizard/Pages/80-finished.qml:53
626+msgid "Finish"
627+msgstr ""
628+
629+#: qml/Wizard/Pages/here-terms.qml:27
630+msgid "Terms & Conditions"
631+msgstr ""
632+
633+#: qml/Wizard/Pages/passwd-confirm.qml:49
634+msgid "Confirm passphrase"
635+msgstr ""
636+
637+#: qml/Wizard/Pages/passwd-confirm.qml:50
638+msgid "Confirm passcode"
639+msgstr ""
640+
641+#: qml/Wizard/Pages/passwd-confirm.qml:53
642+#: qml/Wizard/Pages/passwd-confirm.qml:54
643+msgid "Please try again."
644+msgstr ""
645+
646+#: qml/Wizard/Pages/passwd-set.qml:61
647+msgid "Choose your passcode"
648+msgstr ""
649+
650+#: qml/Wizard/Pages/passwd-set.qml:68
651+msgid "Passphrase must be 4 characters long"
652+msgstr ""
653+
654+#. Translators: This is the arrow for "Back" buttons
655+#: qml/Wizard/StackButton.qml:39
656+#, qt-format
657+msgid "〈 %1"
658+msgstr ""
659+
660+#. Translators: This is the arrow for "Forward" buttons
661+#: qml/Wizard/StackButton.qml:42
662+#, qt-format
663+msgid "%1 〉"
664+msgstr ""
po/en_AU.po+16−14
@@ -8,15 +8,15 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2016-02-08 09:50+0000\n"
10"POT-Creation-Date: 2016-02-08 09:50+0000\n"
11−"PO-Revision-Date: 2015-07-12 07:17+0000\n"
11+"PO-Revision-Date: 2016-02-12 23:22+0000\n"
12"Last-Translator: Jared Norris <jarednorris@ubuntu.com>\n"
12"Last-Translator: Jared Norris <jarednorris@ubuntu.com>\n"
13"Language-Team: English (Australia) <en_AU@li.org>\n"
13"Language-Team: English (Australia) <en_AU@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
17"Plural-Forms: nplurals=2; plural=n != 1;\n"
18−"X-Launchpad-Export-Date: 2016-02-11 06:15+0000\n"
18+"X-Launchpad-Export-Date: 2016-02-13 05:37+0000\n"
19−"X-Generator: Launchpad (build 17923)\n"
19+"X-Generator: Launchpad (build 17925)\n"
20
20
21#: plugins/IntegratedLightDM/Greeter.cpp:112
21#: plugins/IntegratedLightDM/Greeter.cpp:112
22msgid "Password: "
22msgid "Password: "
@@ -29,7 +29,7 @@ msgstr "Pin shortcut"
29
29
30#: plugins/Unity/Launcher/launcheritem.cpp:52
30#: plugins/Unity/Launcher/launcheritem.cpp:52
31msgid "Quit"
31msgid "Quit"
32−msgstr ""
32+msgstr "Quit"
33
33
34#: plugins/Unity/Launcher/launcheritem.cpp:106
34#: plugins/Unity/Launcher/launcheritem.cpp:106
35msgid "Unpin shortcut"
35msgid "Unpin shortcut"
@@ -151,27 +151,27 @@ msgstr "OK"
151
151
152#: qml/Components/ModeSwitchWarningDialog.qml:32
152#: qml/Components/ModeSwitchWarningDialog.qml:32
153msgid "Apps may have unsaved data:"
153msgid "Apps may have unsaved data:"
154−msgstr ""
154+msgstr "Apps may have unsaved data:"
155
155
156#: qml/Components/ModeSwitchWarningDialog.qml:57
156#: qml/Components/ModeSwitchWarningDialog.qml:57
157msgid "Re-dock, save your work and close these apps to continue."
157msgid "Re-dock, save your work and close these apps to continue."
158−msgstr ""
158+msgstr "Re-dock, save your work and close these apps to continue."
159
159
160#: qml/Components/ModeSwitchWarningDialog.qml:63
160#: qml/Components/ModeSwitchWarningDialog.qml:63
161msgid "Or force close now (unsaved data will be lost)."
161msgid "Or force close now (unsaved data will be lost)."
162−msgstr ""
162+msgstr "Or force close now (unsaved data will be lost)."
163
163
164#: qml/Components/ModeSwitchWarningDialog.qml:75
164#: qml/Components/ModeSwitchWarningDialog.qml:75
165msgid "OK, I will reconnect"
165msgid "OK, I will reconnect"
166−msgstr ""
166+msgstr "OK, I will reconnect"
167
167
168#: qml/Components/ModeSwitchWarningDialog.qml:76
168#: qml/Components/ModeSwitchWarningDialog.qml:76
169msgid "Reconnect now!"
169msgid "Reconnect now!"
170−msgstr ""
170+msgstr "Reconnect now!"
171
171
172#: qml/Components/ModeSwitchWarningDialog.qml:88
172#: qml/Components/ModeSwitchWarningDialog.qml:88
173msgid "Close all"
173msgid "Close all"
174−msgstr ""
174+msgstr "Close all"
175
175
176#: qml/Dash/DashPageHeader.qml:266
176#: qml/Dash/DashPageHeader.qml:266
177msgctxt "Button: Open the Ubuntu Store"
177msgctxt "Button: Open the Ubuntu Store"
@@ -232,7 +232,7 @@ msgstr "Add a review"
232
232
233#: qml/Dash/Previews/PreviewSharing.qml:50
233#: qml/Dash/Previews/PreviewSharing.qml:50
234msgid "Preview Share Item"
234msgid "Preview Share Item"
235−msgstr ""
235+msgstr "Preview Share Item"
236
236
237#: qml/Dash/PullToRefreshScopeStyle.qml:55
237#: qml/Dash/PullToRefreshScopeStyle.qml:55
238msgid "Pull to refresh…"
238msgid "Pull to refresh…"
@@ -263,6 +263,8 @@ msgid ""
263"Your device is now connected to an external display. Use this screen as a "
263"Your device is now connected to an external display. Use this screen as a "
264"touch pad to interact with the mouse."
264"touch pad to interact with the mouse."
265msgstr ""
265msgstr ""
266+"Your device is now connected to an external display. Use this screen as a "
267+"touch pad to interact with the mouse."
266
268
267#: qml/Greeter/CoverPage.qml:107
269#: qml/Greeter/CoverPage.qml:107
268msgid "Unlock"
270msgid "Unlock"
@@ -329,7 +331,7 @@ msgstr "Sorry, incorrect passphrase"
329#: qml/Greeter/NarrowView.qml:121
331#: qml/Greeter/NarrowView.qml:121
330msgctxt "passphrase"
332msgctxt "passphrase"
331msgid "Please re-enter"
333msgid "Please re-enter"
332−msgstr ""
334+msgstr "Please re-enter"
333
335
334#: qml/Greeter/NarrowView.qml:122
336#: qml/Greeter/NarrowView.qml:122
335msgid "Sorry, incorrect passcode"
337msgid "Sorry, incorrect passcode"
@@ -410,7 +412,7 @@ msgstr "Failed, tap to retry"
410#: qml/Panel/Indicators/MessageMenuItemFactory.qml:214
412#: qml/Panel/Indicators/MessageMenuItemFactory.qml:214
411msgctxt "Button: Send a reply message"
413msgctxt "Button: Send a reply message"
412msgid "Send"
414msgid "Send"
413−msgstr ""
415+msgstr "Send"
414
416
415#: qml/Panel/Indicators/MessageMenuItemFactory.qml:156
417#: qml/Panel/Indicators/MessageMenuItemFactory.qml:156
416msgctxt "Label: Hint in message indicator line edit"
418msgctxt "Label: Hint in message indicator line edit"
@@ -420,7 +422,7 @@ msgstr "Reply"
420#: qml/Panel/Indicators/MessageMenuItemFactory.qml:213
422#: qml/Panel/Indicators/MessageMenuItemFactory.qml:213
421msgctxt "Button: Call back on phone"
423msgctxt "Button: Call back on phone"
422msgid "Call back"
424msgid "Call back"
423−msgstr ""
425+msgstr "Call back"
424
426
425#: qml/Panel/Indicators/ModemInfoItem.qml:105
427#: qml/Panel/Indicators/ModemInfoItem.qml:105
426msgid "Unlock SIM"
428msgid "Unlock SIM"
po/fr.po+6−4
@@ -8,15 +8,15 @@ msgstr ""
8"Project-Id-Version: unity\n"
8"Project-Id-Version: unity\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
9"Report-Msgid-Bugs-To: FULL NAME <EMAIL@ADDRESS>\n"
10"POT-Creation-Date: 2016-02-08 09:50+0000\n"
10"POT-Creation-Date: 2016-02-08 09:50+0000\n"
11−"PO-Revision-Date: 2015-11-07 19:43+0000\n"
11+"PO-Revision-Date: 2016-02-13 09:30+0000\n"
12−"Last-Translator: Jean-Marc <Unknown>\n"
12+"Last-Translator: Anne <anneonyme017@gmail.com>\n"
13"Language-Team: French <fr@li.org>\n"
13"Language-Team: French <fr@li.org>\n"
14"MIME-Version: 1.0\n"
14"MIME-Version: 1.0\n"
15"Content-Type: text/plain; charset=UTF-8\n"
15"Content-Type: text/plain; charset=UTF-8\n"
16"Content-Transfer-Encoding: 8bit\n"
16"Content-Transfer-Encoding: 8bit\n"
17"Plural-Forms: nplurals=2; plural=n > 1;\n"
17"Plural-Forms: nplurals=2; plural=n > 1;\n"
18−"X-Launchpad-Export-Date: 2016-02-11 06:14+0000\n"
18+"X-Launchpad-Export-Date: 2016-02-14 06:10+0000\n"
19−"X-Generator: Launchpad (build 17923)\n"
19+"X-Generator: Launchpad (build 17925)\n"
20
20
21#: plugins/IntegratedLightDM/Greeter.cpp:112
21#: plugins/IntegratedLightDM/Greeter.cpp:112
22msgid "Password: "
22msgid "Password: "
@@ -271,6 +271,8 @@ msgid ""
271"Your device is now connected to an external display. Use this screen as a "
271"Your device is now connected to an external display. Use this screen as a "
272"touch pad to interact with the mouse."
272"touch pad to interact with the mouse."
273msgstr ""
273msgstr ""
274+"Votre appareil est maintenant connecté à un affichage externe. Utilisez cet "
275+"écran comme un pavé tactile pour interagir avec la souris."
274
276
275#: qml/Greeter/CoverPage.qml:107
277#: qml/Greeter/CoverPage.qml:107
276msgid "Unlock"
278msgid "Unlock"
po/unity8.pot+6−6
@@ -8,7 +8,7 @@ msgid ""
8msgstr ""
8msgstr ""
9"Project-Id-Version: unity8\n"
9"Project-Id-Version: unity8\n"
10"Report-Msgid-Bugs-To: \n"
10"Report-Msgid-Bugs-To: \n"
11−"POT-Creation-Date: 2016-02-08 09:50+0000\n"
11+"POT-Creation-Date: 2016-02-12 00:28+0000\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
12"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
13"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
14"Language-Team: LANGUAGE <LL@li.org>\n"
@@ -266,11 +266,11 @@ msgstr ""
266msgid "Unlock"
266msgid "Unlock"
267msgstr ""
267msgstr ""
268
268
269−#: qml/Greeter/LoginList.qml:236
269+#: qml/Greeter/LoginList.qml:239
270msgid "Retry"
270msgid "Retry"
271msgstr ""
271msgstr ""
272
272
273−#: qml/Greeter/LoginList.qml:237
273+#: qml/Greeter/LoginList.qml:240
274msgid "Tap to unlock"
274msgid "Tap to unlock"
275msgstr ""
275msgstr ""
276
276
@@ -487,7 +487,7 @@ msgid "Hi!"
487msgstr ""
487msgstr ""
488
488
489#: qml/Wizard/Pages/10-welcome.qml:44
489#: qml/Wizard/Pages/10-welcome.qml:44
490−msgid "Welcome to your Ubuntu phone."
490+msgid "Welcome to your Ubuntu device."
491msgstr ""
491msgstr ""
492
492
493#: qml/Wizard/Pages/10-welcome.qml:52
493#: qml/Wizard/Pages/10-welcome.qml:52
@@ -518,7 +518,7 @@ msgid "Lock security"
518msgstr ""
518msgstr ""
519
519
520#: qml/Wizard/Pages/30-passwd-type.qml:79
520#: qml/Wizard/Pages/30-passwd-type.qml:79
521−msgid "Please select how you’d like to unlock your phone."
521+msgid "Please select how you’d like to unlock your device."
522msgstr ""
522msgstr ""
523
523
524#: qml/Wizard/Pages/30-passwd-type.qml:102
524#: qml/Wizard/Pages/30-passwd-type.qml:102
@@ -619,7 +619,7 @@ msgid "Nice work!"
619msgstr ""
619msgstr ""
620
620
621#: qml/Wizard/Pages/80-finished.qml:46
621#: qml/Wizard/Pages/80-finished.qml:46
622−msgid "Your phone is now ready to use."
622+msgid "Your device is now ready to use."
623msgstr ""
623msgstr ""
624
624
625#: qml/Wizard/Pages/80-finished.qml:53
625#: qml/Wizard/Pages/80-finished.qml:53
qml/Components/EdgeBarrierController.qml+2
@@ -30,6 +30,8 @@ MouseArea {
30 // Should trigger the action associated with this edge
30 // Should trigger the action associated with this edge
31 signal passed()
31 signal passed()
32
32
33+ onPressed: mouse.accepted = false;
34+
33 function push(amount) {
35 function push(amount) {
34 if (!root._containsMouse) {
36 if (!root._containsMouse) {
35 return;
37 return;
qml/Components/VolumeControl.qml+1−6
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013-2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -28,10 +28,6 @@ Item {
28 readonly property int stepDown: -1
28 readonly property int stepDown: -1
29
29
30 property var indicators // passed from Shell.qml
30 property var indicators // passed from Shell.qml
31− readonly property bool showNotification: indicators && indicators.fullyOpened && indicators.currentIndicator === "indicator-sound"
32− onShowNotificationChanged: { // disallow the volume notification when using the slider, lpbug#1484126
33− actionGroup.indicatorsAction.updateState(root.showNotification);
34− }
35
31
36 GlobalShortcut {
32 GlobalShortcut {
37 id: muteShortcut
33 id: muteShortcut
@@ -47,7 +43,6 @@ Item {
47
43
48 property variant actionObject: action("volume")
44 property variant actionObject: action("volume")
49 property variant muteActionObject: indicators.indicatorsModel.profile === "desktop" ? action("mute") : action("silent-mode")
45 property variant muteActionObject: indicators.indicatorsModel.profile === "desktop" ? action("mute") : action("silent-mode")
50− property variant indicatorsAction: action("indicator-shown")
51 }
46 }
52
47
53 function volumeUp() {
48 function volumeUp() {
qml/Components/ZoomableImage.qml+1−1
@@ -65,7 +65,7 @@ Item {
65 anchors.fill: parent
65 anchors.fill: parent
66 fillMode: Image.PreserveAspectFit
66 fillMode: Image.PreserveAspectFit
67
67
68− readonly property int sourceSizeMultiplier: 3
68+ readonly property int sourceSizeMultiplier: root.zoomable ? 3 : 1
69
69
70 sourceSize.width: root.width * sourceSizeMultiplier <= root.height * sourceSizeMultiplier ? root.width * sourceSizeMultiplier : 0
70 sourceSize.width: root.width * sourceSizeMultiplier <= root.height * sourceSizeMultiplier ? root.width * sourceSizeMultiplier : 0
71 sourceSize.height: root.height * sourceSizeMultiplier <= root.width * sourceSizeMultiplier ? root.height * sourceSizeMultiplier : 0
71 sourceSize.height: root.height * sourceSizeMultiplier <= root.width * sourceSizeMultiplier ? root.height * sourceSizeMultiplier : 0
qml/Dash/CardCarousel.qml−1
@@ -64,7 +64,6 @@ DashRenderer {
64 item.fixedHeaderHeight = Qt.binding(function() { return carousel.headerHeight; });
64 item.fixedHeaderHeight = Qt.binding(function() { return carousel.headerHeight; });
65 item.height = Qt.binding(function() { return cardTool.cardHeight; });
65 item.height = Qt.binding(function() { return cardTool.cardHeight; });
66 item.cardData = Qt.binding(function() { return model; });
66 item.cardData = Qt.binding(function() { return model; });
67− item.components = Qt.binding(function() { return cardTool.components; });
68 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
67 item.fontScale = Qt.binding(function() { return carousel.fontScale; });
69 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
68 item.showHeader = Qt.binding(function() { return loader.explicitlyScaled; });
70 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
69 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
qml/Dash/CardGrid.qml−1
@@ -70,7 +70,6 @@ DashRenderer {
70 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
70 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
71 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
71 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
72 item.cardData = Qt.binding(function() { return model; });
72 item.cardData = Qt.binding(function() { return model; });
73− item.components = Qt.binding(function() { return cardTool.components; });
74 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
73 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
75 item.scopeStyle = root.scopeStyle;
74 item.scopeStyle = root.scopeStyle;
76 item.artShapeStyle = root.artShapeStyle;
75 item.artShapeStyle = root.artShapeStyle;
qml/Dash/CardHorizontalList.qml−1
@@ -53,7 +53,6 @@ DashRenderer {
53 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
53 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
54 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
54 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
55 item.cardData = Qt.binding(function() { return model; });
55 item.cardData = Qt.binding(function() { return model; });
56− item.components = Qt.binding(function() { return cardTool.components; });
57 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
56 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
58 item.scopeStyle = root.scopeStyle;
57 item.scopeStyle = root.scopeStyle;
59 }
58 }
qml/Dash/CardTool.qml−1
@@ -220,7 +220,6 @@ Item {
220 onLoaded: {
220 onLoaded: {
221 item.objectName = "cardToolCard";
221 item.objectName = "cardToolCard";
222 item.asynchronous = false;
222 item.asynchronous = false;
223− item.components = Qt.binding(function() { return cardTool.components; });
224 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
223 item.width = Qt.binding(function() { return cardTool.cardWidth !== -1 ? cardTool.cardWidth : item.implicitWidth; });
225 item.height = Qt.binding(function() { return cardTool.cardHeight !== -1 ? cardTool.cardHeight : item.implicitHeight; });
224 item.height = Qt.binding(function() { return cardTool.cardHeight !== -1 ? cardTool.cardHeight : item.implicitHeight; });
226 }
225 }
qml/Dash/CardVerticalJournal.qml−1
@@ -72,7 +72,6 @@ DashRenderer {
72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
72 item.fixedArtShapeSize = Qt.binding(function() { return cardTool.artShapeSize; });
73 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
73 item.fixedHeaderHeight = Qt.binding(function() { return cardTool.headerHeight; });
74 item.cardData = Qt.binding(function() { return model; });
74 item.cardData = Qt.binding(function() { return model; });
75− item.components = Qt.binding(function() { return cardTool.components; });
76 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
75 item.titleAlignment = Qt.binding(function() { return cardTool.titleAlignment; });
77 item.scopeStyle = root.scopeStyle;
76 item.scopeStyle = root.scopeStyle;
78 }
77 }
qml/Dash/GenericScopeView.qml+1−1
@@ -363,7 +363,7 @@ FocusScope {
363 clickScopeSizingHacks();
363 clickScopeSizingHacks();
364 if (scope && scope.id === "clickscope") {
364 if (scope && scope.id === "clickscope") {
365 if (categoryId === "predefined" || categoryId === "local") {
365 if (categoryId === "predefined" || categoryId === "local") {
366− cardTool.artShapeSize = Qt.size(units.gu(8), units.gu(7.5));
366+ cardTool.artShapeSize = Qt.binding(function() { return Qt.size(units.gu(8), units.gu(7.5)) });
367 item.artShapeStyle = "icon";
367 item.artShapeStyle = "icon";
368 } else {
368 } else {
369 // Should be ubuntu store icon
369 // Should be ubuntu store icon
qml/Dash/Previews/PreviewHeader.qml+1−1
@@ -35,7 +35,7 @@ PreviewWidget {
35 Item {
35 Item {
36 id: headerRoot
36 id: headerRoot
37 objectName: "innerPreviewHeader"
37 objectName: "innerPreviewHeader"
38− readonly property url mascot: root.widgetData["mascot"] || ""
38+ readonly property url mascot: root.widgetData["mascot"] || fallback
39 readonly property url fallback: root.widgetData["fallback"] || ""
39 readonly property url fallback: root.widgetData["fallback"] || ""
40 readonly property string title: root.widgetData["title"] || ""
40 readonly property string title: root.widgetData["title"] || ""
41 readonly property string subtitle: root.widgetData["subtitle"] || ""
41 readonly property string subtitle: root.widgetData["subtitle"] || ""
qml/Dash/Previews/PreviewImageGallery.qml+2−2
@@ -59,7 +59,7 @@ PreviewWidget {
59 top: parent.top
59 top: parent.top
60 bottom: parent.bottom
60 bottom: parent.bottom
61 }
61 }
62− source: modelData ? modelData : ""
62+ source: modelData || root.widgetData["fallback"] || ""
63 scaleTo: "height"
63 scaleTo: "height"
64 initialWidth: units.gu(13)
64 initialWidth: units.gu(13)
65 pressed: mouseArea.pressed
65 pressed: mouseArea.pressed
@@ -128,7 +128,7 @@ PreviewWidget {
128 bottom: parent.bottom
128 bottom: parent.bottom
129 }
129 }
130 width: overlay.width
130 width: overlay.width
131− source: modelData ? modelData : ""
131+ source: modelData || root.widgetData["fallback"] || ""
132 fillMode: Image.PreserveAspectFit
132 fillMode: Image.PreserveAspectFit
133 sourceSize { width: screenshot.width; height: screenshot.height }
133 sourceSize { width: screenshot.width; height: screenshot.height }
134
134
qml/Dash/Previews/PreviewRatingEdit.qml+1
@@ -75,6 +75,7 @@ PreviewWidget {
75 reviewText: widgetData["review"]
75 reviewText: widgetData["review"]
76
76
77 onTriggered: root.triggered(widgetId, actionId, data);
77 onTriggered: root.triggered(widgetId, actionId, data);
78+ onMakeSureVisible: root.makeSureVisible(item);
78 }
79 }
79
80
80}
81}
qml/Dash/Previews/PreviewZoomableImage.qml+2−2
@@ -42,7 +42,7 @@ PreviewWidget {
42 right: parent.right
42 right: parent.right
43 }
43 }
44 scaleTo: "width"
44 scaleTo: "width"
45− source: widgetData["source"]
45+ source: widgetData["source"] || widgetData["fallback"] || ""
46 asynchronous: true
46 asynchronous: true
47 useUbuntuShape: false
47 useUbuntuShape: false
48 pressed: mouseArea.pressed
48 pressed: mouseArea.pressed
@@ -86,7 +86,7 @@ PreviewWidget {
86
86
87 delegate: ZoomableImage {
87 delegate: ZoomableImage {
88 anchors.fill: parent
88 anchors.fill: parent
89− source: widgetData["source"]
89+ source: widgetData["source"] || widgetData["fallback"] || ""
90 zoomable: widgetData["zoomable"] ? widgetData["zoomable"] : false
90 zoomable: widgetData["zoomable"] ? widgetData["zoomable"] : false
91 // If modelData would change after failing to load it would not be
91 // If modelData would change after failing to load it would not be
92 // reloaded since the source binding is destroyed by the source = fallback
92 // reloaded since the source binding is destroyed by the source = fallback
qml/Greeter/LoginList.qml+3
@@ -22,6 +22,7 @@ Item {
22 id: root
22 id: root
23
23
24 property alias model: userList.model
24 property alias model: userList.model
25+ property bool alphanumeric: true
25 property int currentIndex
26 property int currentIndex
26 property bool locked
27 property bool locked
27
28
@@ -231,6 +232,8 @@ Item {
231 width: parent.width - anchors.margins * 2
232 width: parent.width - anchors.margins * 2
232 opacity: userList.movingInternally ? 0 : 1
233 opacity: userList.movingInternally ? 0 : 1
233
234
235+ inputMethodHints: root.alphanumeric ? Qt.ImhNone : Qt.ImhDigitsOnly
236+
234 property string promptText
237 property string promptText
235 placeholderText: root.wasPrompted ? promptText
238 placeholderText: root.wasPrompted ? promptText
236 : (root.locked ? i18n.tr("Retry")
239 : (root.locked ? i18n.tr("Retry")
qml/Greeter/WideView.qml+1−1
@@ -27,7 +27,7 @@ FocusScope {
27 property alias backgroundTopMargin: coverPage.backgroundTopMargin
27 property alias backgroundTopMargin: coverPage.backgroundTopMargin
28 property alias background: coverPage.background
28 property alias background: coverPage.background
29 property bool locked
29 property bool locked
30− property bool alphanumeric // unused
30+ property alias alphanumeric: loginList.alphanumeric
31 property alias userModel: loginList.model
31 property alias userModel: loginList.model
32 property alias infographicModel: coverPage.infographicModel
32 property alias infographicModel: coverPage.infographicModel
33 readonly property bool fullyShown: coverPage.showProgress === 1
33 readonly property bool fullyShown: coverPage.showProgress === 1
qml/Panel/IndicatorItem.qml+57−7
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2013-2014 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -17,6 +17,7 @@
17import QtQuick 2.4
17import QtQuick 2.4
18import Ubuntu.Components 1.3
18import Ubuntu.Components 1.3
19import Ubuntu.Settings.Components 0.1
19import Ubuntu.Settings.Components 0.1
20+import QMenuModel 0.1
20import "Indicators"
21import "Indicators"
21
22
22IndicatorDelegate {
23IndicatorDelegate {
@@ -36,13 +37,24 @@ IndicatorDelegate {
36 return "#ffffff";
37 return "#ffffff";
37 }
38 }
38
39
39− signal clicked()
40−
41 implicitWidth: mainItems.width
40 implicitWidth: mainItems.width
42
41
43 MouseArea {
42 MouseArea {
43+ readonly property int stepUp: 1
44+ readonly property int stepDown: -1
45+
44 anchors.fill: parent
46 anchors.fill: parent
47+ acceptedButtons: Qt.MiddleButton
45− onClicked: parent.clicked()
48+ onClicked: {
49+ if ((!expanded || selected) && secondaryAction.valid) {
50+ secondaryAction.activate();
51+ }
52+ }
53+ onWheel: {
54+ if ((!expanded || selected) && scrollAction.valid) {
55+ scrollAction.activate(wheel.angleDelta.y > 0 ? stepUp : stepDown);
56+ }
57+ }
46 }
58 }
47
59
48 Item {
60 Item {
@@ -152,9 +164,6 @@ IndicatorDelegate {
152 }
164 }
153
165
154 StateGroup {
166 StateGroup {
155− id: d
156− property bool useFallbackIcon: false
157−
158 states: [
167 states: [
159 State {
168 State {
160 name: "minimised"
169 name: "minimised"
@@ -251,4 +260,45 @@ IndicatorDelegate {
251 rightLabel = rootActionState.rightLabel ? rootActionState.rightLabel : "";
260 rightLabel = rootActionState.rightLabel ? rootActionState.rightLabel : "";
252 icons = rootActionState.icons;
261 icons = rootActionState.icons;
253 }
262 }
263+
264+ QtObject {
265+ id: d
266+
267+ property bool useFallbackIcon: false
268+ property var shouldIndicatorBeShown: undefined
269+
270+ onShouldIndicatorBeShownChanged: {
271+ if (shouldIndicatorBeShown !== undefined) {
272+ submenuAction.changeState(shouldIndicatorBeShown);
273+ }
274+ }
275+ }
276+
277+ UnityMenuAction {
278+ id: secondaryAction
279+ model: menuModel
280+ index: 0
281+ name: rootActionState.secondaryAction
282+ }
283+
284+ UnityMenuAction {
285+ id: scrollAction
286+ model: menuModel
287+ index: 0
288+ name: rootActionState.scrollAction
289+ }
290+
291+ UnityMenuAction {
292+ id: submenuAction
293+ model: menuModel
294+ index: 0
295+ name: rootActionState.submenuAction
296+ }
297+
298+ Binding {
299+ target: d
300+ property: "shouldIndicatorBeShown"
301+ when: submenuAction.valid
302+ value: root.selected && root.expanded
303+ }
254}
304}
qml/Panel/graphics/Battery@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/Bluetooth@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/Clock@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/Location@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/Messages@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/Network@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/Sound@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/Sync@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/System@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/Time@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/VerticalDivider@18.pngdeleted

Binary file not shown.

qml/Panel/graphics/handle@12.pngdeleted

Binary file not shown.

qml/Panel/graphics/handle@12.scideleted−5
@@ -1,5 +0,0 @@
1−border.left: 0
2−border.top: 1
3−border.bottom: 0
4−border.right: 0
5−source: handle@12.png
qml/Panel/graphics/search@12.pngdeleted

Binary file not shown.

qml/Panel/graphics/time_and_date@18.pngdeleted

Binary file not shown.

qml/Stages/ApplicationWindow.qml+14−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2014-2015 Canonical Ltd.
2+ * Copyright 2014-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -37,6 +37,13 @@ FocusScope {
37 property int requestedWidth: -1
37 property int requestedWidth: -1
38 property int requestedHeight: -1
38 property int requestedHeight: -1
39
39
40+ readonly property int minimumWidth: sessionContainer.surface ? sessionContainer.surface.minimumWidth : 0
41+ readonly property int minimumHeight: sessionContainer.surface ? sessionContainer.surface.minimumHeight : 0
42+ readonly property int maximumWidth: sessionContainer.surface ? sessionContainer.surface.maximumWidth : 0
43+ readonly property int maximumHeight: sessionContainer.surface ? sessionContainer.surface.maximumHeight : 0
44+ readonly property int widthIncrement: sessionContainer.surface ? sessionContainer.surface.widthIncrement : 0
45+ readonly property int heightIncrement: sessionContainer.surface ? sessionContainer.surface.heightIncrement : 0
46+
40 QtObject {
47 QtObject {
41 id: d
48 id: d
42
49
@@ -82,6 +89,12 @@ FocusScope {
82 property bool surfaceOldEnoughToBeResized: false
89 property bool surfaceOldEnoughToBeResized: false
83 }
90 }
84
91
92+ Binding {
93+ target: root.application
94+ property: "initialSurfaceSize"
95+ value: Qt.size(root.requestedWidth, root.requestedHeight)
96+ }
97+
85 Timer {
98 Timer {
86 id: surfaceInitTimer
99 id: surfaceInitTimer
87 interval: 100
100 interval: 100
qml/Stages/DecoratedWindow.qml+7
@@ -39,6 +39,13 @@ FocusScope {
39 property alias requestedWidth: applicationWindow.requestedWidth
39 property alias requestedWidth: applicationWindow.requestedWidth
40 property real requestedHeight
40 property real requestedHeight
41
41
42+ property alias minimumWidth: applicationWindow.minimumWidth
43+ readonly property int minimumHeight: (root.decorationShown ? decoration.height : 0) + applicationWindow.minimumHeight
44+ property alias maximumWidth: applicationWindow.maximumWidth
45+ readonly property int maximumHeight: (root.decorationShown ? decoration.height : 0) + applicationWindow.maximumHeight
46+ property alias widthIncrement: applicationWindow.widthIncrement
47+ property alias heightIncrement: applicationWindow.heightIncrement
48+
42 signal close()
49 signal close()
43 signal maximize()
50 signal maximize()
44 signal minimize()
51 signal minimize()
qml/Stages/DesktopStage.qml+6
@@ -256,6 +256,12 @@ AbstractStage {
256 height: decoratedWindow.height
256 height: decoratedWindow.height
257 property alias requestedWidth: decoratedWindow.requestedWidth
257 property alias requestedWidth: decoratedWindow.requestedWidth
258 property alias requestedHeight: decoratedWindow.requestedHeight
258 property alias requestedHeight: decoratedWindow.requestedHeight
259+ property alias minimumWidth: decoratedWindow.minimumWidth
260+ property alias minimumHeight: decoratedWindow.minimumHeight
261+ property alias maximumWidth: decoratedWindow.maximumWidth
262+ property alias maximumHeight: decoratedWindow.maximumHeight
263+ property alias widthIncrement: decoratedWindow.widthIncrement
264+ property alias heightIncrement: decoratedWindow.heightIncrement
259
265
260 QtObject {
266 QtObject {
261 id: appDelegatePrivate
267 id: appDelegatePrivate
qml/Stages/SessionContainer.qml+2
@@ -152,6 +152,8 @@ FocusScope {
152 popped.completed.connect(function() { root.session.release(); } );
152 popped.completed.connect(function() { root.session.release(); } );
153 popped.end();
153 popped.end();
154 d.animations = tmp;
154 d.animations = tmp;
155+ } else {
156+ root.session.release();
155 }
157 }
156 }
158 }
157
159
qml/Stages/Splash.qml+7−2
@@ -138,15 +138,20 @@ Item {
138 visible: d.showIcon
138 visible: d.showIcon
139 }
139 }
140
140
141+ Timer {
142+ interval: 2000
143+ onTriggered: spinner.running = true
144+ running: true
145+ }
146+
141 ActivityIndicator {
147 ActivityIndicator {
148+ id: spinner
142 anchors.centerIn: header.visible ? parent : undefined
149 anchors.centerIn: header.visible ? parent : undefined
143 anchors.verticalCenterOffset: header.visible ? header.height / 2 : 0
150 anchors.verticalCenterOffset: header.visible ? header.height / 2 : 0
144
151
145 anchors.horizontalCenter: header.visible ? undefined : parent.horizontalCenter
152 anchors.horizontalCenter: header.visible ? undefined : parent.horizontalCenter
146 anchors.bottom: header.visible ? undefined : parent.bottom
153 anchors.bottom: header.visible ? undefined : parent.bottom
147 anchors.bottomMargin: header.visible ? 0 : units.gu(12)
154 anchors.bottomMargin: header.visible ? 0 : units.gu(12)
148−
149− running: true
150 }
155 }
151
156
152 MouseArea {
157 MouseArea {
qml/Stages/WindowResizeArea.qml+95−16
@@ -72,8 +72,8 @@ MouseArea {
72 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
72 var windowGeometry = windowStateStorage.getGeometry(root.windowId,
73 Qt.rect(target.x, target.y, defaultWidth, defaultHeight));
73 Qt.rect(target.x, target.y, defaultWidth, defaultHeight));
74
74
75− target.requestedWidth = Math.min(Math.max(windowGeometry.width, minWidth), screenWidth);
75+ target.requestedWidth = Math.min(Math.max(windowGeometry.width, d.minimumWidth), screenWidth);
76− target.requestedHeight = Math.min(Math.max(windowGeometry.height, minHeight), root.screenHeight - PanelState.panelHeight);
76+ target.requestedHeight = Math.min(Math.max(windowGeometry.height, d.minimumHeight), root.screenHeight - PanelState.panelHeight);
77 target.x = Math.max(Math.min(windowGeometry.x, root.screenWidth - target.requestedWidth), 0)
77 target.x = Math.max(Math.min(windowGeometry.x, root.screenWidth - target.requestedWidth), 0)
78 target.y = Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight)
78 target.y = Math.max(Math.min(windowGeometry.y, root.screenHeight - target.requestedHeight), PanelState.panelHeight)
79
79
@@ -91,6 +91,65 @@ MouseArea {
91
91
92 QtObject {
92 QtObject {
93 id: d
93 id: d
94+
95+ readonly property int maxSafeInt: 2147483647
96+ readonly property int maxSizeIncrement: units.gu(40)
97+
98+ readonly property int minimumWidth: root.target ? Math.max(root.minWidth, root.target.minimumWidth) : root.minWidth
99+ onMinimumWidthChanged: {
100+ if (target.requestedWidth < minimumWidth) {
101+ target.requestedWidth = minimumWidth;
102+ }
103+ }
104+ readonly property int minimumHeight: root.target ? Math.max(root.minHeight, root.target.minimumHeight) : root.minHeight
105+ onMinimumHeightChanged: {
106+ if (target.requestedHeight < minimumHeight) {
107+ target.requestedHeight = minimumHeight;
108+ }
109+ }
110+ readonly property int maximumWidth: root.target && root.target.maximumWidth >= minimumWidth && root.target.maximumWidth > 0
111+ ? root.target.maximumWidth : maxSafeInt
112+ onMaximumWidthChanged: {
113+ if (target.requestedWidth > maximumWidth) {
114+ target.requestedWidth = maximumWidth;
115+ }
116+ }
117+ readonly property int maximumHeight: root.target && root.target.maximumHeight >= minimumHeight && root.target.maximumHeight > 0
118+ ? root.target.maximumHeight : maxSafeInt
119+ onMaximumHeightChanged: {
120+ if (target.requestedHeight > maximumHeight) {
121+ target.requestedHeight = maximumHeight;
122+ }
123+ }
124+ readonly property int widthIncrement: {
125+ if (!root.target) {
126+ return 1;
127+ }
128+ if (root.target.widthIncrement > 0) {
129+ if (root.target.widthIncrement < maxSizeIncrement) {
130+ return root.target.widthIncrement;
131+ } else {
132+ return maxSizeIncrement;
133+ }
134+ } else {
135+ return 1;
136+ }
137+ }
138+ readonly property int heightIncrement: {
139+ if (!root.target) {
140+ return 1;
141+ }
142+ if (root.target.heightIncrement > 0) {
143+ if (root.target.heightIncrement < maxSizeIncrement) {
144+ return root.target.heightIncrement;
145+ } else {
146+ return maxSizeIncrement;
147+ }
148+ } else {
149+ return 1;
150+ }
151+ }
152+
94 property bool leftBorder: false
153 property bool leftBorder: false
95 property bool rightBorder: false
154 property bool rightBorder: false
96 property bool topBorder: false
155 property bool topBorder: false
@@ -209,38 +268,58 @@ MouseArea {
209
268
210 var pos = mapToItem(target.parent, mouse.x, mouse.y);
269 var pos = mapToItem(target.parent, mouse.x, mouse.y);
211
270
212− var deltaX = pos.x - d.startMousePosX;
271+ var deltaX = Math.floor((pos.x - d.startMousePosX) / d.widthIncrement) * d.widthIncrement;
213− var deltaY = pos.y - d.startMousePosY;
272+ var deltaY = Math.floor((pos.y - d.startMousePosY) / d.heightIncrement) * d.heightIncrement;
214
273
215 if (d.leftBorder) {
274 if (d.leftBorder) {
216 var newTargetX = d.startX + deltaX;
275 var newTargetX = d.startX + deltaX;
217− if (target.x + target.width > newTargetX + minWidth) {
276+ var rightBorderX = target.x + target.width;
218− target.requestedWidth = target.x + target.width - newTargetX;
277+ if (rightBorderX > newTargetX + d.minimumWidth) {
278+ if (rightBorderX < newTargetX + d.maximumWidth) {
279+ target.requestedWidth = rightBorderX - newTargetX;
280+ } else {
281+ target.requestedWidth = d.maximumWidth;
282+ }
219 } else {
283 } else {
220− target.requestedWidth = minWidth;
284+ target.requestedWidth = d.minimumWidth;
221 }
285 }
222
286
223 } else if (d.rightBorder) {
287 } else if (d.rightBorder) {
224− if (d.startWidth + deltaX >= minWidth) {
288+ var newWidth = d.startWidth + deltaX;
289+ if (newWidth > d.minimumWidth) {
290+ if (newWidth < d.maximumWidth) {
225− target.requestedWidth = d.startWidth + deltaX;
291+ target.requestedWidth = newWidth;
292+ } else {
293+ target.requestedWidth = d.maximumWidth;
294+ }
226 } else {
295 } else {
227− target.requestedWidth = minWidth;
296+ target.requestedWidth = d.minimumWidth;
228 }
297 }
229 }
298 }
230
299
231 if (d.topBorder) {
300 if (d.topBorder) {
232 var newTargetY = d.startY + deltaY;
301 var newTargetY = d.startY + deltaY;
233− if (target.y + target.height > newTargetY + minHeight) {
302+ var bottomBorderY = target.y + target.height;
234− target.requestedHeight = target.y + target.height - newTargetY;
303+ if (bottomBorderY > newTargetY + d.minimumHeight) {
304+ if (bottomBorderY < newTargetY + d.maximumHeight) {
305+ target.requestedHeight = bottomBorderY - newTargetY;
306+ } else {
307+ target.requestedHeight = d.maximumHeight;
308+ }
235 } else {
309 } else {
236− target.requestedHeight = minHeight;
310+ target.requestedHeight = d.minimumHeight;
237 }
311 }
238
312
239 } else if (d.bottomBorder) {
313 } else if (d.bottomBorder) {
240− if (d.startHeight + deltaY >= minHeight) {
314+ var newHeight = d.startHeight + deltaY;
315+ if (newHeight > d.minimumHeight) {
316+ if (newHeight < d.maximumHeight) {
241− target.requestedHeight = d.startHeight + deltaY;
317+ target.requestedHeight = newHeight;
318+ } else {
319+ target.requestedHeight = d.maximumHeight;
320+ }
242 } else {
321 } else {
243− target.requestedHeight = minHeight;
322+ target.requestedHeight = d.minimumHeight;
244 }
323 }
245 }
324 }
246 }
325 }
tests/mocks/Unity/Application/ApplicationInfo.cpp+14−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013-2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -278,3 +278,16 @@ void ApplicationInfo::setExemptFromLifecycle(bool exemptFromLifecycle)
278 Q_EMIT exemptFromLifecycleChanged(m_exemptFromLifecycle);
278 Q_EMIT exemptFromLifecycleChanged(m_exemptFromLifecycle);
279 }
279 }
280}
280}
281+
282+QSize ApplicationInfo::initialSurfaceSize() const
283+{
284+ return m_initialSurfaceSize;
285+}
286+
287+void ApplicationInfo::setInitialSurfaceSize(const QSize &size)
288+{
289+ if (size != m_initialSurfaceSize) {
290+ m_initialSurfaceSize = size;
291+ Q_EMIT initialSurfaceSizeChanged(m_initialSurfaceSize);
292+ }
293+}
tests/mocks/Unity/Application/ApplicationInfo.h+4−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright (C) 2013-2015 Canonical, Ltd.
2+ * Copyright (C) 2013-2016 Canonical, Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU General Public License as published by
@@ -95,6 +95,8 @@ public:
95 bool exemptFromLifecycle() const override;
95 bool exemptFromLifecycle() const override;
96 void setExemptFromLifecycle(bool) override;
96 void setExemptFromLifecycle(bool) override;
97
97
98+ QSize initialSurfaceSize() const override;
99+ void setInitialSurfaceSize(const QSize &size) override;
98public:
100public:
99 void setSession(Session* session);
101 void setSession(Session* session);
100 Session* session() const { return m_session; }
102 Session* session() const { return m_session; }
@@ -129,6 +131,7 @@ private:
129 RequestedState m_requestedState;
131 RequestedState m_requestedState;
130 bool m_isTouchApp;
132 bool m_isTouchApp;
131 bool m_exemptFromLifecycle;
133 bool m_exemptFromLifecycle;
134+ QSize m_initialSurfaceSize;
132
135
133 bool m_manualSurfaceCreation;
136 bool m_manualSurfaceCreation;
134};
137};
tests/mocks/Unity/Application/ApplicationTestInterface.cpp+4−4
@@ -36,7 +36,7 @@ ApplicationTestInterface::ApplicationTestInterface(QObject* parent)
36 connection.registerObject("/com/canonical/Unity8/Mocks", parent);
36 connection.registerObject("/com/canonical/Unity8/Mocks", parent);
37}
37}
38
38
39−Session* ApplicationTestInterface::addChildSession(Session* existingSession, const QString& surfaceImage)
39+Session* ApplicationTestInterface::addChildSession(Session* existingSession, const QString& surfaceImage, bool addSurface)
40{
40{
41 if (!existingSession) return nullptr;
41 if (!existingSession) return nullptr;
42
42
@@ -49,7 +49,7 @@ Session* ApplicationTestInterface::addChildSession(Session* existingSession, con
49 .arg(existingSession->childSessions()->count()),
49 .arg(existingSession->childSessions()->count()),
50 screenshotUrl);
50 screenshotUrl);
51 existingSession->addChildSession(session);
51 existingSession->addChildSession(session);
52− session->createSurface();
52+ if (addSurface) session->createSurface();
53
53
54 return session;
54 return session;
55}
55}
@@ -70,7 +70,7 @@ void ApplicationTestInterface::removeSurface(MirSurface* existingSurface)
70 existingSurface->setLive(false);
70 existingSurface->setLive(false);
71}
71}
72
72
73−quint32 ApplicationTestInterface::addChildSession(const QString& appId, quint32 existingSessionId, const QString& surfaceImage)
73+quint32 ApplicationTestInterface::addChildSession(const QString& appId, quint32 existingSessionId, const QString& surfaceImage, bool addSurface)
74{
74{
75 qDebug() << "ApplicationTestInterface::addChildSession to " << appId;
75 qDebug() << "ApplicationTestInterface::addChildSession to " << appId;
76
76
@@ -100,7 +100,7 @@ quint32 ApplicationTestInterface::addChildSession(const QString& appId, quint32
100 .arg(parentSession->childSessions()->count()),
100 .arg(parentSession->childSessions()->count()),
101 screenshotUrl);
101 screenshotUrl);
102 parentSession->addChildSession(session);
102 parentSession->addChildSession(session);
103− session->createSurface();
103+ if (addSurface) { session->createSurface(); }
104 m_childSessions[sessionId] = session;
104 m_childSessions[sessionId] = session;
105
105
106 return sessionId;
106 return sessionId;
tests/mocks/Unity/Application/ApplicationTestInterface.h+2−2
@@ -30,12 +30,12 @@ class ApplicationTestInterface : public QDBusAbstractAdaptor
30public:
30public:
31 ApplicationTestInterface(QObject* parent = 0);
31 ApplicationTestInterface(QObject* parent = 0);
32
32
33− Q_INVOKABLE Session* addChildSession(Session* existingSession, const QString& surfaceImage);
33+ Q_INVOKABLE Session* addChildSession(Session* existingSession, const QString& surfaceImage, bool addSurface);
34 Q_INVOKABLE void removeSession(Session* existingSession);
34 Q_INVOKABLE void removeSession(Session* existingSession);
35 Q_INVOKABLE void removeSurface(MirSurface* existingSurface);
35 Q_INVOKABLE void removeSurface(MirSurface* existingSurface);
36
36
37public Q_SLOTS:
37public Q_SLOTS:
38− quint32 addChildSession(const QString& appId, quint32 existingSessionId, const QString& surfaceImage);
38+ quint32 addChildSession(const QString& appId, quint32 existingSessionId, const QString& surfaceImage, bool addSurface);
39 void removeSession(quint32 sessionId);
39 void removeSession(quint32 sessionId);
40
40
41private:
41private:
tests/mocks/Unity/Application/MirSurface.cpp+48
@@ -266,3 +266,51 @@ void MirSurface::setSlowToResize(bool value)
266 }
266 }
267 }
267 }
268}
268}
269+
270+void MirSurface::setMinimumWidth(int value)
271+{
272+ if (value != m_minimumWidth) {
273+ m_minimumWidth = value;
274+ Q_EMIT minimumWidthChanged(m_minimumWidth);
275+ }
276+}
277+
278+void MirSurface::setMaximumWidth(int value)
279+{
280+ if (value != m_maximumWidth) {
281+ m_maximumWidth = value;
282+ Q_EMIT maximumWidthChanged(m_maximumWidth);
283+ }
284+}
285+
286+void MirSurface::setMinimumHeight(int value)
287+{
288+ if (value != m_minimumHeight) {
289+ m_minimumHeight = value;
290+ Q_EMIT minimumHeightChanged(m_minimumHeight);
291+ }
292+}
293+
294+void MirSurface::setMaximumHeight(int value)
295+{
296+ if (value != m_maximumHeight) {
297+ m_maximumHeight = value;
298+ Q_EMIT maximumHeightChanged(m_maximumHeight);
299+ }
300+}
301+
302+void MirSurface::setWidthIncrement(int value)
303+{
304+ if (value != m_widthIncrement) {
305+ m_widthIncrement = value;
306+ Q_EMIT widthIncrementChanged(m_widthIncrement);
307+ }
308+}
309+
310+void MirSurface::setHeightIncrement(int value)
311+{
312+ if (value != m_heightIncrement) {
313+ m_heightIncrement = value;
314+ Q_EMIT heightIncrementChanged(m_heightIncrement);
315+ }
316+}
tests/mocks/Unity/Application/MirSurface.h+21
@@ -66,6 +66,13 @@ public:
66 Mir::OrientationAngle orientationAngle() const override;
66 Mir::OrientationAngle orientationAngle() const override;
67 void setOrientationAngle(Mir::OrientationAngle) override;
67 void setOrientationAngle(Mir::OrientationAngle) override;
68
68
69+ int minimumWidth() const override { return m_minimumWidth; }
70+ int minimumHeight() const override { return m_minimumHeight; }
71+ int maximumWidth() const override { return m_maximumWidth; }
72+ int maximumHeight() const override { return m_maximumHeight; }
73+ int widthIncrement() const override { return m_widthIncrement; }
74+ int heightIncrement() const override { return m_heightIncrement; }
75+
69 ////
76 ////
70 // API for tests
77 // API for tests
71
78
@@ -82,6 +89,13 @@ public:
82 bool isSlowToResize() const;
89 bool isSlowToResize() const;
83 void setSlowToResize(bool value);
90 void setSlowToResize(bool value);
84
91
92+ Q_INVOKABLE void setMinimumWidth(int);
93+ Q_INVOKABLE void setMaximumWidth(int);
94+ Q_INVOKABLE void setMinimumHeight(int);
95+ Q_INVOKABLE void setMaximumHeight(int);
96+ Q_INVOKABLE void setWidthIncrement(int);
97+ Q_INVOKABLE void setHeightIncrement(int);
98+
85 /////
99 /////
86 // internal mock stuff
100 // internal mock stuff
87
101
@@ -125,6 +139,13 @@ private:
125 int m_width;
139 int m_width;
126 int m_height;
140 int m_height;
127
141
142+ int m_minimumWidth{0};
143+ int m_minimumHeight{0};
144+ int m_maximumWidth{0};
145+ int m_maximumHeight{0};
146+ int m_widthIncrement{0};
147+ int m_heightIncrement{0};
148+
128 bool m_slowToResize;
149 bool m_slowToResize;
129 QTimer m_delayedResizeTimer;
150 QTimer m_delayedResizeTimer;
130 QSize m_delayedResize;
151 QSize m_delayedResize;
tests/mocks/Unity/Application/MirSurfaceItem.cpp+6
@@ -37,6 +37,8 @@ MirSurfaceItem::MirSurfaceItem(QQuickItem *parent)
37 , m_surfaceHeight(0)
37 , m_surfaceHeight(0)
38 , m_touchPressCount(0)
38 , m_touchPressCount(0)
39 , m_touchReleaseCount(0)
39 , m_touchReleaseCount(0)
40+ , m_mousePressCount(0)
41+ , m_mouseReleaseCount(0)
40{
42{
41// qDebug() << "MirSurfaceItem::MirSurfaceItem() " << (void*)(this) << name();
43// qDebug() << "MirSurfaceItem::MirSurfaceItem() " << (void*)(this) << name();
42 setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton |
44 setAcceptedMouseButtons(Qt::LeftButton | Qt::MiddleButton | Qt::RightButton |
@@ -165,6 +167,8 @@ void MirSurfaceItem::touchEvent(QTouchEvent * event)
165
167
166void MirSurfaceItem::mousePressEvent(QMouseEvent * event)
168void MirSurfaceItem::mousePressEvent(QMouseEvent * event)
167{
169{
170+ m_mousePressCount++;
171+ Q_EMIT mousePressCountChanged(m_mousePressCount);
168 event->accept();
172 event->accept();
169}
173}
170
174
@@ -175,6 +179,8 @@ void MirSurfaceItem::mouseMoveEvent(QMouseEvent * event)
175
179
176void MirSurfaceItem::mouseReleaseEvent(QMouseEvent * event)
180void MirSurfaceItem::mouseReleaseEvent(QMouseEvent * event)
177{
181{
182+ m_mouseReleaseCount++;
183+ Q_EMIT mouseReleaseCountChanged(m_mouseReleaseCount);
178 event->accept();
184 event->accept();
179}
185}
180
186
tests/mocks/Unity/Application/MirSurfaceItem.h+14
@@ -36,6 +36,10 @@ class MirSurfaceItem : public unity::shell::application::MirSurfaceItemInterface
36 Q_PROPERTY(int touchReleaseCount READ touchReleaseCount WRITE setTouchReleaseCount
36 Q_PROPERTY(int touchReleaseCount READ touchReleaseCount WRITE setTouchReleaseCount
37 NOTIFY touchReleaseCountChanged DESIGNABLE false)
37 NOTIFY touchReleaseCountChanged DESIGNABLE false)
38
38
39+ Q_PROPERTY(int mousePressCount READ mousePressCount WRITE setMousePressCount
40+ NOTIFY mousePressCountChanged)
41+ Q_PROPERTY(int mouseReleaseCount READ mouseReleaseCount WRITE setMouseReleaseCount
42+ NOTIFY mouseReleaseCountChanged)
39public:
43public:
40 explicit MirSurfaceItem(QQuickItem *parent = 0);
44 explicit MirSurfaceItem(QQuickItem *parent = 0);
41 ~MirSurfaceItem();
45 ~MirSurfaceItem();
@@ -76,9 +80,17 @@ public:
76 int touchReleaseCount() const { return m_touchReleaseCount; }
80 int touchReleaseCount() const { return m_touchReleaseCount; }
77 void setTouchReleaseCount(int count) { m_touchReleaseCount = count; Q_EMIT touchReleaseCountChanged(count); }
81 void setTouchReleaseCount(int count) { m_touchReleaseCount = count; Q_EMIT touchReleaseCountChanged(count); }
78
82
83+ int mousePressCount() const { return m_mousePressCount; }
84+ void setMousePressCount(int count) { m_mousePressCount = count; Q_EMIT mousePressCountChanged(count); }
85+
86+ int mouseReleaseCount() const { return m_mouseReleaseCount; }
87+ void setMouseReleaseCount(int count) { m_mouseReleaseCount = count; Q_EMIT mouseReleaseCountChanged(count); }
88+
79Q_SIGNALS:
89Q_SIGNALS:
80 void touchPressCountChanged(int count);
90 void touchPressCountChanged(int count);
81 void touchReleaseCountChanged(int count);
91 void touchReleaseCountChanged(int count);
92+ void mousePressCountChanged(int count);
93+ void mouseReleaseCountChanged(int count);
82
94
83protected:
95protected:
84 void touchEvent(QTouchEvent * event) override;
96 void touchEvent(QTouchEvent * event) override;
@@ -109,6 +121,8 @@ private:
109
121
110 int m_touchPressCount;
122 int m_touchPressCount;
111 int m_touchReleaseCount;
123 int m_touchReleaseCount;
124+ int m_mousePressCount;
125+ int m_mouseReleaseCount;
112
126
113 FillMode m_fillMode{Stretch};
127 FillMode m_fillMode{Stretch};
114
128
tests/mocks/Unity/Application/SurfaceManager.cpp+56
@@ -46,6 +46,14 @@ MirSurface *SurfaceManager::createSurface(const QString& name,
46 MirSurface* surface = qobject_cast<MirSurface*>(obj);
46 MirSurface* surface = qobject_cast<MirSurface*>(obj);
47 Q_EMIT surfaceDestroyed(surface);
47 Q_EMIT surfaceDestroyed(surface);
48 });
48 });
49+
50+ surface->setMinimumWidth(m_newSurfaceMinimumWidth);
51+ surface->setMaximumWidth(m_newSurfaceMaximumWidth);
52+ surface->setMinimumHeight(m_newSurfaceMinimumHeight);
53+ surface->setMaximumHeight(m_newSurfaceMaximumHeight);
54+ surface->setWidthIncrement(m_newSurfaceWidthIncrement);
55+ surface->setHeightIncrement(m_newSurfaceHeightIncrement);
56+
49 Q_EMIT surfaceCreated(surface);
57 Q_EMIT surfaceCreated(surface);
50 return surface;
58 return surface;
51}
59}
@@ -62,3 +70,51 @@ MirSurface *SurfaceManager::inputMethodSurface()
62 }
70 }
63 return m_virtualKeyboard;
71 return m_virtualKeyboard;
64}
72}
73+
74+void SurfaceManager::setNewSurfaceMinimumWidth(int value)
75+{
76+ if (m_newSurfaceMinimumWidth != value) {
77+ m_newSurfaceMinimumWidth = value;
78+ Q_EMIT newSurfaceMinimumWidthChanged(m_newSurfaceMinimumWidth);
79+ }
80+}
81+
82+void SurfaceManager::setNewSurfaceMaximumWidth(int value)
83+{
84+ if (m_newSurfaceMaximumWidth != value) {
85+ m_newSurfaceMaximumWidth = value;
86+ Q_EMIT newSurfaceMaximumWidthChanged(m_newSurfaceMaximumWidth);
87+ }
88+}
89+
90+void SurfaceManager::setNewSurfaceMinimumHeight(int value)
91+{
92+ if (m_newSurfaceMinimumHeight != value) {
93+ m_newSurfaceMinimumHeight = value;
94+ Q_EMIT newSurfaceMinimumHeightChanged(m_newSurfaceMinimumHeight);
95+ }
96+}
97+
98+void SurfaceManager::setNewSurfaceMaximumHeight(int value)
99+{
100+ if (m_newSurfaceMaximumHeight != value) {
101+ m_newSurfaceMaximumHeight = value;
102+ Q_EMIT newSurfaceMaximumHeightChanged(m_newSurfaceMaximumHeight);
103+ }
104+}
105+
106+void SurfaceManager::setNewSurfaceWidthIncrement(int value)
107+{
108+ if (m_newSurfaceWidthIncrement != value) {
109+ m_newSurfaceWidthIncrement = value;
110+ Q_EMIT newSurfaceWidthIncrementChanged(m_newSurfaceWidthIncrement);
111+ }
112+}
113+
114+void SurfaceManager::setNewSurfaceHeightIncrement(int value)
115+{
116+ if (m_newSurfaceHeightIncrement != value) {
117+ m_newSurfaceHeightIncrement = value;
118+ Q_EMIT newSurfaceHeightIncrementChanged(m_newSurfaceHeightIncrement);
119+ }
120+}
tests/mocks/Unity/Application/SurfaceManager.h+40
@@ -25,6 +25,14 @@
25class SurfaceManager : public QObject
25class SurfaceManager : public QObject
26{
26{
27 Q_OBJECT
27 Q_OBJECT
28+
29+ Q_PROPERTY(int newSurfaceMinimumWidth READ newSurfaceMinimumWidth WRITE setNewSurfaceMinimumWidth NOTIFY newSurfaceMinimumWidthChanged)
30+ Q_PROPERTY(int newSurfaceMaximumWidth READ newSurfaceMaximumWidth WRITE setNewSurfaceMaximumWidth NOTIFY newSurfaceMaximumWidthChanged)
31+ Q_PROPERTY(int newSurfaceMinimumHeight READ newSurfaceMinimumHeight WRITE setNewSurfaceMinimumHeight NOTIFY newSurfaceMinimumHeightChanged)
32+ Q_PROPERTY(int newSurfaceMaximumHeight READ newSurfaceMaximumHeight WRITE setNewSurfaceMaximumHeight NOTIFY newSurfaceMaximumHeightChanged)
33+ Q_PROPERTY(int newSurfaceWidthIncrement READ newSurfaceWidthIncrement WRITE setNewSurfaceWidthIncrement NOTIFY newSurfaceWidthIncrementChanged)
34+ Q_PROPERTY(int newSurfaceHeightIncrement READ newSurfaceHeightIncrement WRITE setNewSurfaceHeightIncrement NOTIFY newSurfaceHeightIncrementChanged)
35+
28public:
36public:
29 explicit SurfaceManager(QObject *parent = 0);
37 explicit SurfaceManager(QObject *parent = 0);
30
38
@@ -38,14 +46,46 @@ public:
38 // To be used in the tests
46 // To be used in the tests
39 Q_INVOKABLE MirSurface* inputMethodSurface();
47 Q_INVOKABLE MirSurface* inputMethodSurface();
40
48
49+ int newSurfaceMinimumWidth() const { return m_newSurfaceMinimumWidth; }
50+ void setNewSurfaceMinimumWidth(int value);
51+
52+ int newSurfaceMaximumWidth() const { return m_newSurfaceMaximumWidth; }
53+ void setNewSurfaceMaximumWidth(int value);
54+
55+ int newSurfaceMinimumHeight() const { return m_newSurfaceMinimumHeight; }
56+ void setNewSurfaceMinimumHeight(int value);
57+
58+ int newSurfaceMaximumHeight() const { return m_newSurfaceMaximumHeight; }
59+ void setNewSurfaceMaximumHeight(int value);
60+
61+ int newSurfaceWidthIncrement() const { return m_newSurfaceWidthIncrement; }
62+ void setNewSurfaceWidthIncrement(int);
63+
64+ int newSurfaceHeightIncrement() const { return m_newSurfaceHeightIncrement; }
65+ void setNewSurfaceHeightIncrement(int);
66+
41Q_SIGNALS:
67Q_SIGNALS:
42 void countChanged();
68 void countChanged();
43 void surfaceCreated(MirSurface *surface);
69 void surfaceCreated(MirSurface *surface);
44 void surfaceDestroyed(MirSurface*surface);
70 void surfaceDestroyed(MirSurface*surface);
45
71
72+ void newSurfaceMinimumWidthChanged(int value);
73+ void newSurfaceMaximumWidthChanged(int value);
74+ void newSurfaceMinimumHeightChanged(int value);
75+ void newSurfaceMaximumHeightChanged(int value);
76+ void newSurfaceWidthIncrementChanged(int value);
77+ void newSurfaceHeightIncrementChanged(int value);
78+
46private:
79private:
47 static SurfaceManager *the_surface_manager;
80 static SurfaceManager *the_surface_manager;
48 VirtualKeyboard *m_virtualKeyboard;
81 VirtualKeyboard *m_virtualKeyboard;
82+
83+ int m_newSurfaceMinimumWidth{0};
84+ int m_newSurfaceMaximumWidth{0};
85+ int m_newSurfaceMinimumHeight{0};
86+ int m_newSurfaceMaximumHeight{0};
87+ int m_newSurfaceWidthIncrement{1};
88+ int m_newSurfaceHeightIncrement{1};
49};
89};
50
90
51#endif // SURFACEMANAGER_H
91#endif // SURFACEMANAGER_H
tests/mocks/Unity/Indicators/ModelActionRootState.qml+11−1
@@ -1,5 +1,5 @@
1/*
1/*
2− * Copyright 2013 Canonical Ltd.
2+ * Copyright 2013-2016 Canonical Ltd.
3 *
3 *
4 * This program is free software; you can redistribute it and/or modify
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
5 * it under the terms of the GNU Lesser General Public License as published by
@@ -30,10 +30,20 @@ Item {
30 property bool indicatorVisible: cachedState && cachedState.hasOwnProperty("visible") ? cachedState["visible"] : true
30 property bool indicatorVisible: cachedState && cachedState.hasOwnProperty("visible") ? cachedState["visible"] : true
31
31
32 property var cachedState: menu ? menu.get(0, "actionState") : undefined
32 property var cachedState: menu ? menu.get(0, "actionState") : undefined
33+ property string submenuAction: {
34+ if (!menu) return "";
35+ var ext = menu.get(0, "ext");
36+ var submenuVar = ext ? ext["submenu-action"] : undefined;
37+ return submenuVar ? submenuVar : ""
38+ }
33 Connections {
39 Connections {
34 target: menu
40 target: menu
35 onModelDataChanged: {
41 onModelDataChanged: {
36 cachedState = menu.get(0, "actionState");
42 cachedState = menu.get(0, "actionState");
43+
44+ var ext = menu.get(0, "ext");
45+ var submenuVar = ext ? ext["submenu-action"] : undefined;
46+ submenuAction = submenuVar ? submenuVar : ""
37 }
47 }
38 }
48 }
39
49
tests/plugins/Dash/cardcreator/1.res+6−7
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
@@ -24,13 +23,13 @@ Item {
24 Loader {
23 Loader {
25 id: artShapeLoader;
24 id: artShapeLoader;
26 objectName: "artShapeLoader";
25 objectName: "artShapeLoader";
27− active: cardData && cardData["art"] || false;
26+ readonly property string cardArt: cardData && cardData["art"] || "";
27+ active: cardArt != "";
28 asynchronous: root.asynchronous;
28 asynchronous: root.asynchronous;
29 visible: status == Loader.Ready;
29 visible: status == Loader.Ready;
30 sourceComponent: Item {
30 sourceComponent: Item {
31 id: artShape;
31 id: artShape;
32 objectName: "artShape";
32 objectName: "artShape";
33− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
33 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
34 readonly property alias image: artImage;
36 ShaderEffectSource {
35 ShaderEffectSource {
@@ -39,11 +38,11 @@ Item {
39 anchors.centerIn: parent;
38 anchors.centerIn: parent;
40 width: 1;
39 width: 1;
41 height: 1;
40 height: 1;
42− hideSource: doShapeItem;
41+ hideSource: true;
43 }
42 }
44 Loader {
43 Loader {
45 anchors.fill: parent;
44 anchors.fill: parent;
46− visible: artShape.doShapeItem;
45+ visible: true;
47 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
46 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
48 Component {
47 Component {
49 id: artShapeShapeComponent;
48 id: artShapeShapeComponent;
@@ -67,7 +66,7 @@ Item {
67 }
66 }
68 }
67 }
69 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
68 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
70− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
69+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1.6;
71 Component.onCompleted: { updateWidthHeightBindings(); }
70 Component.onCompleted: { updateWidthHeightBindings(); }
72 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
71 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
73 function updateWidthHeightBindings() {
72 function updateWidthHeightBindings() {
@@ -82,7 +81,7 @@ Item {
82 CroppedImageMinimumSourceSize {
81 CroppedImageMinimumSourceSize {
83 id: artImage;
82 id: artImage;
84 objectName: "artImage";
83 objectName: "artImage";
85− source: cardData && cardData["art"] || "";
84+ source: artShapeLoader.cardArt;
86 asynchronous: root.asynchronous;
85 asynchronous: root.asynchronous;
87 width: root.width;
86 width: root.width;
88 height: width / artShape.aspect;
87 height: width / artShape.aspect;
tests/plugins/Dash/cardcreator/10.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/11.res+7−8
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
@@ -62,13 +61,13 @@ Item {
62 Loader {
61 Loader {
63 id: artShapeLoader;
62 id: artShapeLoader;
64 objectName: "artShapeLoader";
63 objectName: "artShapeLoader";
65− active: cardData && cardData["art"] || false;
64+ readonly property string cardArt: cardData && cardData["art"] || decodeURI("%5C");
65+ active: cardArt != "";
66 asynchronous: root.asynchronous;
66 asynchronous: root.asynchronous;
67 visible: status == Loader.Ready;
67 visible: status == Loader.Ready;
68 sourceComponent: Item {
68 sourceComponent: Item {
69 id: artShape;
69 id: artShape;
70 objectName: "artShape";
70 objectName: "artShape";
71− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
72 visible: image.status == Image.Ready;
71 visible: image.status == Image.Ready;
73 readonly property alias image: artImage;
72 readonly property alias image: artImage;
74 ShaderEffectSource {
73 ShaderEffectSource {
@@ -77,11 +76,11 @@ Item {
77 anchors.centerIn: parent;
76 anchors.centerIn: parent;
78 width: 1;
77 width: 1;
79 height: 1;
78 height: 1;
80− hideSource: doShapeItem;
79+ hideSource: true;
81 }
80 }
82 Loader {
81 Loader {
83 anchors.fill: parent;
82 anchors.fill: parent;
84− visible: artShape.doShapeItem;
83+ visible: true;
85 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
84 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
86 Component {
85 Component {
87 id: artShapeShapeComponent;
86 id: artShapeShapeComponent;
@@ -105,7 +104,7 @@ Item {
105 }
104 }
106 }
105 }
107 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
106 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
108− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
107+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
109 Component.onCompleted: { updateWidthHeightBindings(); }
108 Component.onCompleted: { updateWidthHeightBindings(); }
110 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
109 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
111 function updateWidthHeightBindings() {
110 function updateWidthHeightBindings() {
@@ -120,7 +119,7 @@ Item {
120 CroppedImageMinimumSourceSize {
119 CroppedImageMinimumSourceSize {
121 id: artImage;
120 id: artImage;
122 objectName: "artImage";
121 objectName: "artImage";
123− source: cardData && cardData["art"] || "";
122+ source: artShapeLoader.cardArt;
124 asynchronous: root.asynchronous;
123 asynchronous: root.asynchronous;
125 width: root.width;
124 width: root.width;
126 height: width / artShape.aspect;
125 height: width / artShape.aspect;
@@ -148,7 +147,7 @@ left: parent.left;
148 id: mascotImage;
147 id: mascotImage;
149 objectName: "mascotImage";
148 objectName: "mascotImage";
150 anchors { verticalCenter: parent.verticalCenter; }
149 anchors { verticalCenter: parent.verticalCenter; }
151− source: cardData && cardData["mascot"] || "";
150+ source: cardData && cardData["mascot"] || decodeURI("%22");
152 width: units.gu(6);
151 width: units.gu(6);
153 height: units.gu(5.625);
152 height: units.gu(5.625);
154 horizontalAlignment: Image.AlignHCenter;
153 horizontalAlignment: Image.AlignHCenter;
tests/plugins/Dash/cardcreator/2.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/3.res+6−7
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
@@ -24,13 +23,13 @@ Item {
24 Loader {
23 Loader {
25 id: artShapeLoader;
24 id: artShapeLoader;
26 objectName: "artShapeLoader";
25 objectName: "artShapeLoader";
27− active: cardData && cardData["art"] || false;
26+ readonly property string cardArt: cardData && cardData["art"] || decodeURI("IHAVE%5C%22ESCAPED%5C%22QUOTES%5C%22");
27+ active: cardArt != "";
28 asynchronous: root.asynchronous;
28 asynchronous: root.asynchronous;
29 visible: status == Loader.Ready;
29 visible: status == Loader.Ready;
30 sourceComponent: Item {
30 sourceComponent: Item {
31 id: artShape;
31 id: artShape;
32 objectName: "artShape";
32 objectName: "artShape";
33− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
33 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
34 readonly property alias image: artImage;
36 ShaderEffectSource {
35 ShaderEffectSource {
@@ -39,11 +38,11 @@ Item {
39 anchors.centerIn: parent;
38 anchors.centerIn: parent;
40 width: 1;
39 width: 1;
41 height: 1;
40 height: 1;
42− hideSource: doShapeItem;
41+ hideSource: true;
43 }
42 }
44 Loader {
43 Loader {
45 anchors.fill: parent;
44 anchors.fill: parent;
46− visible: artShape.doShapeItem;
45+ visible: true;
47 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
46 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
48 Component {
47 Component {
49 id: artShapeShapeComponent;
48 id: artShapeShapeComponent;
@@ -67,7 +66,7 @@ Item {
67 }
66 }
68 }
67 }
69 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
68 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
70− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
69+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 0.75;
71 Component.onCompleted: { updateWidthHeightBindings(); }
70 Component.onCompleted: { updateWidthHeightBindings(); }
72 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
71 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
73 function updateWidthHeightBindings() {
72 function updateWidthHeightBindings() {
@@ -82,7 +81,7 @@ Item {
82 CroppedImageMinimumSourceSize {
81 CroppedImageMinimumSourceSize {
83 id: artImage;
82 id: artImage;
84 objectName: "artImage";
83 objectName: "artImage";
85− source: cardData && cardData["art"] || "";
84+ source: artShapeLoader.cardArt;
86 asynchronous: root.asynchronous;
85 asynchronous: root.asynchronous;
87 width: root.width;
86 width: root.width;
88 height: width / artShape.aspect;
87 height: width / artShape.aspect;
tests/plugins/Dash/cardcreator/4.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/5.res+6−7
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
@@ -24,13 +23,13 @@ Item {
24 Loader {
23 Loader {
25 id: artShapeLoader;
24 id: artShapeLoader;
26 objectName: "artShapeLoader";
25 objectName: "artShapeLoader";
27− active: cardData && cardData["art"] || false;
26+ readonly property string cardArt: cardData && cardData["art"] || "";
27+ active: cardArt != "";
28 asynchronous: root.asynchronous;
28 asynchronous: root.asynchronous;
29 visible: status == Loader.Ready;
29 visible: status == Loader.Ready;
30 sourceComponent: Item {
30 sourceComponent: Item {
31 id: artShape;
31 id: artShape;
32 objectName: "artShape";
32 objectName: "artShape";
33− readonly property bool doShapeItem: components["art"]["conciergeMode"] !== true;
34 visible: image.status == Image.Ready;
33 visible: image.status == Image.Ready;
35 readonly property alias image: artImage;
34 readonly property alias image: artImage;
36 ShaderEffectSource {
35 ShaderEffectSource {
@@ -39,11 +38,11 @@ Item {
39 anchors.centerIn: parent;
38 anchors.centerIn: parent;
40 width: 1;
39 width: 1;
41 height: 1;
40 height: 1;
42− hideSource: doShapeItem;
41+ hideSource: false;
43 }
42 }
44 Loader {
43 Loader {
45 anchors.fill: parent;
44 anchors.fill: parent;
46− visible: artShape.doShapeItem;
45+ visible: false;
47 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
46 sourceComponent: root.artShapeStyle === "icon" ? artShapeIconComponent : artShapeShapeComponent;
48 Component {
47 Component {
49 id: artShapeShapeComponent;
48 id: artShapeShapeComponent;
@@ -67,7 +66,7 @@ Item {
67 }
66 }
68 }
67 }
69 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
68 readonly property real fixedArtShapeSizeAspect: (root.fixedArtShapeSize.height > 0 && root.fixedArtShapeSize.width > 0) ? root.fixedArtShapeSize.width / root.fixedArtShapeSize.height : -1;
70− readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : components !== undefined ? components["art"]["aspect-ratio"] : 1;
69+ readonly property real aspect: fixedArtShapeSizeAspect > 0 ? fixedArtShapeSizeAspect : 1;
71 Component.onCompleted: { updateWidthHeightBindings(); }
70 Component.onCompleted: { updateWidthHeightBindings(); }
72 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
71 Connections { target: root; onFixedArtShapeSizeChanged: updateWidthHeightBindings(); }
73 function updateWidthHeightBindings() {
72 function updateWidthHeightBindings() {
@@ -82,7 +81,7 @@ Item {
82 CroppedImageMinimumSourceSize {
81 CroppedImageMinimumSourceSize {
83 id: artImage;
82 id: artImage;
84 objectName: "artImage";
83 objectName: "artImage";
85− source: cardData && cardData["art"] || "";
84+ source: artShapeLoader.cardArt;
86 asynchronous: root.asynchronous;
85 asynchronous: root.asynchronous;
87 width: root.width;
86 width: root.width;
88 height: width / artShape.aspect;
87 height: width / artShape.aspect;
tests/plugins/Dash/cardcreator/5.tst+1−1
@@ -1,3 +1,3 @@
1template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}
1template: {"non-interactive":true,"card-layout":"vertical","card-size":"medium","category-layout":"carousel","collapsed-rows":2,"overlay":true}
2−components: {"art":{"aspect-ratio":1,"field":"art"},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}}
2+components: {"art":{"aspect-ratio":1,"field":"art","conciergeMode":true},"subtitle":{"field":"artist"},"title":{"field":"title"},"attributes":{}}
3result: 5.res
3result: 5.res
tests/plugins/Dash/cardcreator/6.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/7.res−1
@@ -1,6 +1,5 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
tests/plugins/Dash/cardcreator/8.res+1−2
@@ -1,7 +1,6 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
3+ property var cardData;
4− property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6 property string backgroundShapeStyle: "inset";
5 property string backgroundShapeStyle: "inset";
7 property real fontScale: 1.0;
6 property real fontScale: 1.0;
tests/plugins/Dash/cardcreator/9.res+12−4
@@ -1,9 +1,8 @@
1AbstractButton {
1AbstractButton {
2 id: root;
2 id: root;
3− property var components;
4 property var cardData;
3 property var cardData;
5 property string artShapeStyle: "inset";
4 property string artShapeStyle: "inset";
6− property string backgroundShapeStyle: "inset";
5+ property string backgroundShapeStyle: "inset";
7 property real fontScale: 1.0;
6 property real fontScale: 1.0;
8 property var scopeStyle: null;
7 property var scopeStyle: null;
9 property int titleAlignment: Text.AlignLeft;
8 property int titleAlignment: Text.AlignLeft;
@@ -80,11 +79,20 @@ CardAudioProgress {
80 visible: parent.pressed;
79 visible: parent.pressed;
81 radius: "medium";
80 radius: "medium";
82 }
81 }
82+ Rectangle {
83+ color: Qt.rgba(0, 0, 0, 0.5);
84+ anchors.centerIn: parent;
85+ width: parent.width * 0.5;
86+ height: width;
87+ radius: width / 2;
88+ }
83 Icon {
89 Icon {
84− anchors.fill: parent;
90+ anchors.centerIn: parent;
85− anchors.margins: parent.height > units.gu(5) ? units.gu(2) : 0;
91+ width: parent.width * 0.3;
92+ height: width;
86 opacity: 0.9;
93 opacity: 0.9;
87 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start";
94 name: DashAudioPlayer.playing && AudioUrlComparer.compare(parent.source, DashAudioPlayer.currentSource) ? "media-playback-pause" : "media-playback-start";
95+ color: "white";
88 }
96 }
89 onClicked: {
97 onClicked: {
90 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) {
98 if (AudioUrlComparer.compare(source, DashAudioPlayer.currentSource)) {
tests/plugins/Unity/Launcher/launchermodeltest.cpp+2
@@ -61,6 +61,8 @@ public:
61 bool isTouchApp() const override { return true; }
61 bool isTouchApp() const override { return true; }
62 bool exemptFromLifecycle() const override { return false; }
62 bool exemptFromLifecycle() const override { return false; }
63 void setExemptFromLifecycle(bool) override {}
63 void setExemptFromLifecycle(bool) override {}
64+ QSize initialSurfaceSize() const override { return QSize(); }
65+ void setInitialSurfaceSize(const QSize &) override {}
64
66
65 // Methods used for mocking (not in the interface)
67 // Methods used for mocking (not in the interface)
66 void setFocused(bool focused) { m_focused = focused; Q_EMIT focusedChanged(focused); }
68 void setFocused(bool focused) { m_focused = focused; Q_EMIT focusedChanged(focused); }
tests/qmltests/Components/tst_ZoomableImage.qml+8−5
@@ -73,7 +73,10 @@ Rectangle {
73 tryCompareFunction(function() { return get_filename(imageRenderer.source.toString()) === get_filename(widgetData1["source"]); }, true);
73 tryCompareFunction(function() { return get_filename(imageRenderer.source.toString()) === get_filename(widgetData1["source"]); }, true);
74 waitForRendering(zoomableImage);
74 waitForRendering(zoomableImage);
75 tryCompare(zoomableImage, "imageStatus", Image.Ready);
75 tryCompare(zoomableImage, "imageStatus", Image.Ready);
76− compare (signalSpy.count, 1);
76+ compare(signalSpy.count, 1);
77+ compare(imageRenderer.sourceSize.width, root.width);
78+ zoomableImage.zoomable = true;
79+ compare(imageRenderer.sourceSize.width, root.width*3);
77 }
80 }
78
81
79 function get_filename(a) {
82 function get_filename(a) {
@@ -138,14 +141,14 @@ Rectangle {
138 var imageRenderer = findChild(zoomableImage, "imageRenderer");
141 var imageRenderer = findChild(zoomableImage, "imageRenderer");
139 var flickable = findChild(zoomableImage, "flickable");
142 var flickable = findChild(zoomableImage, "flickable");
140
143
141− signalSpy.signalName = "onScaleChanged";
142− signalSpy.target = image;
143− signalSpy.clear();
144−
145 zoomableImage.source = data.source;
144 zoomableImage.source = data.source;
146 zoomableImage.zoomable = data.zoomable;
145 zoomableImage.zoomable = data.zoomable;
147 waitForRendering(zoomableImage);
146 waitForRendering(zoomableImage);
148
147
148+ signalSpy.signalName = "onScaleChanged";
149+ signalSpy.target = image;
150+ signalSpy.clear();
151+
149 tryCompare(zoomableImage, "imageStatus", Image.Ready);
152 tryCompare(zoomableImage, "imageStatus", Image.Ready);
150 tryCompareFunction(function() { return get_filename(imageRenderer.source.toString()) === get_filename(data.source); }, true);
153 tryCompareFunction(function() { return get_filename(imageRenderer.source.toString()) === get_filename(data.source); }, true);
151 waitForRendering(image);
154 waitForRendering(image);
tests/qmltests/Dash/Previews/tst_PreviewHeader.qml+15
@@ -54,6 +54,14 @@ Rectangle {
54 "attributes": [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}]
54 "attributes": [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}]
55 }
55 }
56
56
57+ property var emptyfallbackheaderjson: {
58+ "title": "THE TITLE",
59+ "subtitle": "Something catchy",
60+ "mascot": "",
61+ "fallback": "../graphics/play_button.png",
62+ "attributes": [{"value":"text1","icon":"image://theme/ok"},{"value":"text2","icon":"image://theme/cancel"}]
63+ }
64+
57 PreviewHeader {
65 PreviewHeader {
58 id: previewHeader
66 id: previewHeader
59 widgetData: headerjson
67 widgetData: headerjson
@@ -150,6 +158,13 @@ Rectangle {
150 var mascot = findChild(previewHeader, "mascotShape");
158 var mascot = findChild(previewHeader, "mascotShape");
151 tryCompare(mascot, "visible", true);
159 tryCompare(mascot, "visible", true);
152 tryCompare(mascot.source, "status", Image.Ready);
160 tryCompare(mascot.source, "status", Image.Ready);
161+
162+ previewHeader.widgetData = {};
163+ previewHeader.widgetData = emptyfallbackheaderjson;
164+ tryCompareFunction(function() { return findChild(previewHeader, "mascotShape") != null }, true);
165+ var mascot = findChild(previewHeader, "mascotShape");
166+ tryCompare(mascot, "visible", true);
167+ tryCompare(mascot.source, "status", Image.Ready);
153 }
168 }
154 }
169 }
155}
170}
tests/qmltests/Dash/Previews/tst_PreviewImageGallery.qml+19
@@ -48,6 +48,16 @@ Rectangle {
48 , "fallback": "../../../tests/graphics/clock@18.png"
48 , "fallback": "../../../tests/graphics/clock@18.png"
49 }
49 }
50
50
51+ property var sourcesModelEmptyWithFallback: {
52+ "sources": [
53+ "../../graphics/phone_background.jpg",
54+ "../../graphics/tablet_background.jpg",
55+ "../../../tests/graphics/clock@18.png",
56+ ""
57+ ]
58+ , "fallback": "../../../tests/graphics/clock@18.png"
59+ }
60+
51 PreviewImageGallery {
61 PreviewImageGallery {
52 id: imageGallery
62 id: imageGallery
53 width: parent.width
63 width: parent.width
@@ -123,5 +133,14 @@ Rectangle {
123 image3 = findChild(imageGallery, "previewImage3");
133 image3 = findChild(imageGallery, "previewImage3");
124 tryCompare(image3, "state", "ready");
134 tryCompare(image3, "state", "ready");
125 }
135 }
136+
137+ function test_empty_fallback() {
138+ var image3 = findChild(imageGallery, "previewImage3");
139+ tryCompare(image3, "state", "error");
140+ imageGallery.widgetData = sourcesModel0;
141+ imageGallery.widgetData = sourcesModelEmptyWithFallback;
142+ image3 = findChild(imageGallery, "previewImage3");
143+ tryCompare(image3, "state", "ready");
144+ }
126 }
145 }
127}
146}
tests/qmltests/Dash/Previews/tst_PreviewZoomableImage.qml+12
@@ -39,6 +39,11 @@ Rectangle {
39 "fallback": "../../graphics/phone_background.jpg"
39 "fallback": "../../graphics/phone_background.jpg"
40 }
40 }
41
41
42+ property var widgetData3: {
43+ "source": "",
44+ "fallback": "../../graphics/phone_background.jpg"
45+ }
46+
42 Loader {
47 Loader {
43 id: loader
48 id: loader
44 width: parent.width
49 width: parent.width
@@ -100,5 +105,12 @@ Rectangle {
100 waitForRendering(lazyImage);
105 waitForRendering(lazyImage);
101 tryCompare(lazyImage, "state", "ready");
106 tryCompare(lazyImage, "state", "ready");
102 }
107 }
108+
109+ function test_emptyfallback() {
110+ zoomableImage.widgetData = widgetData3;
111+ waitForRendering(zoomableImage);
112+ waitForRendering(lazyImage);
113+ tryCompare(lazyImage, "state", "ready");
114+ }
103 }
115 }
104}
116}
tests/qmltests/Dash/tst_Card.qml+18−1
@@ -130,7 +130,6 @@ Rectangle {
130 sourceComponent: cardTool.cardComponent
130 sourceComponent: cardTool.cardComponent
131 clip: true
131 clip: true
132 onLoaded: {
132 onLoaded: {
133− item.components = Qt.binding(function() { return cardTool.components; });
134 item.cardData = Qt.binding(function() { return Helpers.mapData(dataArea.text, cardTool.components, dataError); });
133 item.cardData = Qt.binding(function() { return Helpers.mapData(dataArea.text, cardTool.components, dataError); });
135 item.width = Qt.binding(function() { return cardTool.cardWidth || item.implicitWidth; });
134 item.width = Qt.binding(function() { return cardTool.cardWidth || item.implicitWidth; });
136 item.height = Qt.binding(function() { return cardTool.cardHeight || item.implicitHeight; });
135 item.height = Qt.binding(function() { return cardTool.cardHeight || item.implicitHeight; });
@@ -476,6 +475,15 @@ Rectangle {
476 card.cardDataChanged();
475 card.cardDataChanged();
477 waitForRendering(card);
476 waitForRendering(card);
478 tryCompare(art, "visible", true);
477 tryCompare(art, "visible", true);
478+ compare(artImage.source, Qt.resolvedUrl("artwork/emblem.png"));
479+
480+ cardTool.components["art"]["fallback"] = Qt.resolvedUrl("artwork/checkers.png");
481+ cardTool.componentsChanged();
482+ card.cardData["art"] = "";
483+ card.cardDataChanged();
484+ waitForRendering(card);
485+ tryCompare(art, "visible", true);
486+ compare(artImage.source, Qt.resolvedUrl("artwork/checkers.png"));
479
487
480 card.cardData["mascot"] = "somethingbroken2";
488 card.cardData["mascot"] = "somethingbroken2";
481 card.cardDataChanged();
489 card.cardDataChanged();
@@ -487,6 +495,15 @@ Rectangle {
487 card.cardDataChanged();
495 card.cardDataChanged();
488 waitForRendering(card);
496 waitForRendering(card);
489 tryCompare(mascotImage, "status", Image.Ready);
497 tryCompare(mascotImage, "status", Image.Ready);
498+ compare(mascotImage.source, Qt.resolvedUrl("artwork/emblem.png"));
499+
500+ cardTool.components["mascot"] = {"fallback": Qt.resolvedUrl("artwork/checkers.png")};
501+ cardTool.componentsChanged();
502+ card.cardData["mascot"] = "";
503+ card.cardDataChanged();
504+ waitForRendering(card);
505+ tryCompare(mascotImage, "status", Image.Ready);
506+ compare(mascotImage.source, Qt.resolvedUrl("artwork/checkers.png"));
490 }
507 }
491
508
492 function test_font_weights_data() {
509 function test_font_weights_data() {
tests/qmltests/Dash/tst_CardBenchmark.qml−2
@@ -61,8 +61,6 @@ Rectangle {
61 item.width = Qt.binding(function() { return cardTool.cardWidth || implicitWidth; });
61 item.width = Qt.binding(function() { return cardTool.cardWidth || implicitWidth; });
62 item.height = Qt.binding(function() { return cardTool.cardHeight || implicitHeight; });
62 item.height = Qt.binding(function() { return cardTool.cardHeight || implicitHeight; });
63 item.cardData = Qt.binding(function() { return Helpers.mapData(root.cardData, cardTool.components); });
63 item.cardData = Qt.binding(function() { return Helpers.mapData(root.cardData, cardTool.components); });
64− item.template = Qt.binding(function() { return cardTool.template; });
65− item.components = Qt.binding(function() { return cardTool.components; });
66 }
64 }
67 }
65 }
68 }
66 }
tests/qmltests/Greeter/tst_WideView.qml+11
@@ -522,5 +522,16 @@ Item {
522
522
523 tryCompare(loginList, "height", view.height);
523 tryCompare(loginList, "height", view.height);
524 }
524 }
525+
526+ function test_alphanumeric() {
527+ var passwordInput = findChild(view, "passwordInput");
528+
529+ verify(view.alphanumeric);
530+ compare(passwordInput.inputMethodHints, Qt.ImhNone);
531+ view.alphanumeric = false;
532+ compare(passwordInput.inputMethodHints, Qt.ImhDigitsOnly);
533+ view.alphanumeric = true;
534+ compare(passwordInput.inputMethodHints, Qt.ImhNone);
535+ }
525 }
536 }
526}
537}
tests/qmltests/Stages/RecursingChildSessionControl.qml+3−3
@@ -88,7 +88,7 @@ ColumnLayout {
88
88
89 CheckBox {
89 CheckBox {
90 id: _surfaceCheckbox;
90 id: _surfaceCheckbox;
91− checked: false;
91+ checked: root.session.lastSurface ? true : false
92 activeFocusOnPress: false
92 activeFocusOnPress: false
93 enabled: root.session
93 enabled: root.session
94 onCheckedChanged: {
94 onCheckedChanged: {
@@ -101,7 +101,7 @@ ColumnLayout {
101
101
102 Connections {
102 Connections {
103 target: root.session ? root.session : null
103 target: root.session ? root.session : null
104− onSurfaceChanged: {
104+ onLastSurfaceChanged: {
105 surfaceCheckbox.checked = root.session.lastSurface !== null
105 surfaceCheckbox.checked = root.session.lastSurface !== null
106 }
106 }
107 }
107 }
@@ -137,7 +137,7 @@ ColumnLayout {
137 text: "Add Child"
137 text: "Add Child"
138 onClicked: {
138 onClicked: {
139 var screenshot = Math.round(Math.random()*100 % (screenshotIds.length-1));
139 var screenshot = Math.round(Math.random()*100 % (screenshotIds.length-1));
140− var session = ApplicationTest.addChildSession(root.session, root.screenshotIds[screenshot]);
140+ var session = ApplicationTest.addChildSession(root.session, root.screenshotIds[screenshot], true);
141 }
141 }
142 }
142 }
143 }
143 }
tests/qmltests/Stages/SizeHintField.qmlnew file+33
@@ -0,0 +1,33 @@
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+import QtQuick.Layouts 1.1
19+import Ubuntu.Components 1.3
20+
21+Row {
22+ property alias text: label.text
23+ property alias value: field.text
24+ spacing: units.gu(1)
25+ Label {
26+ id: label
27+ color: "black"; anchors.verticalCenter: parent.verticalCenter
28+ }
29+ TextField {
30+ id: field
31+ text: ""; width: units.gu(8); hasClearButton: false; maximumLength: 6; inputMask: "d00000"
32+ }
33+}
tests/qmltests/Stages/SurfaceManagerControls.qmlnew file+33
@@ -0,0 +1,33 @@
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 Unity.Application 0.1
20+
21+Column {
22+ id: root
23+ property color textColor: "black"
24+
25+ Label {text: "Size hints for new surface:"; color: root.textColor; font.bold: true}
26+
27+ SurfaceManagerField { text: "min width"; propertyName: "newSurfaceMinimumWidth"; textColor: root.textColor }
28+ SurfaceManagerField { text: "max width"; propertyName: "newSurfaceMaximumWidth"; textColor: root.textColor }
29+ SurfaceManagerField { text: "min height"; propertyName: "newSurfaceMinimumHeight"; textColor: root.textColor }
30+ SurfaceManagerField { text: "max height"; propertyName: "newSurfaceMaximumHeight"; textColor: root.textColor }
31+ SurfaceManagerField { text: "width increment"; propertyName: "newSurfaceWidthIncrement"; textColor: root.textColor }
32+ SurfaceManagerField { text: "height increment"; propertyName: "newSurfaceHeightIncrement"; textColor: root.textColor }
33+}
tests/qmltests/Stages/SurfaceManagerField.qmlnew file+40
@@ -0,0 +1,40 @@
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 Unity.Application 0.1
20+
21+Row {
22+ id: root
23+ property alias textColor: label.color
24+ property alias text: label.text
25+ property string propertyName
26+
27+ Label {id: label; anchors.verticalCenter: parent.verticalCenter}
28+ TextField {
29+ width: units.gu(10); hasClearButton: false; maximumLength: 6
30+ inputMask: "d00000"
31+ text: ""
32+ onTextChanged: {
33+ if (text.length > 0) {
34+ SurfaceManager[root.propertyName] = parseInt(text);
35+ } else {
36+ SurfaceManager[root.propertyName] = 0;
37+ }
38+ }
39+ }
40+}
tests/qmltests/Stages/tst_DesktopStage.qml+30−24
@@ -89,36 +89,42 @@ Item {
89 right: parent.right
89 right: parent.right
90 }
90 }
91
91
92− Column {
92+ Flickable {
93− anchors { left: parent.left; right: parent.right; top: parent.top; margins: units.gu(1) }
93+ anchors.fill: parent
94+ contentHeight: controlsColumn.height
95+ Column {
96+ id: controlsColumn
94− spacing: units.gu(1)
97+ spacing: units.gu(1)
95−
98+
96− Button {
99+ Button {
97− color: "white"
100+ color: "white"
98− text: "Make surface slow to resize"
101+ text: "Make surface slow to resize"
99− activeFocusOnPress: false
102+ activeFocusOnPress: false
100− onClicked: {
103+ onClicked: {
101− if (ApplicationManager.focusedApplicationId) {
104+ if (ApplicationManager.focusedApplicationId) {
102− var surface = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).session.lastSurface;
105+ var surface = ApplicationManager.findApplication(ApplicationManager.focusedApplicationId).session.lastSurface;
103− surface.slowToResize = true;
106+ surface.slowToResize = true;
107+ }
104 }
108 }
105 }
109 }
106− }
107
110
108− EdgeBarrierControls {
111+ EdgeBarrierControls {
109− id: edgeBarrierControls
112+ id: edgeBarrierControls
110− text: "Drag here to pull out spread"
113+ text: "Drag here to pull out spread"
111− backgroundColor: "blue"
114+ backgroundColor: "blue"
112− onDragged: { desktopStageLoader.item.pushRightEdge(amount); }
115+ onDragged: { desktopStageLoader.item.pushRightEdge(amount); }
113− }
116+ }
114
117
115− Divider {}
118+ Divider {}
116
119
117− Repeater {
120+ Repeater {
118− model: ApplicationManager.availableApplications
121+ model: ApplicationManager.availableApplications
119− ApplicationCheckBox {
122+ ApplicationCheckBox {
120− appId: modelData
123+ appId: modelData
124+ }
121 }
125 }
126+
127+ SurfaceManagerControls { textColor: "white" }
122 }
128 }
123 }
129 }
124 }
130 }
tests/qmltests/Stages/tst_SessionContainer.qml+27−5
@@ -155,7 +155,8 @@ Rectangle {
155 var sessions = [];
155 var sessions = [];
156 for (i = 0; i < data.count; i++) {
156 for (i = 0; i < data.count; i++) {
157 var session = ApplicationTest.addChildSession(sessionContainer.session,
157 var session = ApplicationTest.addChildSession(sessionContainer.session,
158− "gallery");
158+ "gallery",
159+ true);
159 session.createSurface();
160 session.createSurface();
160 sessionContainer.session.addChildSession(session);
161 sessionContainer.session.addChildSession(session);
161 compare(sessionContainer.childSessions.count(), i+1);
162 compare(sessionContainer.childSessions.count(), i+1);
@@ -180,7 +181,7 @@ Rectangle {
180 // 3 sessions should cover all edge cases
181 // 3 sessions should cover all edge cases
181 for(i = 0; i < 3; i++) {
182 for(i = 0; i < 3; i++) {
182 var a_session = ApplicationTest.addChildSession(
183 var a_session = ApplicationTest.addChildSession(
183− sessionContainer.session, "gallery"
184+ sessionContainer.session, "gallery", true
184 )
185 )
185
186
186 a_session.createSurface();
187 a_session.createSurface();
@@ -226,7 +227,8 @@ Rectangle {
226 var container = sessionContainer;
227 var container = sessionContainer;
227 for (i = 0; i < data.depth; i++) {
228 for (i = 0; i < data.depth; i++) {
228 var session = ApplicationTest.addChildSession(lastSession,
229 var session = ApplicationTest.addChildSession(lastSession,
229− "gallery");
230+ "gallery",
231+ true);
230 session.createSurface();
232 session.createSurface();
231 lastSession.addChildSession(session);
233 lastSession.addChildSession(session);
232 compare(container.childSessions.count(), 1);
234 compare(container.childSessions.count(), 1);
@@ -250,7 +252,8 @@ Rectangle {
250 var sessionContainer = sessionContainerLoader.item;
252 var sessionContainer = sessionContainerLoader.item;
251
253
252 var session = ApplicationTest.addChildSession(sessionContainer.session,
254 var session = ApplicationTest.addChildSession(sessionContainer.session,
253− "gallery");
255+ "gallery",
256+ true);
254 session.createSurface();
257 session.createSurface();
255 sessionContainer.session.addChildSession(session);
258 sessionContainer.session.addChildSession(session);
256
259
@@ -288,7 +291,8 @@ Rectangle {
288 var sessionContainer = sessionContainerLoader.item;
291 var sessionContainer = sessionContainerLoader.item;
289
292
290 var session = ApplicationTest.addChildSession(sessionContainer.session,
293 var session = ApplicationTest.addChildSession(sessionContainer.session,
291− "gallery");
294+ "gallery",
295+ true);
292
296
293 var delegate = findChild(sessionContainer, "childDelegate0");
297 var delegate = findChild(sessionContainer, "childDelegate0");
294 var childContainer = findChild(delegate, "sessionContainer");
298 var childContainer = findChild(delegate, "sessionContainer");
@@ -304,6 +308,24 @@ Rectangle {
304 tryCompareFunction(function() { return isContainerAnimating(childContainer); }, true);
308 tryCompareFunction(function() { return isContainerAnimating(childContainer); }, true);
305 // wait for animation to end
309 // wait for animation to end
306 tryCompareFunction(function() { return isContainerAnimating(childContainer); }, false);
310 tryCompareFunction(function() { return isContainerAnimating(childContainer); }, false);
311+
312+ tryCompareFunction(function() { return sessionContainer.childSessions.count() }, 0);
313+ }
314+
315+ function test_childSessionsRemovedOnStopWhenNotLive() {
316+ sessionCheckbox.checked = true;
317+ var sessionContainer = sessionContainerLoader.item;
318+
319+ var session = ApplicationTest.addChildSession(sessionContainer.session,
320+ "gallery",
321+ false);
322+
323+ var delegate = findChild(sessionContainer, "childDelegate0");
324+ var childContainer = findChild(delegate, "sessionContainer");
325+
326+ ApplicationTest.removeSession(session);
327+
328+ tryCompareFunction(function() { return sessionContainer.childSessions.count() }, 0);
307 }
329 }
308 }
330 }
309}
331}
tests/qmltests/Stages/tst_WindowResizeArea.qml+225−30
@@ -28,7 +28,7 @@ import Unity.Application 0.1
28Item {
28Item {
29 id: root
29 id: root
30 height: units.gu(60)
30 height: units.gu(60)
31− width: units.gu(60)
31+ width: units.gu(85)
32
32
33 Binding {
33 Binding {
34 target: PanelState
34 target: PanelState
@@ -41,14 +41,20 @@ Item {
41
41
42 Item {
42 Item {
43 id: fakeWindow
43 id: fakeWindow
44− property alias minWidth: windowResizeArea.minWidth
44+ property alias resizeAreaMinWidth: windowResizeArea.minWidth
45− property alias minHeight: windowResizeArea.minHeight
45+ property alias resizeAreaMinHeight: windowResizeArea.minHeight
46 x: units.gu(20)
46 x: units.gu(20)
47 y: units.gu(20)
47 y: units.gu(20)
48 width: requestedWidth
48 width: requestedWidth
49 height: requestedHeight
49 height: requestedHeight
50 property real requestedWidth
50 property real requestedWidth
51 property real requestedHeight
51 property real requestedHeight
52+ property real minimumWidth: 0
53+ property real minimumHeight: 0
54+ property real maximumWidth: 0
55+ property real maximumHeight: 0
56+ property real widthIncrement: 0
57+ property real heightIncrement: 0
52 state: "normal"
58 state: "normal"
53
59
54 function maximize() {
60 function maximize() {
@@ -80,6 +86,10 @@ Item {
80 anchors.fill: parent
86 anchors.fill: parent
81 hoverEnabled: true
87 hoverEnabled: true
82 }
88 }
89+ Text {
90+ text: parent.width + "x" + parent.height
91+ color: "white"
92+ }
83 }
93 }
84 }
94 }
85 }
95 }
@@ -90,27 +100,107 @@ Item {
90 active: windowLoaderCheckbox.checked
100 active: windowLoaderCheckbox.checked
91 }
101 }
92
102
103+ Rectangle {
104+ anchors.right: parent.right
105+ anchors.top: parent.top
106+ anchors.bottom: parent.bottom
107+ width: units.gu(25)
108+ color: "lightgrey"
93− Column {
109+ Column {
110+ width: parent.width
111+ spacing: units.gu(1)
94− MouseTouchEmulationCheckbox {
112+ MouseTouchEmulationCheckbox {
95− checked: false
113+ checked: false
96− color: "black"
114+ color: "black"
97− }
115+ }
98− RowLayout {
116+ RowLayout {
99− Layout.fillWidth: true
117+ Layout.fillWidth: true
100− CheckBox {
118+ CheckBox {
101− id: windowLoaderCheckbox
119+ id: windowLoaderCheckbox
102− checked: true
120+ checked: true
103− activeFocusOnPress: false
121+ activeFocusOnPress: false
122+ }
123+ Label {
124+ color: "black"
125+ text: "Window loader active"
126+ anchors.verticalCenter: parent.verticalCenter
127+ }
104 }
128 }
105 Label {
129 Label {
106− id: label
130+ color: "black"; font.bold: true
131+ text: "Size Hints:"
132+ }
133+ SizeHintField { id: minWidthText; text: "min width" }
134+ SizeHintField { id: maxWidthText; text: "max width" }
135+ SizeHintField { id: minHeightText; text: "min height" }
136+ SizeHintField { id: maxHeightText; text: "max height" }
137+ SizeHintField { id: widthIncrText; text: "width incr" }
138+ SizeHintField { id: heightIncrText; text: "height incr" }
139+ Button {
107 color: "black"
140 color: "black"
108− text: "Window loader active"
141+ anchors.horizontalCenter: parent.horizontalCenter
109− anchors.verticalCenter: parent.verticalCenter
142+ text: "Apply"
143+ onClicked: {
144+ var value = parseInt(minWidthText.value);
145+ if (isNaN(value)) {
146+ windowLoader.item.minimumWidth = 0;
147+ } else {
148+ windowLoader.item.resizeAreaMinWidth = 1; // get it out of the way
149+ windowLoader.item.minimumWidth = value;
150+ }
151+
152+ value = parseInt(maxWidthText.value);
153+ if (isNaN(value)) {
154+ windowLoader.item.maximumWidth = 0;
155+ } else {
156+ windowLoader.item.maximumWidth = value;
157+ }
158+
159+ value = parseInt(minHeightText.value);
160+ if (isNaN(value)) {
161+ windowLoader.item.minimumHeight = 0;
162+ } else {
163+ windowLoader.item.resizeAreaMinHeight = 1; // get it out of the way
164+ windowLoader.item.minimumHeight = value;
165+ }
166+
167+ value = parseInt(maxHeightText.value);
168+ if (isNaN(value)) {
169+ windowLoader.item.maximumHeight = 0;
170+ } else {
171+ windowLoader.item.maximumHeight = value;
172+ }
173+
174+ value = parseInt(widthIncrText.value);
175+ if (isNaN(value)) {
176+ windowLoader.item.widthIncrement = 0;
177+ } else {
178+ windowLoader.item.widthIncrement = value;
179+ }
180+
181+ value = parseInt(heightIncrText.value);
182+ if (isNaN(value)) {
183+ windowLoader.item.heightIncrement = 0;
184+ } else {
185+ windowLoader.item.heightIncrement = value;
186+ }
187+ }
110 }
188 }
111 }
189 }
112 }
190 }
113
191
192+ SignalSpy {
193+ id: windowRequestedWidthSpy
194+ target: windowLoader.item
195+ signalName: "onRequestedWidthChanged"
196+ }
197+
198+ SignalSpy {
199+ id: windowRequestedHeightSpy
200+ target: windowLoader.item
201+ signalName: "onRequestedHeightChanged"
202+ }
203+
114 UnityTestCase {
204 UnityTestCase {
115 name: "WindowResizeArea"
205 name: "WindowResizeArea"
116 when: windowShown
206 when: windowShown
@@ -122,6 +212,18 @@ Item {
122 fakeWindow.y = units.gu(20)
212 fakeWindow.y = units.gu(20)
123 fakeWindow.requestedWidth = units.gu(20)
213 fakeWindow.requestedWidth = units.gu(20)
124 fakeWindow.requestedHeight = units.gu(20)
214 fakeWindow.requestedHeight = units.gu(20)
215+ fakeWindow.resizeAreaMinWidth = units.gu(15);
216+ fakeWindow.resizeAreaMinHeight = units.gu(10);
217+ fakeWindow.minimumWidth = 0;
218+ fakeWindow.minimumHeight = 0;
219+ fakeWindow.maximumWidth = 0;
220+ fakeWindow.maximumHeight = 0;
221+ fakeWindow.widthIncrement = 0;
222+ fakeWindow.heightIncrement = 0;
223+
224+ // Our test window resizes instantly
225+ compare(fakeWindow.width, fakeWindow.requestedWidth);
226+ compare(fakeWindow.height, fakeWindow.requestedHeight);
125 }
227 }
126
228
127 function test_resizeWindowRightBottom_data() {
229 function test_resizeWindowRightBottom_data() {
@@ -143,8 +245,8 @@ Item {
143 var startDragY = initialWindowY + initialWindowHeight + 1
245 var startDragY = initialWindowY + initialWindowHeight + 1
144 mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, true, units.gu(.5), 10);
246 mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, true, units.gu(.5), 10);
145
247
146− tryCompare(fakeWindow, "width", Math.max(initialWindowWidth + data.dx, fakeWindow.minWidth));
248+ tryCompare(fakeWindow, "width", Math.max(initialWindowWidth + data.dx, fakeWindow.resizeAreaMinWidth));
147− tryCompare(fakeWindow, "height", Math.max(initialWindowHeight + data.dy, fakeWindow.minHeight));
249+ tryCompare(fakeWindow, "height", Math.max(initialWindowHeight + data.dy, fakeWindow.resizeAreaMinHeight));
148
250
149 compare(fakeWindow.x, initialWindowX);
251 compare(fakeWindow.x, initialWindowX);
150 compare(fakeWindow.y, initialWindowY);
252 compare(fakeWindow.y, initialWindowY);
@@ -169,11 +271,11 @@ Item {
169 var startDragY = initialWindowY - 1
271 var startDragY = initialWindowY - 1
170 mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, true, units.gu(.5), 10);
272 mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, true, units.gu(.5), 10);
171
273
172− tryCompare(fakeWindow, "width", Math.max(initialWindowWidth - data.dx, fakeWindow.minWidth));
274+ tryCompare(fakeWindow, "width", Math.max(initialWindowWidth - data.dx, fakeWindow.resizeAreaMinWidth));
173− tryCompare(fakeWindow, "height", Math.max(initialWindowHeight - data.dy, fakeWindow.minHeight));
275+ tryCompare(fakeWindow, "height", Math.max(initialWindowHeight - data.dy, fakeWindow.resizeAreaMinHeight));
174
276
175− var maxMoveX = initialWindowWidth - fakeWindow.minWidth;
277+ var maxMoveX = initialWindowWidth - fakeWindow.resizeAreaMinWidth;
176− var maxMoveY = initialWindowHeight - fakeWindow.minHeight;
278+ var maxMoveY = initialWindowHeight - fakeWindow.resizeAreaMinHeight;
177 compare(fakeWindow.x, Math.min(initialWindowX + data.dx, initialWindowX + maxMoveX));
279 compare(fakeWindow.x, Math.min(initialWindowX + data.dx, initialWindowX + maxMoveX));
178 compare(fakeWindow.y, Math.min(initialWindowY + data.dy, initialWindowY + maxMoveY));
280 compare(fakeWindow.y, Math.min(initialWindowY + data.dy, initialWindowY + maxMoveY));
179 }
281 }
@@ -189,8 +291,8 @@ Item {
189 var startDragY = initialWindowY + initialWindowHeight + 1
291 var startDragY = initialWindowY + initialWindowHeight + 1
190 mouseFlick(root, startDragX, startDragY, startDragX + resizeDelta, startDragY + resizeDelta, true, true, units.gu(.5), 10);
292 mouseFlick(root, startDragX, startDragY, startDragX + resizeDelta, startDragY + resizeDelta, true, true, units.gu(.5), 10);
191
293
192− tryCompare(fakeWindow, "width", Math.max(initialWindowWidth + resizeDelta, fakeWindow.minWidth));
294+ tryCompare(fakeWindow, "width", Math.max(initialWindowWidth + resizeDelta, fakeWindow.resizeAreaMinWidth));
193− tryCompare(fakeWindow, "height", Math.max(initialWindowHeight + resizeDelta, fakeWindow.minHeight));
295+ tryCompare(fakeWindow, "height", Math.max(initialWindowHeight + resizeDelta, fakeWindow.resizeAreaMinHeight));
194
296
195 // This will destroy the window and recreate it
297 // This will destroy the window and recreate it
196 windowLoader.active = false;
298 windowLoader.active = false;
@@ -198,8 +300,8 @@ Item {
198 windowLoader.active = true;
300 windowLoader.active = true;
199
301
200 // Make sure its size is again the same as before
302 // Make sure its size is again the same as before
201− tryCompare(fakeWindow, "width", Math.max(initialWindowWidth + resizeDelta, fakeWindow.minWidth));
303+ tryCompare(fakeWindow, "width", Math.max(initialWindowWidth + resizeDelta, fakeWindow.resizeAreaMinWidth));
202− tryCompare(fakeWindow, "height", Math.max(initialWindowHeight + resizeDelta, fakeWindow.minHeight));
304+ tryCompare(fakeWindow, "height", Math.max(initialWindowHeight + resizeDelta, fakeWindow.resizeAreaMinHeight));
203 }
305 }
204
306
205 // This tests if dragging smaller than minSize and then larger again, will keep the edge sticking
307 // This tests if dragging smaller than minSize and then larger again, will keep the edge sticking
@@ -220,8 +322,8 @@ Item {
220 var startDragX = initialWindowX + data.startX
322 var startDragX = initialWindowX + data.startX
221 var startDragY = initialWindowY + data.startY
323 var startDragY = initialWindowY + data.startY
222 mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, false, units.gu(.05), 10);
324 mouseFlick(root, startDragX, startDragY, startDragX + data.dx, startDragY + data.dy, true, false, units.gu(.05), 10);
223− tryCompare(fakeWindow, "width", Math.max(initialWindowWidth - Math.abs(data.dx), fakeWindow.minWidth));
325+ tryCompare(fakeWindow, "width", Math.max(initialWindowWidth - Math.abs(data.dx), fakeWindow.resizeAreaMinWidth));
224− tryCompare(fakeWindow, "height", Math.max(initialWindowHeight - Math.abs(data.dy), fakeWindow.minHeight));
326+ tryCompare(fakeWindow, "height", Math.max(initialWindowHeight - Math.abs(data.dy), fakeWindow.resizeAreaMinHeight));
225 mouseFlick(root, startDragX + data.dx, startDragY + data.dy, startDragX, startDragY, false, true, units.gu(.05), 10);
327 mouseFlick(root, startDragX + data.dx, startDragY + data.dy, startDragX, startDragY, false, true, units.gu(.05), 10);
226 tryCompare(fakeWindow, "width", initialWindowWidth);
328 tryCompare(fakeWindow, "width", initialWindowWidth);
227 tryCompare(fakeWindow, "height", initialWindowHeight);
329 tryCompare(fakeWindow, "height", initialWindowHeight);
@@ -257,7 +359,6 @@ Item {
257 fakeWindow.state = "normal"
359 fakeWindow.state = "normal"
258 }
360 }
259
361
260−
261 function test_restoreMovesIntoBounds_data() {
362 function test_restoreMovesIntoBounds_data() {
262 return [
363 return [
263 {tag: "left off", x: -units.gu(5), y: units.gu(5), w: units.gu(10), h: units.gu(10)},
364 {tag: "left off", x: -units.gu(5), y: units.gu(5), w: units.gu(10), h: units.gu(10)},
@@ -290,5 +391,99 @@ Item {
290
391
291 waitForRendering(root)
392 waitForRendering(root)
292 }
393 }
394+
395+ /*
396+ Tests that even though you dragged the window bottom right corner continously (ie,
397+ through multiple intermediate steps), its (requested) width and height changed only
398+ once. And, furthermore, its dimensions increased by a multiple of its size (width
399+ and height) increment value.
400+ */
401+ function test_sizeIncrement() {
402+ var initialWindowX = fakeWindow.x;
403+ var initialWindowY = fakeWindow.y;
404+ var initialWindowWidth = fakeWindow.width
405+ var initialWindowHeight = fakeWindow.height
406+
407+ fakeWindow.widthIncrement = 70;
408+ fakeWindow.heightIncrement = 70;
409+
410+ var startDragX = initialWindowX + initialWindowWidth + 1
411+ var startDragY = initialWindowY + initialWindowHeight + 1
412+ var deltaX = 100;
413+ var deltaY = 100;
414+
415+ windowRequestedWidthSpy.clear();
416+ verify(windowRequestedWidthSpy.valid);
417+
418+ windowRequestedHeightSpy.clear();
419+ verify(windowRequestedHeightSpy.valid);
420+
421+ mouseFlick(root, startDragX, startDragY, startDragX + deltaX, startDragY + deltaY, true, true, units.gu(.5), 10);
422+
423+ compare(windowRequestedWidthSpy.count, 1);
424+ compare(fakeWindow.width, initialWindowWidth + fakeWindow.widthIncrement);
425+ compare(windowRequestedHeightSpy.count, 1);
426+ compare(fakeWindow.height, initialWindowHeight + fakeWindow.heightIncrement);
427+ }
428+
429+ /*
430+ Tests that when dragging a window border you cannot make it bigger than its maximum size
431+ */
432+ function test_maximumSize() {
433+ fakeWindow.x = units.gu(1);
434+ fakeWindow.y = units.gu(1);
435+ fakeWindow.resizeAreaMinWidth = 1; // so it does not interfere with anything
436+ fakeWindow.resizeAreaMinHeight = 1; // so it does not interfere with anything
437+ fakeWindow.requestedWidth = units.gu(10);
438+ fakeWindow.requestedHeight = units.gu(10);
439+
440+ fakeWindow.maximumWidth = units.gu(20);
441+ fakeWindow.maximumHeight = units.gu(20);
442+
443+ // Our test window resizes instantly
444+ compare(fakeWindow.width, fakeWindow.requestedWidth);
445+ compare(fakeWindow.height, fakeWindow.requestedHeight);
446+
447+ var startDragX = fakeWindow.width + 1
448+ var startDragY = fakeWindow.height + 1
449+ var endDragX = (fakeWindow.maximumWidth * 2) + 1;
450+ var endDragY = (fakeWindow.maximumHeight * 2) + 1;
451+
452+ mouseFlick(fakeWindow, startDragX, startDragY, endDragX, endDragY,
453+ true/*pressMouse*/, true/*releaseMouse*/, units.gu(.5)/*speed*/, 20/*iterations*/);
454+
455+ compare(fakeWindow.requestedWidth, fakeWindow.maximumWidth);
456+ compare(fakeWindow.requestedHeight, fakeWindow.maximumHeight);
457+ }
458+
459+ /*
460+ Tests that when dragging a window border you cannot make it smaller than its minimum size
461+ */
462+ function test_minimumSize() {
463+ fakeWindow.x = units.gu(1);
464+ fakeWindow.y = units.gu(1);
465+ fakeWindow.resizeAreaMinWidth = 1; // so it does not interfere with anything
466+ fakeWindow.resizeAreaMinHeight = 1; // so it does not interfere with anything
467+ fakeWindow.requestedWidth = units.gu(20);
468+ fakeWindow.requestedHeight = units.gu(20);
469+
470+ fakeWindow.minimumWidth = units.gu(10);
471+ fakeWindow.minimumHeight = units.gu(10);
472+
473+ // Our test window resizes instantly
474+ compare(fakeWindow.width, fakeWindow.requestedWidth);
475+ compare(fakeWindow.height, fakeWindow.requestedHeight);
476+
477+ var startDragX = fakeWindow.width + 1
478+ var startDragY = fakeWindow.height + 1
479+ var endDragX = (fakeWindow.minimumWidth * 0.5) + 1;
480+ var endDragY = (fakeWindow.minimumHeight * 0.5) + 1;
481+
482+ mouseFlick(fakeWindow, startDragX, startDragY, endDragX, endDragY,
483+ true/*pressMouse*/, true/*releaseMouse*/, units.gu(.5)/*speed*/, 20/*iterations*/);
484+
485+ compare(fakeWindow.requestedWidth, fakeWindow.minimumWidth);
486+ compare(fakeWindow.requestedHeight, fakeWindow.minimumHeight);
487+ }
293 }
488 }
294}
489}
tests/qmltests/tst_Shell.qml+53
@@ -49,6 +49,11 @@ Rectangle {
49 shellLoader.active = true;
49 shellLoader.active = true;
50 }
50 }
51
51
52+ MouseArea {
53+ id: clickThroughCatcher
54+ anchors.fill: shellContainer
55+ }
56+
52 Item {
57 Item {
53 id: shellContainer
58 id: shellContainer
54 anchors.left: root.left
59 anchors.left: root.left
@@ -291,6 +296,12 @@ Rectangle {
291 signalName: "applicationRemoved"
296 signalName: "applicationRemoved"
292 }
297 }
293
298
299+ SignalSpy {
300+ id: clickThroughSpy
301+ target: clickThroughCatcher
302+ signalName: "clicked"
303+ }
304+
294 Telephony.CallEntry {
305 Telephony.CallEntry {
295 id: phoneCall
306 id: phoneCall
296 phoneNumber: "+447812221111"
307 phoneNumber: "+447812221111"
@@ -1977,5 +1988,47 @@ Rectangle {
1977 compare(ApplicationManager.findApplication("libreoffice") === null, true);
1988 compare(ApplicationManager.findApplication("libreoffice") === null, true);
1978 }
1989 }
1979 }
1990 }
1991+
1992+ function test_inputEventsOnEdgesEndUpInAppSurface_data() {
1993+ return [
1994+ { tag: "phone", repeaterName: "spreadRepeater" },
1995+ { tag: "tablet", repeaterName: "spreadRepeater" },
1996+ { tag: "desktop", repeaterName: "appRepeater" },
1997+ ]
1998+ }
1999+
2000+ function test_inputEventsOnEdgesEndUpInAppSurface(data) {
2001+ loadShell(data.tag);
2002+ shell.usageScenario = data.tag;
2003+ waitForRendering(shell);
2004+ swipeAwayGreeter();
2005+
2006+ // Let's open a fullscreen app
2007+ var app = ApplicationManager.startApplication("camera-app");
2008+ waitUntilAppWindowIsFullyLoaded(app);
2009+
2010+ var appRepeater = findChild(shell, data.repeaterName);
2011+ var topmostAppDelegate = appRepeater.itemAt(0);
2012+ verify(topmostAppDelegate);
2013+
2014+ var topmostSurfaceItem = findChild(topmostAppDelegate, "surfaceItem");
2015+ verify(topmostSurfaceItem);
2016+
2017+ mouseClick(shell, 1, shell.height / 2);
2018+ compare(topmostSurfaceItem.mousePressCount, 1);
2019+ compare(topmostSurfaceItem.mouseReleaseCount, 1);
2020+
2021+ mouseClick(shell, shell.width - 1, shell.height / 2);
2022+ compare(topmostSurfaceItem.mousePressCount, 2);
2023+ compare(topmostSurfaceItem.mouseReleaseCount, 2);
2024+
2025+ tap(shell, 1, shell.height / 2);
2026+ compare(topmostSurfaceItem.touchPressCount, 1);
2027+ compare(topmostSurfaceItem.touchReleaseCount, 1);
2028+
2029+ tap(shell, shell.width - 1, shell.height / 2);
2030+ compare(topmostSurfaceItem.touchPressCount, 2);
2031+ compare(topmostSurfaceItem.touchReleaseCount, 2);
2032+ }
1980 }
2033 }
1981}
2034}