on xenial help sign in
Fix infographics

- Don't show infographics if space is not enough - Show infographics on cover for single user tablets See: https://github.com/ubports/unity8/issues/419#issuecomment-1013924494 https://github.com/ubports/unity8/issues/422

commita8fa08337e0a829b17c625b4cc4e5036235b9fbd authorCapsia <cmsuser3754@zoho.eu> dateSat 29 Jan 2022, 23:59 (5 years ago) parent9fdc9f8
3 files changed+21−14
qml/Greeter/CoverPage.qml+17−10 qml/Greeter/GreeterView.qml+2−2 tests/qmltests/Greeter/tst_GreeterView.qml+2−2
qml/Greeter/CoverPage.qml+17−10
@@ -34,7 +34,7 @@ Showable {
3434 property var infographicModel
3535 property bool draggable: true
3636
37− property alias showInfographic: infographicsLoader.active
37+ property bool showInfographic: false
3838 property real infographicsLeftMargin: 0
3939 property real infographicsTopMargin: 0
4040 property real infographicsRightMargin: 0
@@ -108,15 +108,8 @@ Showable {
108108 visible: false
109109 }
110110
111− Loader {
112− id: infographicsLoader
113− objectName: "infographicsLoader"
114− sourceComponent:Infographics {
115− id: infographics
116− objectName: "infographics"
117− model: root.infographicModel
118− clip: true // clip large data bubbles
119− }
111+ Item {
112+ id: infographicsArea
120113
121114 anchors {
122115 leftMargin: root.infographicsLeftMargin
@@ -130,6 +123,20 @@ Showable {
130123 }
131124 }
132125
126+ Loader {
127+ id: infographicsLoader
128+ objectName: "infographicsLoader"
129+ active: root.showInfographic && infographicsArea.width > units.gu(32)
130+ anchors.fill: infographicsArea
131+
132+ sourceComponent:Infographics {
133+ id: infographics
134+ objectName: "infographics"
135+ model: root.infographicModel
136+ clip: true // clip large data bubbles
137+ }
138+ }
139+
133140 Label {
134141 id: swipeHint
135142 objectName: "swipeHint"
qml/Greeter/GreeterView.qml+2−2
@@ -138,7 +138,7 @@ FocusScope {
138138 hasCustomBackground: root.hasCustomBackground
139139 backgroundShadeOpacity: 0.6
140140
141− showInfographic: root.usageMode != "phone" && isLandscape && !delayedLockscreen.visible
141+ showInfographic: isLandscape && root.usageMode != "phone" && (root.usageMode != "tablet" || root.multiUser) && !delayedLockscreen.visible
142142 infographicModel: root.infographicModel
143143
144144 shown: false
@@ -355,7 +355,7 @@ FocusScope {
355355 backgroundSourceSize: root.backgroundSourceSize
356356 infographicModel: root.infographicModel
357357
358− showInfographic: !root.multiUser && (!isLandscape || root.usageMode == "phone")
358+ showInfographic: !root.multiUser && root.usageMode != "desktop"
359359
360360 onShowProgressChanged: {
361361 if (showProgress === 0) {
tests/qmltests/Greeter/tst_GreeterView.qml+2−2
@@ -1295,8 +1295,8 @@ StyledItem {
12951295 multiUser: false,
12961296 usageMode: "tablet",
12971297 orientation: Qt.LandscapeOrientation,
1298− coverPage: false,
1299− lockscreen: true
1298+ coverPage: true,
1299+ lockscreen: false
13001300 },
13011301 {
13021302 tag: "tablet-landscape-multiuser",