18 import Ubuntu.Components 0.1
19 import
"../Components"
25 property bool alphaNumeric:
false
28 property string placeholderText:
""
31 property string username:
""
35 property int pinLength: -1
37 property url background:
""
39 signal entered(
string passphrase)
41 signal emergencyCall()
44 if (required && pinPadLoader.item) {
45 pinPadLoader.item.clear(
false);
51 pinPadLoader.resetting =
true;
52 pinPadLoader.resetting =
false;
55 function clear(showAnimation) {
56 pinPadLoader.item.clear(showAnimation);
68 objectName:
"lockscreenBackground"
71 topMargin: backgroundTopMargin
73 source: root.required ? root.background :
""
74 fillMode: Image.PreserveAspectCrop
83 objectName:
"pinPadLoader"
87 verticalCenter: parent.verticalCenter
88 verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : -units.gu(4)
90 property bool resetting:
false
92 source: (!resetting && root.required) ? (root.alphaNumeric ?
"PassphraseLockscreen.qml" :
"PinLockscreen.qml") :
""
95 target: pinPadLoader.item
98 root.entered(passphrase);
107 target: pinPadLoader.item
108 property:
"pinLength"
109 value: root.pinLength
112 target: pinPadLoader.item
113 property:
"placeholderText"
114 value: root.placeholderText
117 target: pinPadLoader.item
126 bottom: parent.bottom
127 bottomMargin: units.gu(4)
130 height: childrenRect.height
134 objectName:
"emergencyCallIcon"
137 anchors.horizontalCenter: parent.horizontalCenter
138 name:
"phone-app-call-symbolic"
144 onClicked: root.emergencyCall()
149 text: i18n.tr(
"Emergency Call")
153 anchors.horizontalCenter: parent.horizontalCenter