on xenial help sign in
Merge
0c8b85cAlbert Astals
po/es.po+1−1
@@ -15,7 +15,7 @@ msgstr ""
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: 2014-02-20 05:47+0000\n"
18+"X-Launchpad-Export-Date: 2014-02-21 06:42+0000\n"
19"X-Generator: Launchpad (build 16916)\n"
19"X-Generator: Launchpad (build 16916)\n"
20
20
21#: plugins/Unity/Launcher/launcheritem.cpp:43
21#: plugins/Unity/Launcher/launcheritem.cpp:43
qml/Components/ResponsiveGridView.qml−1
@@ -56,7 +56,6 @@ Item {
56 fill: parent
56 fill: parent
57 leftMargin: margin/2
57 leftMargin: margin/2
58 rightMargin: margin/2
58 rightMargin: margin/2
59− topMargin: verticalSpacing
60 }
59 }
61 clip: parent.height != totalContentHeight
60 clip: parent.height != totalContentHeight
62
61
qml/Components/Showable.qml+8
@@ -107,6 +107,9 @@ Item {
107 if (!hideAnimation.running) {
107 if (!hideAnimation.running) {
108 hideAnimation.restart()
108 hideAnimation.restart()
109 }
109 }
110+ if (__skipShowAnimation) {
111+ hideAnimation.complete();
112+ }
110 } else {
113 } else {
111 visible = false
114 visible = false
112 required = false
115 required = false
@@ -115,6 +118,11 @@ Item {
115 shown = false
118 shown = false
116 }
119 }
117
120
121+ function hideNow() {
122+ __skipShowAnimation = true;
123+ hide();
124+ }
125+
118 Connections {
126 Connections {
119 target: hideAnimation ? hideAnimation: null
127 target: hideAnimation ? hideAnimation: null
120 onRunningChanged: {
128 onRunningChanged: {
qml/Dash/Card.qml+2
@@ -161,6 +161,8 @@ AbstractButton {
161 title: cardData && cardData["title"] || ""
161 title: cardData && cardData["title"] || ""
162 subtitle: cardData && cardData["subtitle"] || ""
162 subtitle: cardData && cardData["subtitle"] || ""
163
163
164+ titleWeight: components && components["subtitle"] ? Font.DemiBold : Font.Normal
165+
164 opacity: showHeader ? 1 : 0
166 opacity: showHeader ? 1 : 0
165 inOverlay: root.template && root.template["overlay"] === true
167 inOverlay: root.template && root.template["overlay"] === true
166 fontColor: inOverlay ? "white" : summary.color
168 fontColor: inOverlay ? "white" : summary.color
qml/Dash/CardHeader.qml+2
@@ -26,6 +26,8 @@ Item {
26 property alias oldPrice: oldPriceLabel.text
26 property alias oldPrice: oldPriceLabel.text
27 property alias altPrice: altPriceLabel.text
27 property alias altPrice: altPriceLabel.text
28
28
29+ property alias titleWeight: titleLabel.font.weight
30+
29 // FIXME: Saviq, used to scale fonts down in Carousel
31 // FIXME: Saviq, used to scale fonts down in Carousel
30 property real fontScale: 1.0
32 property real fontScale: 1.0
31
33
qml/Dash/Dash.qml+2
@@ -41,6 +41,8 @@ Showable {
41 return
41 return
42 }
42 }
43
43
44+ dashContent.closePreview();
45+
44 if (scopeIndex == dashContent.currentIndex && !reset) {
46 if (scopeIndex == dashContent.currentIndex && !reset) {
45 // the scope is already the current one
47 // the scope is already the current one
46 return
48 return
qml/Dash/DashContent.qml+4
@@ -87,6 +87,10 @@ Item {
87 dashContentList.currentItem.theScope.closeScope(scope)
87 dashContentList.currentItem.theScope.closeScope(scope)
88 }
88 }
89
89
90+ function closePreview() {
91+ previewListView.open = false;
92+ }
93+
90 Item {
94 Item {
91 id: dashContentListHolder
95 id: dashContentListHolder
92 anchors.fill: parent
96 anchors.fill: parent
qml/Dash/GenericScopeView.qml+1
@@ -136,6 +136,7 @@ FocusScope {
136 id: baseItem
136 id: baseItem
137 objectName: "dashCategory" + category
137 objectName: "dashCategory" + category
138 highlightWhenPressed: false
138 highlightWhenPressed: false
139+ showDivider: false
139
140
140 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
141 readonly property bool expandable: rendererLoader.item ? rendererLoader.item.expandable : false
141 readonly property bool filtered: rendererLoader.item ? rendererLoader.item.filter : true
142 readonly property bool filtered: rendererLoader.item ? rendererLoader.item.filter : true
qml/Dash/PreviewListView.qml+25−29
@@ -109,43 +109,39 @@ Item {
109 }
109 }
110 }
110 }
111
111
112− delegate: Previews.Preview {
112+ delegate: Item {
113− id: preview
114− objectName: "preview" + index
115 height: previewListView.height
113 height: previewListView.height
116 width: previewListView.width
114 width: previewListView.width
117
115
116+ Previews.Preview {
117+ id: preview
118+ objectName: "preview" + index
119+ anchors.fill: parent
120+
118− isCurrent: ListView.isCurrentItem
121+ isCurrent: parent.ListView.isCurrentItem
119−
122+
120− onPreviewModelChanged: preview.opacity = 0;
121− onReadyChanged: if (ready) fadeIn.start()
122− previewModel: {
123+ previewModel: {
123− // TODO
124− // We need the isCurrent because the scope fails to
125− // deliver the preview if we ask for one after other very quickly
126− // If we remove the isCurrent, we will have to think another way of
127− // doing the fadeIn or just don't do it at all or just decide
128− // this code is good enough and remove the TODO
129− if (isCurrent) {
130 var previewStack = root.scope.preview(result);
124 var previewStack = root.scope.preview(result);
131 return previewStack.get(0);
125 return previewStack.get(0);
132− } else {
133− ready = false;
134− return null;
135 }
126 }
127+
128+ // onClose: {
129+ // previewListView.open = false
130+ // }
131+
136 }
132 }
137
133
138−// onClose: {
134+ MouseArea {
139−// previewListView.open = false
135+ id: processingMouseArea
140−// }
136+ objectName: "processingMouseArea"
141−
137+ anchors.fill: parent
142− PropertyAnimation {
138+ enabled: !preview.previewModel.loaded || preview.previewModel.processingAction
143− id: fadeIn
139+
144− target: preview
140+ ActivityIndicator {
145− property: "opacity"
141+ anchors.centerIn: parent
146− from: 0.0
142+ visible: root.onScreen && parent.enabled
147− to: 1.0
143+ running: visible
148− duration: UbuntuAnimation.BriskDuration
144+ }
149 }
145 }
150 }
146 }
151 }
147 }
qml/Dash/Previews/Preview.qml−13
@@ -36,9 +36,6 @@ Item {
36 //! \brief Should be set to true if this preview is currently displayed.
36 //! \brief Should be set to true if this preview is currently displayed.
37 property bool isCurrent: false
37 property bool isCurrent: false
38
38
39− //! \brief Will be changed to true when the initial preview widgets are in.
40− property bool ready: false
41−
42 clip: true
39 clip: true
43
40
44 Connections {
41 Connections {
@@ -52,8 +49,6 @@ Item {
52 }
49 }
53 }
50 }
54
51
55− onPreviewModelChanged: processingMouseArea.enabled = false
56−
57 Binding {
52 Binding {
58 target: previewModel
53 target: previewModel
59 property: "widgetColumnCount"
54 property: "widgetColumnCount"
@@ -84,7 +79,6 @@ Item {
84 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
79 bottomMargin: Qt.inputMethod.visible ? Qt.inputMethod.keyboardRectangle.height : 0
85
80
86 model: columnModel
81 model: columnModel
87− onCountChanged: if (count > 0) root.ready = true
88 cacheBuffer: height
82 cacheBuffer: height
89
83
90 Behavior on contentY { UbuntuNumberAnimation { } }
84 Behavior on contentY { UbuntuNumberAnimation { } }
@@ -113,11 +107,4 @@ Item {
113 }
107 }
114 }
108 }
115 }
109 }
116−
117− MouseArea {
118− id: processingMouseArea
119− objectName: "processingMouseArea"
120− anchors.fill: parent
121− enabled: false
122− }
123}
110}
qml/Dash/Previews/PreviewZoomableImage.qml+2−5
@@ -30,11 +30,8 @@ PreviewWidget {
30
30
31 LazyImage {
31 LazyImage {
32 objectName: "image"
32 objectName: "image"
33− anchors {
33+ anchors.fill: parent
34− top: parent.top
35− bottom: parent.bottom
36− }
37− scaleTo: "height"
34+ scaleTo: "fit"
38 source: widgetData["source"]
35 source: widgetData["source"]
39 initialWidth: units.gu(13)
36 initialWidth: units.gu(13)
40 }
37 }
qml/Greeter/Greeter.qml+4
@@ -67,6 +67,10 @@ Showable {
67
67
68 source: required ? "GreeterContent.qml" : ""
68 source: required ? "GreeterContent.qml" : ""
69
69
70+ onLoaded: {
71+ selected(currentIndex);
72+ }
73+
70 Connections {
74 Connections {
71 target: greeterContentLoader.item
75 target: greeterContentLoader.item
72
76
qml/Greeter/GreeterContent.qml−1
@@ -96,7 +96,6 @@ MouseArea {
96
96
97 onLoaded: {
97 onLoaded: {
98 item.currentIndex = greeterContentLoader.currentIndex;
98 item.currentIndex = greeterContentLoader.currentIndex;
99− selected(item.currentIndex);
100 item.resetAuthentication();
99 item.resetAuthentication();
101 }
100 }
102
101
qml/Shell.qml+105−62
@@ -83,8 +83,6 @@ FocusScope {
83 applicationManager.setSideStageAppRect(sideStageAppRect);
83 applicationManager.setSideStageAppRect(sideStageAppRect);
84 }
84 }
85
85
86− readonly property bool applicationFocused: !!applicationManager.mainStageFocusedApplication
87− || !!applicationManager.sideStageFocusedApplication
88 // Used for autopilot testing.
86 // Used for autopilot testing.
89 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
87 readonly property string currentFocusedAppId: ApplicationManager.focusedApplicationId
90
88
@@ -149,66 +147,94 @@ FocusScope {
149 // Whether the underlay is fully covered by opaque UI elements.
147 // Whether the underlay is fully covered by opaque UI elements.
150 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
148 property bool fullyCovered: panel.indicators.fullyOpened && shell.width <= panel.indicatorsMenuWidth
151
149
152− readonly property bool applicationRunning: ((mainStage.applications && mainStage.applications.count > 0)
150+ readonly property bool mainStageApplicationRunning: mainStage.applications && mainStage.applications.count > 0
153− || (sideStage.applications && sideStage.applications.count > 0))
151+ readonly property bool sideStageApplicationRunning: sideStage.applications && sideStage.applications.count > 0
154
152
155 // Whether the user should see the topmost application surface (if there's one at all).
153 // Whether the user should see the topmost application surface (if there's one at all).
156− readonly property bool applicationSurfaceShouldBeSeen: applicationRunning && !stages.fullyHidden
154+ readonly property bool mainStageApplicationShown: mainStageApplicationRunning && !stages.fullyHidden
157 && !mainStage.usingScreenshots // but want sideStage animating over app surface
155 && !mainStage.usingScreenshots // but want sideStage animating over app surface
158
156
159
157
160
158
161 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
159 // NB! Application surfaces are stacked behing the shell one. So they can only be seen by the user
162 // through the translucent parts of the shell surface.
160 // through the translucent parts of the shell surface.
163− visible: !fullyCovered && !applicationSurfaceShouldBeSeen
161+ visible: !fullyCovered && !mainStageApplicationShown
164−
162+
165− Rectangle {
163+ Item {
166− anchors.fill: parent
164+ id: underlayClipper
167− color: "black"
165+ clip: !parent.mainStageApplicationShown && parent.sideStageApplicationRunning && stagesOuterContainer.showProgress > 0
168− opacity: dash.disappearingAnimationProgress
166+ width: {
167+ if (clip) {
168+ var w = parent.width - sideStage.width
169+ w += stagesOuterContainer.x + stages.x + (sideStage.x - sideStageRevealer.openedValue)
170+ return Math.min(w, parent.width);
171+ } else {
172+ return parent.width;
173+ }
169− }
174+ }
175+ height: parent.height
170
176
171− Image {
177+ Image {
172− anchors.fill: dash
178+ anchors.fill: dash
173− source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
179+ source: shell.width > shell.height ? "Dash/graphics/paper_landscape.png" : "Dash/graphics/paper_portrait.png"
174− fillMode: Image.PreserveAspectCrop
180+ fillMode: Image.PreserveAspectCrop
175− horizontalAlignment: Image.AlignRight
181+ horizontalAlignment: Image.AlignRight
176− verticalAlignment: Image.AlignTop
182+ verticalAlignment: Image.AlignTop
183+ }
184+
185+ Dash {
186+ id: dash
187+ objectName: "dash"
188+
189+ available: !greeter.shown && !lockscreen.shown
190+ hides: [stages, launcher, panel.indicators]
191+ shown: disappearingAnimationProgress !== 1.0
192+ enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
193+ // FIXME: unfocus all applications when going back to the dash
194+ onEnabledChanged: {
195+ if (enabled) {
196+ shell.applicationManager.unfocusCurrentApplication()
197+ }
177− }
198+ }
178
199
179− Dash {
200+ width: underlay.width
180− id: dash
201+ height: underlay.height - y
181− objectName: "dash"
202+ y: panel.panelHeight
182−
203+
183− available: !greeter.shown && !lockscreen.shown
204+ contentScale: 1.0 - 0.2 * disappearingAnimationProgress
184− hides: [stages, launcher, panel.indicators]
205+ opacity: 1.0 - disappearingAnimationProgress
185− shown: disappearingAnimationProgress !== 1.0
206+ property real disappearingAnimationProgress: {
186− enabled: disappearingAnimationProgress === 0.0 && edgeDemo.dashEnabled
207+ if (greeter.shown) {
187− // FIXME: unfocus all applications when going back to the dash
208+ return greeter.showProgress;
188− onEnabledChanged: {
209+ } else {
189− if (enabled) {
210+ if (underlayClipper.clip)
190− shell.applicationManager.unfocusCurrentApplication()
211+ return 0;
212+ else
213+ return stagesOuterContainer.showProgress;
214+ }
191 }
215 }
216+
217+ // FIXME: only necessary because stagesOuterContainer.showProgress and
218+ // greeterRevealer.animatedProgress are not animated
219+ Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
192 }
220 }
193
221
194− anchors {
222+ Rectangle {
195− fill: parent
223+ width: underlay.width
196− topMargin: panel.panelHeight
224+ height: underlay.height
225+ color: "black"
226+ opacity: 0.5 * ((sideStage.x - sideStageRevealer.closedValue) / (sideStageRevealer.openedValue - sideStageRevealer.closedValue))
227+ visible: sideStageHideButton.enabled
197 }
228 }
198
229
199− contentScale: 1.0 - 0.2 * disappearingAnimationProgress
230+ AbstractButton {
200− opacity: 1.0 - disappearingAnimationProgress
231+ id: sideStageHideButton
201− property real disappearingAnimationProgress: {
232+ enabled: mainStage.applications.count == 0 && sideStage.shown
202− if (greeter.shown) {
233+ anchors.fill: parent
203− return greeter.showProgress;
234+ onClicked: {
204− } else {
235+ sideStage.hide();
205− return stagesOuterContainer.showProgress;
206 }
236 }
207 }
237 }
208−
209− // FIXME: only necessary because stagesOuterContainer.showProgress and
210− // greeterRevealer.animatedProgress are not animated
211− Behavior on disappearingAnimationProgress { SmoothedAnimation { velocity: 5 }}
212 }
238 }
213 }
239 }
214
240
@@ -217,7 +243,7 @@ FocusScope {
217
243
218 width: parent.width
244 width: parent.width
219 height: parent.height
245 height: parent.height
220− x: launcher.progress
246+ x: mainStage.applications.count > 0 ? launcher.progress : 0
221 Behavior on x {SmoothedAnimation{velocity: 600}}
247 Behavior on x {SmoothedAnimation{velocity: 600}}
222
248
223 property real showProgress:
249 property real showProgress:
@@ -229,6 +255,16 @@ FocusScope {
229
255
230 x: width
256 x: width
231
257
258+ function doLauncherHide() {
259+ if (mainStage.applications.count > 0) {
260+ hide();
261+ } else {
262+ if (sideStage.shown) {
263+ sideStage.hide();
264+ }
265+ }
266+ }
267+
232 property bool fullyShown: shown && x == 0 && parent.x == 0
268 property bool fullyShown: shown && x == 0 && parent.x == 0
233 property bool fullyHidden: !shown && x == width
269 property bool fullyHidden: !shown && x == width
234 available: !greeter.shown
270 available: !greeter.shown
@@ -313,11 +349,6 @@ FocusScope {
313 rightEdgeDraggingAreaWidth: shell.edgeSize
349 rightEdgeDraggingAreaWidth: shell.edgeSize
314 normalApplicationY: shell.panelHeight
350 normalApplicationY: shell.panelHeight
315
351
316− onShownChanged: {
317− if (!shown && mainStage.applications.count == 0) {
318− stages.hide();
319− }
320− }
321 // FIXME: when hiding the side stage, refocus the main stage
352 // FIXME: when hiding the side stage, refocus the main stage
322 // application so that it goes in front of the side stage
353 // application so that it goes in front of the side stage
323 // application and hides it
354 // application and hides it
@@ -346,8 +377,16 @@ FocusScope {
346 Connections {
377 Connections {
347 target: sideStage.applications
378 target: sideStage.applications
348 onCountChanged: {
379 onCountChanged: {
380+ if (sideStage.applications.count == 0) {
349− if (sideStage.applications.count == 0 && sideStage.shown) { // if all SS app closed, hide side stage
381+ if (sideStage.shown) { // if all SS app closed, hide side stage
350− sideStage.hide();
382+ sideStage.hide();
383+ } else {
384+ // Sidestage is hidden and there is no main app, make sure the
385+ // stages is totally hidden too
386+ if (mainStage.applications.count == 0) {
387+ stages.hideNow();
388+ }
389+ }
351 }
390 }
352 }
391 }
353 }
392 }
@@ -356,7 +395,7 @@ FocusScope {
356 Revealer {
395 Revealer {
357 id: sideStageRevealer
396 id: sideStageRevealer
358
397
359− enabled: mainStage.applications.count > 0 && sideStage.applications.count > 0
398+ enabled: sideStage.applications.count > 0
360 && sideStage.available
399 && sideStage.available
361 direction: Qt.RightToLeft
400 direction: Qt.RightToLeft
362 openedValue: parent.width - sideStage.width
401 openedValue: parent.width - sideStage.width
@@ -437,7 +476,6 @@ FocusScope {
437 Component.onCompleted: {
476 Component.onCompleted: {
438 if (LightDM.Users.count == 1) {
477 if (LightDM.Users.count == 1) {
439 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
478 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole))
440− greeter.selected(0)
441 }
479 }
442 }
480 }
443 }
481 }
@@ -478,7 +516,7 @@ FocusScope {
478 hides: [launcher, panel.indicators, hud]
516 hides: [launcher, panel.indicators, hud]
479 shown: true
517 shown: true
480
518
481− defaultBackground: shell.background
519+ defaultBackground: shell.defaultBackground
482
520
483 y: panel.panelHeight
521 y: panel.panelHeight
484 width: parent.width
522 width: parent.width
@@ -515,7 +553,6 @@ FocusScope {
515 // If there are more users, the Greeter will handle that
553 // If there are more users, the Greeter will handle that
516 if (LightDM.Users.count == 1) {
554 if (LightDM.Users.count == 1) {
517 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
555 LightDM.Greeter.authenticate(LightDM.Users.data(0, LightDM.UserRoles.NameRole));
518− greeter.selected(0);
519 }
556 }
520 greeter.forceActiveFocus();
557 greeter.forceActiveFocus();
521 removeApplicationFocus();
558 removeApplicationFocus();
@@ -563,8 +600,14 @@ FocusScope {
563 }
600 }
564
601
565 InputFilterArea {
602 InputFilterArea {
566− anchors.fill: parent
603+ width: {
604+ if (applicationManager.sideStageFocusedApplication && sideStage.shown)
605+ return parent.width - sideStage.width;
606+ else
607+ return parent.width;
608+ }
609+ height: parent.height
567− blockInput: !applicationFocused || greeter.shown || lockscreen.shown || launcher.shown
610+ blockInput: !applicationManager.mainStageFocusedApplication || greeter.shown || lockscreen.shown || launcher.shown
568 || panel.indicators.shown || hud.shown
611 || panel.indicators.shown || hud.shown
569 }
612 }
570
613
@@ -666,7 +709,7 @@ FocusScope {
666 theHud: hud
709 theHud: hud
667 anchors.fill: parent
710 anchors.fill: parent
668 enabled: hud.available
711 enabled: hud.available
669− applicationIsOnForeground: applicationFocused
712+ applicationIsOnForeground: (stages.shown && mainStage.applications.count > 0) || (stages.shown && sideStage.shown)
670 }
713 }
671
714
672 InputFilterArea {
715 InputFilterArea {
@@ -688,7 +731,7 @@ FocusScope {
688 anchors.bottom: parent.bottom
731 anchors.bottom: parent.bottom
689 width: parent.width
732 width: parent.width
690 dragAreaWidth: shell.edgeSize
733 dragAreaWidth: shell.edgeSize
691− available: (!greeter.shown || greeter.narrowMode) && edgeDemo.launcherEnabled
734+ available: !greeter.locked && edgeDemo.launcherEnabled
692
735
693 onShowDashHome: {
736 onShowDashHome: {
694 if (edgeDemo.running)
737 if (edgeDemo.running)
@@ -698,7 +741,7 @@ FocusScope {
698 }
741 }
699 onDash: {
742 onDash: {
700 if (stages.shown) {
743 if (stages.shown) {
701− stages.hide();
744+ stages.doLauncherHide();
702 launcher.hide();
745 launcher.hide();
703 }
746 }
704 }
747 }
tests/mocks/AccountsService/AccountsService.cpp+1−1
@@ -20,7 +20,7 @@
20
20
21AccountsService::AccountsService(QObject* parent)
21AccountsService::AccountsService(QObject* parent)
22 : QObject(parent),
22 : QObject(parent),
23− m_backgroundFile(TOP_SRCDIR "/graphics/phone_background.jpg"),
23+ m_backgroundFile(TOP_SRCDIR "/qml/graphics/phone_background.jpg"),
24 m_statsWelcomeScreen(true)
24 m_statsWelcomeScreen(true)
25{
25{
26}
26}
tests/qmltests/Dash/tst_Card.qml+14
@@ -182,6 +182,7 @@ Rectangle {
182 when: windowShown
182 when: windowShown
183
183
184 property Item header: findChild(card, "cardHeader")
184 property Item header: findChild(card, "cardHeader")
185+ property Item title: findChild(header, "titleLabel")
185 property Item art: findChild(card, "artShape")
186 property Item art: findChild(card, "artShape")
186 property Item artImage: findChild(card, "artImage")
187 property Item artImage: findChild(card, "artImage")
187 property Item summary: findChild(card, "summaryLabel")
188 property Item summary: findChild(card, "summaryLabel")
@@ -413,5 +414,18 @@ Rectangle {
413 tryCompare(backgroundImage, "source", data.image);
414 tryCompare(backgroundImage, "source", data.image);
414 }
415 }
415 }
416 }
417+
418+ function test_font_weights_data() {
419+ return [
420+ { tag: "Title only", index: 8, weight: Font.Normal },
421+ { tag: "Title, subtitle", index: 0, weight: Font.DemiBold },
422+ ]
423+ }
424+
425+ function test_font_weights(data) {
426+ selector.selectedIndex = data.index;
427+
428+ tryCompare(testCase.title.font, "weight", data.weight);
429+ }
416 }
430 }
417}
431}
tests/qmltests/Greeter/tst_Phone.qml+19
@@ -44,6 +44,17 @@ Item {
44 }
44 }
45 }
45 }
46
46
47+ Component {
48+ id: greeterComponent
49+ Greeter {
50+ SignalSpy {
51+ objectName: "selectedSpy"
52+ target: parent
53+ signalName: "selected"
54+ }
55+ }
56+ }
57+
47 SignalSpy {
58 SignalSpy {
48 id: unlockSpy
59 id: unlockSpy
49 target: greeter
60 target: greeter
@@ -148,5 +159,13 @@ Item {
148 tryCompareFunction(function() { return background.source.toString().indexOf(data.expected) !== -1; }, true)
159 tryCompareFunction(function() { return background.source.toString().indexOf(data.expected) !== -1; }, true)
149 tryCompare(background, "status", Image.Ready)
160 tryCompare(background, "status", Image.Ready)
150 }
161 }
162+
163+ function test_initial_selected_signal() {
164+ var greeterObj = greeterComponent.createObject(this)
165+ var spy = findChild(greeterObj, "selectedSpy")
166+ spy.wait()
167+ tryCompare(spy, "count", 1)
168+ greeterObj.destroy()
169+ }
151 }
170 }
152}
171}
tests/qmltests/Greeter/tst_Tablet.qml+19
@@ -31,6 +31,17 @@ Item {
31 anchors.fill: parent
31 anchors.fill: parent
32 }
32 }
33
33
34+ Component {
35+ id: greeterComponent
36+ Greeter {
37+ SignalSpy {
38+ objectName: "selectedSpy"
39+ target: parent
40+ signalName: "selected"
41+ }
42+ }
43+ }
44+
34 SignalSpy {
45 SignalSpy {
35 id: unlockSpy
46 id: unlockSpy
36 target: greeter
47 target: greeter
@@ -335,5 +346,13 @@ Item {
335 var userlist = findChild(greeter, "userList")
346 var userlist = findChild(greeter, "userList")
336 compare(greeter.model.data(userlist.currentIndex, LightDM.UserRoles.NameRole), "has-password")
347 compare(greeter.model.data(userlist.currentIndex, LightDM.UserRoles.NameRole), "has-password")
337 }
348 }
349+
350+ function test_initial_selected_signal() {
351+ var greeterObj = greeterComponent.createObject(this)
352+ var spy = findChild(greeterObj, "selectedSpy")
353+ spy.wait()
354+ tryCompare(spy, "count", 1)
355+ greeterObj.destroy()
356+ }
338 }
357 }
339}
358}