@@ -40,24 +40,24 @@ LocalComponents.Page {
4040
4141 function indexToMethod(index) {
4242 if (index === 1)
43− return UbuntuSecurityPrivacyPanel.Passcode
43+ return UbuntuSecurityPrivacyPanel.Passcode;
4444 else if (index === 0)
45− return UbuntuSecurityPrivacyPanel.Passphrase
45+ return UbuntuSecurityPrivacyPanel.Passphrase;
4646 else
47− return UbuntuSecurityPrivacyPanel.Swipe
47+ return UbuntuSecurityPrivacyPanel.Swipe;
4848 }
4949
5050 function methodToIndex(method) {
5151 if (method === UbuntuSecurityPrivacyPanel.Passcode)
52− return 1
52+ return 1;
5353 else if (method === UbuntuSecurityPrivacyPanel.Passphrase)
54− return 0
54+ return 0;
5555 else
56− return 2
56+ return 2;
5757 }
5858
5959 Component.onCompleted: {
60− selector.currentIndex = methodToIndex(root.passwordMethod)
60+ selector.currentIndex = methodToIndex(root.passwordMethod);
6161 }
6262
6363 Item {
@@ -71,20 +71,28 @@ LocalComponents.Page {
7171 anchors.right: parent.right
7272 wrapMode: Text.Wrap
7373 text: i18n.tr("Choose lock screen security")
74− color: "#525252"
74+ color: textColor
7575 fontSize: "small"
7676 font.weight: Font.Light
7777 }
7878
79− ListView {
80− id: selector
79+ Rectangle {
80+ id: divider
8181 anchors.left: parent.left
8282 anchors.right: parent.right
8383 anchors.top: infoLabel.bottom
8484 anchors.topMargin: units.gu(3)
85+ height: units.dp(1)
86+ color: dividerColor
87+ }
8588
86− boundsBehavior: Flickable.StopAtBounds;
87− clip: true;
89+ ListView {
90+ id: selector
91+ anchors.left: parent.left
92+ anchors.right: parent.right
93+ anchors.top: divider.bottom
94+ boundsBehavior: Flickable.StopAtBounds
95+ clip: true
8896 height: childrenRect.height
8997
9098 // this is the order we want to display it; cf indexToMethod()
@@ -93,27 +101,30 @@ LocalComponents.Page {
93101 delegate: ListItem {
94102 id: itemDelegate
95103 readonly property bool isCurrent: index === ListView.view.currentIndex
104+ highlightColor: backgroundColor
105+ divider.colorFrom: dividerColor
106+ divider.colorTo: backgroundColor
96107 Label {
97108 id: methodLabel
98109 objectName: "passwdDelegate" + index
99110 anchors.verticalCenter: parent.verticalCenter;
100111 fontSize: "medium"
101− color: "#525252"
112+ color: textColor
102113 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
103114 text: {
104115 var method = modelData
105116 var name = ""
106117 var desc = ""
107118 if (method === UbuntuSecurityPrivacyPanel.Swipe) {
108− return i18n.ctr("Label: Type of security method", "None")
119+ return i18n.ctr("Label: Type of security method", "None");
109120 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
110− name = i18n.ctr("Label: Type of security method", "Passcode")
111− desc = i18n.ctr("Label: Description of security method", "4 digits only")
121+ name = i18n.ctr("Label: Type of security method", "Passcode");
122+ desc = i18n.ctr("Label: Description of security method", "4 digits only");
112123 } else {
113− name = i18n.ctr("Label: Type of security method", "Password")
114− desc = i18n.ctr("Label: Description of security method", "numbers and letters")
124+ name = i18n.ctr("Label: Type of security method", "Password");
125+ desc = i18n.ctr("Label: Description of security method", "numbers and letters");
115126 }
116− return "%1 (%2)".arg(name).arg(desc)
127+ return "%1 (%2)".arg(name).arg(desc);
117128 }
118129 }
119130
@@ -130,11 +141,20 @@ LocalComponents.Page {
130141 }
131142
132143 onClicked: {
133− selector.currentIndex = index
134− print("Current method: " + indexToMethod(index))
144+ selector.currentIndex = index;
145+ print("Current method: " + indexToMethod(index));
135146 }
136147 }
137148 }
149+
150+ Rectangle {
151+ id: divider2
152+ anchors.left: parent.left
153+ anchors.right: parent.right
154+ anchors.top: selector.bottom
155+ height: units.dp(1)
156+ color: dividerColor
157+ }
138158 }
139159
140160 Component {
@@ -142,16 +162,16 @@ LocalComponents.Page {
142162 LocalComponents.StackButton {
143163 text: i18n.tr("Next")
144164 onClicked: {
145− var method = indexToMethod(selector.currentIndex)
146− root.passwordMethod = method
147− print("Current method: " + root.passwordMethod)
165+ var method = indexToMethod(selector.currentIndex);
166+ root.passwordMethod = method;
167+ print("Current method: " + root.passwordMethod);
148168
149169 if (method === UbuntuSecurityPrivacyPanel.Passphrase) {
150− pageStack.load(Qt.resolvedUrl("password-set.qml"))
170+ pageStack.load(Qt.resolvedUrl("password-set.qml"));
151171 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
152− pageStack.load(Qt.resolvedUrl("passcode-set.qml"))
172+ pageStack.load(Qt.resolvedUrl("passcode-set.qml"));
153173 } else {
154− pageStack.next()
174+ pageStack.next();
155175 }
156176 }
157177 }