on xenial help sign in
Make it easier to use the Lockscreen component from the welcome wizard.

Approved by: Albert Astals Cid

commit5367c4f63bcf144f6470209643dbe7f90bf9c732 authorMichael Terry <michael.terry@canonical.com> dateTue 30 Sep 2014, 16:56 (12 years ago) parenta281d950fc2b58
3 files changed+31−10
qml/Components/Lockscreen.qml+14−9 qml/Components/PinLockscreen.qml+3 qml/Shell.qml+14−1
qml/Components/Lockscreen.qml+14−9
@@ -24,6 +24,12 @@ Showable {
2424 // Determine if a numeric or alphanumeric pad is used.
2525 property bool alphaNumeric: false
2626
27+ // Whether to show an emergency call button
28+ property bool showEmergencyCallButton: true
29+
30+ // Whether to show a cancel button (not all lockscreen types normally do anyway)
31+ property bool showCancelButton: true
32+
2733 // Informational text. (e.g. some text to tell which domain this is pin is entered for)
2834 property string infoText: ""
2935
@@ -76,10 +82,11 @@ Showable {
7682 }
7783
7884 Rectangle {
79− // In case background fails to load or is undefined
85+ // In case background fails to load
8086 id: backgroundBackup
8187 anchors.fill: parent
8288 color: "black"
89+ visible: root.background.toString() !== ""
8390 }
8491
8592 Image {
@@ -184,19 +191,17 @@ Showable {
184191 value: root.delayMinutes
185192 }
186193 }
194+ Binding {
195+ target: pinPadLoader.item
196+ property: "showCancelButton"
197+ value: root.showCancelButton
198+ }
187199 }
188200
189201 Item {
190202 id: emergencyCallRow
191203
192− // FIXME: We *should* show emergency dialer if there is a SIM present,
193− // regardless of whether the side stage is enabled. But right now,
194− // the assumption is that narrow screens are phones which have SIMs
195− // and wider screens are tablets which don't. When we do allow this
196− // on devices with a side stage and a SIM, work should be done to
197− // ensure that the main stage is disabled while the dialer is present
198− // in the side stage.
199− visible: !shell.sideStageEnabled
204+ visible: showEmergencyCallButton
200205
201206 anchors {
202207 bottom: parent.bottom
qml/Components/PinLockscreen.qml+3
@@ -33,6 +33,7 @@ Column {
3333 property int padHeight: units.gu(28)
3434 property int minPinLength: -1
3535 property int maxPinLength: -1
36+ property bool showCancelButton: true
3637
3738 signal entered(string passphrase)
3839 signal cancel()
@@ -110,6 +111,7 @@ Column {
110111 fontSize: "x-large"
111112 color: "#f3f3e7"
112113 anchors.horizontalCenter: parent.horizontalCenter
114+ horizontalAlignment: Text.AlignHCenter
113115 text: root.errorText
114116 visible: pinentryField.incorrectOverride
115117 }
@@ -199,6 +201,7 @@ Column {
199201 width: numbersGrid.buttonWidth
200202
201203 onClicked: root.cancel()
204+ visible: root.showCancelButton
202205 }
203206 Item {
204207 height: units.gu(5)
qml/Shell.qml+14−1
@@ -292,6 +292,15 @@ Item {
292292 minPinLength: 4
293293 maxPinLength: 4
294294
295+ // FIXME: We *should* show emergency dialer if there is a SIM present,
296+ // regardless of whether the side stage is enabled. But right now,
297+ // the assumption is that narrow screens are phones which have SIMs
298+ // and wider screens are tablets which don't. When we do allow this
299+ // on devices with a side stage and a SIM, work should be done to
300+ // ensure that the main stage is disabled while the dialer is present
301+ // in the side stage.
302+ showEmergencyCallButton: !shell.sideStageEnabled
303+
295304 onEntered: LightDM.Greeter.respond(passphrase);
296305 onCancel: greeter.show()
297306 onEmergencyCall: shell.activateApplication("dialer-app") // will automatically enter fake-active mode
@@ -588,7 +597,11 @@ Item {
588597 available: edgeDemo.launcherEnabled && (!shell.locked || AccountsService.enableLauncherWhileLocked) && greeter.fakeActiveForApp === ""
589598
590599 onShowDashHome: showHome()
591− onDash: showDash()
600+ onDash: {
601+ if (ApplicationManager.focusedApplicationId != "unity8-dash") {
602+ showDash()
603+ }
604+ }
592605 onDashSwipeChanged: {
593606 if (dashSwipe) {
594607 dash.setCurrentScope("clickscope", false, true)