on xenial help sign in
Handle 0 sessions better
78b9a2fJosh Arenson
qml/Greeter/SessionsList.qml+6−2
@@ -45,8 +45,12 @@ Item {
45 LoginAreaContainer {
45 LoginAreaContainer {
46 readonly property real margins: sessionsList.anchors.margins
46 readonly property real margins: sessionsList.anchors.margins
47 readonly property real prefferedHeight: {
47 readonly property real prefferedHeight: {
48+ if (sessionsList.currentItem) {
48− ((sessionsList.currentItem.height + margins) * sessionsList.model.count) +
49+ return ((sessionsList.currentItem.height + margins) *
50+ sessionsList.model.count) + sessionsList.headerItem.height + margins
51+ } else {
49− sessionsList.headerItem.height + margins
52+ return sessionsList.headerItem.height + margins
53+ }
50 }
54 }
51
55
52 height: prefferedHeight < parent.height ? prefferedHeight : parent.height - units.gu(4)
56 height: prefferedHeight < parent.height ? prefferedHeight : parent.height - units.gu(4)
tests/qmltests/Greeter/tst_WideView.qml+1−4
@@ -25,8 +25,6 @@ import Unity.Test 0.1 as UT
25StyledItem {
25StyledItem {
26 id: root
26 id: root
27
27
28− property int numSessions: LightDM.Sessions.numSessions
29−
30 width: units.gu(120)
28 width: units.gu(120)
31 height: units.gu(80)
29 height: units.gu(80)
32
30
@@ -281,14 +279,13 @@ StyledItem {
281 }
279 }
282 }
280 }
283 Row {
281 Row {
284− id: numSessions
285 Slider {
282 Slider {
286 id: numSessionsSlider
283 id: numSessionsSlider
287
284
288 width: units.gu(10)
285 width: units.gu(10)
289 minimumValue: 0
286 minimumValue: 0
290 maximumValue: LightDM.Sessions.numAvailableSessions
287 maximumValue: LightDM.Sessions.numAvailableSessions
291− value: root.numSessions
288+ value: LightDM.Sessions.numSessions
292 visible: LightDM.Sessions.testScenario === "multipleSessions"
289 visible: LightDM.Sessions.testScenario === "multipleSessions"
293 Binding {
290 Binding {
294 target: LightDM.Sessions
291 target: LightDM.Sessions