on xenial help sign in
reworked lockscreens as per new design
commit650f3063f8e3bfab21e9e45d4e5e06cbcbc47432 authorMichael Zanetti <michael.zanetti@canonical.com> dateTue 30 Jul 2013, 12:15 (13 years ago) parentba5eb2f
3 files changed+98−42
Greeter/Lockscreen.qml+7−9 Greeter/PinLockscreen.qml+86−17 Greeter/PinPadButton.qml+5−16
Greeter/Lockscreen.qml+7−9
@@ -69,7 +69,7 @@ Showable {
6969 left: parent.left
7070 right: parent.right
7171 verticalCenter: parent.verticalCenter
72− verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : 0
72+ verticalCenterOffset: root.alphaNumeric ? -units.gu(10) : -units.gu(4)
7373 }
7474 property bool resetting: false
7575
@@ -107,11 +107,11 @@ Showable {
107107 Column {
108108 anchors {
109109 left: parent.left
110− top: pinPadLoader.bottom
111− topMargin: units.gu(4)
112− right: parent.right
113110 bottom: parent.bottom
111+ bottomMargin: units.gu(4)
112+ right: parent.right
114113 }
114+ height: childrenRect.height
115115 spacing: units.gu(1)
116116
117117 Icon {
@@ -120,8 +120,7 @@ Showable {
120120 width: height
121121 anchors.horizontalCenter: parent.horizontalCenter
122122 name: "phone-app-call-symbolic"
123− color: "white"
124− opacity: 0.9
123+ color: "#f3f3e7"
125124
126125 MouseArea {
127126 anchors.fill: parent
@@ -130,9 +129,8 @@ Showable {
130129 }
131130
132131 Label {
133− text: i18n.tr("Emergency call")
134− color: "white"
135− opacity: 0.9
132+ text: i18n.tr("Emergency Call")
133+ color: "#f3f3e7"
136134 fontSize: "medium"
137135 anchors.horizontalCenter: parent.horizontalCenter
138136 }
Greeter/PinLockscreen.qml+86−17
@@ -16,15 +16,17 @@
1616
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
19+import Ubuntu.Components.ListItems 0.1
1920import "../Components"
2021
2122Column {
2223 id: root
2324 anchors.centerIn: parent
24− spacing: units.gu(2.5)
25+ spacing: units.gu(3.5)
2526
2627 property alias placeholderText: pinentryField.placeholderText
27− property int padWidth: units.gu(32)
28+ property int padWidth: units.gu(34)
29+ property int padHeight: units.gu(28)
2830 property int pinLength: 4
2931
3032 signal entered(string passphrase)
@@ -37,31 +39,89 @@ Column {
3739 }
3840 }
3941
40− TextField {
42+
43+ UbuntuShape {
4144 id: pinentryField
4245 objectName: "pinentryField"
4346 anchors.horizontalCenter: parent.horizontalCenter
44− width: units.gu(32)
47+ color: "#55000000"
48+ width:root.padWidth
4549 height: units.gu(5)
46− echoMode: TextInput.Password
47− font.pixelSize: units.dp(44)
48− color: "white"
49− opacity: 0.9
50− hasClearButton: false
51− horizontalAlignment: Text.AlignHCenter
52−
50+ radius: "medium"
51+ property string text: ""
52+ property string placeholderText: ""
5353 onTextChanged: {
54− if (pinentryField.text.length === root.pinLength) {
55− root.entered(pinentryField.text);
54+ pinentryFieldLabel.text = "";
55+ for (var i = 0; i < text.length; ++i) {
56+ pinentryFieldLabel.text += "•"
57+ }
58+ if (text.length === root.pinLength) {
59+ root.entered(text);
5660 }
5761 }
5862
59− // Using a MouseArea to eat clicks. We don't want to disable the TextField for styling reasons
60− MouseArea {
61− anchors.fill: parent
63+ Label {
64+ id: pinentryFieldLabel
65+ anchors.centerIn: parent
66+ font.pixelSize: units.dp(44)
67+ color: "#f3f3e7"
68+ }
69+ Label {
70+ id: pinentryFieldPlaceHolder
71+ anchors.centerIn: parent
72+ color: "grey"
73+ text: parent.placeholderText
74+ visible: pinentryFieldLabel.text.length == 0
6275 }
6376 }
6477
78+ UbuntuShape {
79+ anchors {
80+ left: parent.left
81+ right: parent.right
82+ margins: (parent.width - root.padWidth) / 2
83+ }
84+ height: root.padHeight
85+ color: "#55000000"
86+ radius: "medium"
87+
88+ ThinDivider {
89+ anchors {
90+ left: parent.left
91+ right: parent.right
92+ top: parent.top
93+ topMargin: root.padHeight / 4
94+ }
95+ }
96+ ThinDivider {
97+ anchors {
98+ left: parent.left
99+ right: parent.right
100+ verticalCenter: parent.verticalCenter
101+ }
102+ }
103+ ThinDivider {
104+ anchors {
105+ left: parent.left
106+ right: parent.right
107+ bottom: parent.bottom
108+ bottomMargin: root.padHeight / 4
109+ }
110+ }
111+
112+ ThinDivider {
113+ anchors.centerIn: parent
114+ anchors.horizontalCenterOffset: -root.padWidth / 6
115+ width: root.padHeight
116+ rotation: -90
117+ }
118+ ThinDivider {
119+ anchors.centerIn: parent
120+ anchors.horizontalCenterOffset: root.padWidth / 6
121+ width: root.padHeight
122+ rotation: -90
123+ }
124+
65125 Grid {
66126 anchors {
67127 left: parent.left
@@ -70,13 +130,14 @@ Column {
70130 }
71131
72132 columns: 3
73− spacing: units.gu(1)
74133
75134 Repeater {
76135 model: 9
77136
78137 PinPadButton {
79138 objectName: "pinPadButton" + (index + 1)
139+ width: root.padWidth / 3
140+ height: root.padHeight / 4
80141 text: index + 1
81142
82143 onClicked: {
@@ -87,23 +148,31 @@ Column {
87148
88149 PinPadButton {
89150 objectName: "pinPadButtonBack"
151+ width: root.padWidth / 3
152+ height: root.padHeight / 4
90153 iconName: "back"
91154 onClicked: root.cancel();
92155
93156 }
94157 PinPadButton {
95158 objectName: "pinPadButton0"
159+ width: root.padWidth / 3
160+ height: root.padHeight / 4
96161 text: "0"
97162 onClicked: pinentryField.text = pinentryField.text + text
98163
99164 }
100165 PinPadButton {
101166 objectName: "pinPadButtonErase"
167+ width: root.padWidth / 3
168+ height: root.padHeight / 4
102169 iconName: "erase"
103170 onClicked: pinentryField.text = pinentryField.text.substring(0, pinentryField.text.length-1)
104171 }
105172 }
106173
174+ }
175+
107176 WrongPasswordAnimation {
108177 id: wrongPasswordAnimation
109178 target: pinentryField
Greeter/PinPadButton.qml+5−16
@@ -17,28 +17,20 @@
1717import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919
20−UbuntuShape {
20+Item {
2121 id: root
22− width: units.gu(10)
23− height: units.gu(7)
24− radius: "medium"
2522
2623 property alias text: label.text
2724 property alias iconName: icon.name
2825
2926 signal clicked()
3027
31− Behavior on color {
32− ColorAnimation { duration: 100 }
33− }
34−
3528 Label {
3629 id: label
3730 anchors.centerIn: parent
38− color: "white"
39− fontSize: "x-large"
40− font.weight: Font.Light
41− opacity: 0.9
31+ color: "#f3f3e7"
32+ fontSize: "large"
33+ font.weight: Font.DemiBold
4234 }
4335
4436 Icon {
@@ -46,14 +38,11 @@ UbuntuShape {
4638 height: units.gu(3)
4739 width: height
4840 anchors.centerIn: parent
49− color: "white"
50− opacity: 0.9
41+ color: "#f3f3e7"
5142 }
5243
5344 MouseArea {
5445 anchors.fill: parent
5546 onClicked: root.clicked()
56− onPressed: root.color = Qt.rgba(0, 0, 0, 0.3)
57− onReleased: root.color = Qt.rgba(0, 0, 0, 0)
5847 }
5948}