@@ -40,24 +40,24 @@ LocalComponents.Page {
41 function indexToMethod(index) {
41 function indexToMethod(index) {
42 if (index === 1)
42 if (index === 1)
43− return UbuntuSecurityPrivacyPanel.Passcode
43+ return UbuntuSecurityPrivacyPanel.Passcode;
44 else if (index === 0)
44 else if (index === 0)
45− return UbuntuSecurityPrivacyPanel.Passphrase
45+ return UbuntuSecurityPrivacyPanel.Passphrase;
47− return UbuntuSecurityPrivacyPanel.Swipe
47+ return UbuntuSecurityPrivacyPanel.Swipe;
50 function methodToIndex(method) {
50 function methodToIndex(method) {
51 if (method === UbuntuSecurityPrivacyPanel.Passcode)
51 if (method === UbuntuSecurityPrivacyPanel.Passcode)
52− return 1
52+ return 1;
53 else if (method === UbuntuSecurityPrivacyPanel.Passphrase)
53 else if (method === UbuntuSecurityPrivacyPanel.Passphrase)
54− return 0
54+ return 0;
56− return 2
56+ return 2;
59 Component.onCompleted: {
59 Component.onCompleted: {
60− selector.currentIndex = methodToIndex(root.passwordMethod)
60+ selector.currentIndex = methodToIndex(root.passwordMethod);
@@ -71,20 +71,28 @@ LocalComponents.Page {
71 anchors.right: parent.right
71 anchors.right: parent.right
72 wrapMode: Text.Wrap
72 wrapMode: Text.Wrap
73 text: i18n.tr("Choose lock screen security")
73 text: i18n.tr("Choose lock screen security")
74− color: "#525252"
74+ color: textColor
75 fontSize: "small"
75 fontSize: "small"
76 font.weight: Font.Light
76 font.weight: Font.Light
79− ListView {
79+ Rectangle {
80− id: selector
80+ id: divider
81 anchors.left: parent.left
81 anchors.left: parent.left
82 anchors.right: parent.right
82 anchors.right: parent.right
83 anchors.top: infoLabel.bottom
83 anchors.top: infoLabel.bottom
84 anchors.topMargin: units.gu(3)
84 anchors.topMargin: units.gu(3)
91+ anchors.left: parent.left
92+ anchors.right: parent.right
93+ anchors.top: divider.bottom
86− boundsBehavior: Flickable.StopAtBounds;
94+ boundsBehavior: Flickable.StopAtBounds
87− clip: true;
95+ clip: true
88 height: childrenRect.height
96 height: childrenRect.height
90 // this is the order we want to display it; cf indexToMethod()
98 // this is the order we want to display it; cf indexToMethod()
@@ -93,27 +101,30 @@ LocalComponents.Page {
93 delegate: ListItem {
101 delegate: ListItem {
94 id: itemDelegate
102 id: itemDelegate
95 readonly property bool isCurrent: index === ListView.view.currentIndex
103 readonly property bool isCurrent: index === ListView.view.currentIndex
104+ highlightColor: backgroundColor
105+ divider.colorFrom: dividerColor
106+ divider.colorTo: backgroundColor
97 id: methodLabel
108 id: methodLabel
98 objectName: "passwdDelegate" + index
109 objectName: "passwdDelegate" + index
99 anchors.verticalCenter: parent.verticalCenter;
110 anchors.verticalCenter: parent.verticalCenter;
100 fontSize: "medium"
111 fontSize: "medium"
101− color: "#525252"
112+ color: textColor
102 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
113 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
104 var method = modelData
115 var method = modelData
105 var name = ""
116 var name = ""
106 var desc = ""
117 var desc = ""
107 if (method === UbuntuSecurityPrivacyPanel.Swipe) {
118 if (method === UbuntuSecurityPrivacyPanel.Swipe) {
108− return i18n.ctr("Label: Type of security method", "None")
119+ return i18n.ctr("Label: Type of security method", "None");
109 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
120 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
110− name = i18n.ctr("Label: Type of security method", "Passcode")
121+ name = i18n.ctr("Label: Type of security method", "Passcode");
111− desc = i18n.ctr("Label: Description of security method", "4 digits only")
122+ desc = i18n.ctr("Label: Description of security method", "4 digits only");
113− name = i18n.ctr("Label: Type of security method", "Password")
124+ name = i18n.ctr("Label: Type of security method", "Password");
114− desc = i18n.ctr("Label: Description of security method", "numbers and letters")
125+ desc = i18n.ctr("Label: Description of security method", "numbers and letters");
116− return "%1 (%2)".arg(name).arg(desc)
127+ return "%1 (%2)".arg(name).arg(desc);
@@ -130,11 +141,20 @@ LocalComponents.Page {
132 onClicked: {
143 onClicked: {
133− selector.currentIndex = index
144+ selector.currentIndex = index;
134− print("Current method: " + indexToMethod(index))
145+ print("Current method: " + indexToMethod(index));
152+ anchors.left: parent.left
153+ anchors.right: parent.right
154+ anchors.top: selector.bottom
140 Component {
160 Component {
@@ -142,16 +162,16 @@ LocalComponents.Page {
142 LocalComponents.StackButton {
162 LocalComponents.StackButton {
143 text: i18n.tr("Next")
163 text: i18n.tr("Next")
144 onClicked: {
164 onClicked: {
145− var method = indexToMethod(selector.currentIndex)
165+ var method = indexToMethod(selector.currentIndex);
146− root.passwordMethod = method
166+ root.passwordMethod = method;
147− print("Current method: " + root.passwordMethod)
167+ print("Current method: " + root.passwordMethod);
149 if (method === UbuntuSecurityPrivacyPanel.Passphrase) {
169 if (method === UbuntuSecurityPrivacyPanel.Passphrase) {
150− pageStack.load(Qt.resolvedUrl("password-set.qml"))
170+ pageStack.load(Qt.resolvedUrl("password-set.qml"));
151 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
171 } else if (method === UbuntuSecurityPrivacyPanel.Passcode) {
152− pageStack.load(Qt.resolvedUrl("passcode-set.qml"))
172+ pageStack.load(Qt.resolvedUrl("passcode-set.qml"));
154− pageStack.next()
174+ pageStack.next();