on xenial help sign in
factor out colors, fix (missing) dividers
commit8a869a87a8d62ce01e46b6ffa29df319b7a93210 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateFri 4 Sep 2015, 19:59 (11 years ago) parent71689f3
16 files changed+120−63
qml/Wizard/Page.qml+7−1 qml/Wizard/Pages/10-language.qml+2−2 qml/Wizard/Pages/20-sim.qml+2−2 qml/Wizard/Pages/30-wifi.qml+2−2 qml/Wizard/Pages/40-location.qml+38−8 qml/Wizard/Pages/50-timezone.qml+4−4 qml/Wizard/Pages/70-passwd-type.qml+47−27 qml/Wizard/Pages/80-finished.qml+1−1 qml/Wizard/Pages/here-terms.qml+5−5 qml/Wizard/Pages/passcode-confirm.qml+1−1 qml/Wizard/Pages/passcode-set.qml+1−1 qml/Wizard/Pages/password-set.qml+1−1 qml/Wizard/Pages/uaccount-signin.qml+2−2 qml/Wizard/Pages/uaccount-signup.qml+4−4 qml/Wizard/Pages/uaccount.qml+1−1 qml/Wizard/StackButton.qml+2−1
qml/Wizard/Page.qml+7−1
@@ -30,6 +30,12 @@ Item {
3030 readonly property real rightMargin: units.gu(3)
3131 readonly property real customMargin: units.gu(4) // margin for the custom (w/o title bar) pages
3232
33+ // colors
34+ readonly property color backgroundColor: "#fdfdfd"
35+ readonly property color dividerColor: "#cdcdcd"
36+ readonly property color textColor: "#525252"
37+ readonly property color errorColor: "#e14141"
38+
3339 // If you want to skip a page, mark skipValid false while you figure out
3440 // whether to skip, then set it to true once you've determined the value
3541 // of the skip property.
@@ -116,7 +122,7 @@ Item {
116122 }
117123 wrapMode: Text.Wrap
118124 text: title
119− color: customTitle ? "#525252" : "#fdfdfd"
125+ color: customTitle ? textColor : backgroundColor
120126 fontSize: "x-large"
121127 }
122128 }
qml/Wizard/Pages/10-language.qml+2−2
@@ -115,7 +115,7 @@ LocalComponents.Page {
115115
116116 fontSize: "medium"
117117 font.weight: itemDelegate.isCurrent ? Font.Normal : Font.Light
118− color: "#525252"
118+ color: textColor
119119 }
120120
121121 Image {
@@ -146,7 +146,7 @@ LocalComponents.Page {
146146 onClicked: {
147147 if (plugin.currentLanguage !== languagesListView.currentIndex) {
148148 plugin.currentLanguage = languagesListView.currentIndex;
149− print("Updating session locale:", plugin.languageCodes[plugin.currentLanguage])
149+ print("Updating session locale:", plugin.languageCodes[plugin.currentLanguage]);
150150 System.updateSessionLocale(plugin.languageCodes[plugin.currentLanguage]);
151151 }
152152 i18n.language = plugin.languageCodes[plugin.currentLanguage]; // re-notify of change after above call (for qlocale change)
qml/Wizard/Pages/20-sim.qml+2−2
@@ -99,7 +99,7 @@ LocalComponents.Page {
9999 text: i18n.tr("You won’t be able to make calls or use text messaging without a SIM.")
100100 fontSize: "small"
101101 font.weight: Font.Light
102− color: restartDialog.visible ? Theme.palette.normal.backgroundText : "#525252"
102+ color: restartDialog.visible ? Theme.palette.normal.backgroundText : textColor
103103 }
104104
105105 Label {
@@ -110,7 +110,7 @@ LocalComponents.Page {
110110 text: i18n.tr("To proceed with no SIM tap <em>Skip</em>.")
111111 fontSize: "small"
112112 font.weight: Font.Light
113− color: restartDialog.visible ? Theme.palette.normal.backgroundText : "#525252"
113+ color: restartDialog.visible ? Theme.palette.normal.backgroundText : textColor
114114 }
115115 }
116116
qml/Wizard/Pages/30-wifi.qml+2−2
@@ -101,7 +101,7 @@ LocalComponents.Page {
101101
102102 text: menuData && menuData.label || ""
103103 enabled: menuData && menuData.sensitive && !enterprise || false
104− __foregroundColor: "#525252"
104+ __foregroundColor: textColor
105105 showDivider: true
106106 iconName: {
107107 var imageName = "nm-signal-100";
@@ -150,7 +150,7 @@ LocalComponents.Page {
150150 anchors.left: parent.left
151151 anchors.right: parent.right
152152 font.weight: Font.Light
153− color: "#525252"
153+ color: "#68064d"
154154 text: listview.count > 0 ? i18n.tr("Available Wi-Fi networks")
155155 : i18n.tr("No available Wi-Fi networks")
156156 }
qml/Wizard/Pages/40-location.qml+38−8
@@ -65,7 +65,7 @@ LocalComponents.Page {
6565 }
6666
6767 wrapMode: Text.WordWrap
68− color: "#525252"
68+ color: textColor
6969 font.weight: checked ? Font.Normal : Font.Light
7070 text: i18n.tr("Use GPS, Wi-Fi hotspots and mobile network anonymously to detect location (recommended)")
7171 property bool checked: true
@@ -93,7 +93,7 @@ LocalComponents.Page {
9393 }
9494
9595 wrapMode: Text.WordWrap
96− color: "#525252"
96+ color: textColor
9797 font.weight: Font.Light
9898 fontSize: "small"
9999 linkColor: UbuntuColors.orange
@@ -110,18 +110,28 @@ LocalComponents.Page {
110110 anchors.verticalCenter: hereCheckLabel.verticalCenter
111111 }
112112
113+ Rectangle {
114+ id: divider
115+ anchors.left: parent.left
116+ anchors.right: parent.right
117+ anchors.top: hereTermsLabel.bottom
118+ anchors.topMargin: units.gu(3)
119+ height: units.dp(1)
120+ color: dividerColor
121+ }
122+
113123 Label {
114124 id: gpsCheckLabel
115125 anchors {
116126 left: parent.left
117127 right: parent.right
118− top: hereTermsLabel.bottom
128+ top: divider.bottom
119129 topMargin: units.gu(3)
120130 rightMargin: rightMargin
121131 }
122132 text: i18n.tr("GPS only")
123133 wrapMode: Text.WordWrap
124− color: "#525252"
134+ color: textColor
125135 font.weight: checked ? Font.Normal : Font.Light
126136 width: content.width
127137 property bool checked: false
@@ -147,17 +157,27 @@ LocalComponents.Page {
147157 anchors.verticalCenter: gpsCheckLabel.verticalCenter
148158 }
149159
160+ Rectangle {
161+ id: divider2
162+ anchors.left: parent.left
163+ anchors.right: parent.right
164+ anchors.top: gpsCheckLabel.bottom
165+ anchors.topMargin: units.gu(3)
166+ height: units.dp(1)
167+ color: dividerColor
168+ }
169+
150170 Label {
151171 id: nopeCheckLabel
152172 anchors {
153173 left: parent.left
154174 right: parent.right
155− top: gpsCheckLabel.bottom
175+ top: divider2.bottom
156176 topMargin: units.gu(3)
157177 rightMargin: rightMargin
158178 }
159179 wrapMode: Text.WordWrap
160− color: "#525252"
180+ color: textColor
161181 font.weight: checked ? Font.Normal : Font.Light
162182 width: content.width
163183 text: i18n.tr("Don't use my location")
@@ -184,18 +204,28 @@ LocalComponents.Page {
184204 anchors.verticalCenter: nopeCheckLabel.verticalCenter
185205 }
186206
207+ Rectangle {
208+ id: divider3
209+ anchors.left: parent.left
210+ anchors.right: parent.right
211+ anchors.top: nopeCheckLabel.bottom
212+ anchors.topMargin: units.gu(3)
213+ height: units.dp(1)
214+ color: dividerColor
215+ }
216+
187217 Label {
188218 id: infoLabel
189219 anchors {
190220 left: parent.left
191221 right: parent.right
192− top: nopeCheckLabel.bottom
222+ top: divider3.bottom
193223 topMargin: units.gu(3)
194224 }
195225 wrapMode: Text.Wrap
196226 textFormat: Text.RichText
197227 text: i18n.tr("You can change it later in <em>System Settings</em>.")
198− color: "#525252"
228+ color: textColor
199229 fontSize: "small"
200230 font.weight: Font.Light
201231 width: content.width
qml/Wizard/Pages/50-timezone.qml+4−4
@@ -52,7 +52,7 @@ LocalComponents.Page {
5252 }
5353 }
5454
55− theme.palette.normal.backgroundText = "#525252" // "fix" the placeholder text in the search field
55+ theme.palette.normal.backgroundText = textColor // "fix" the placeholder text in the search field
5656 }
5757
5858 Component {
@@ -69,14 +69,14 @@ LocalComponents.Page {
6969 text: !!city ? city : ""
7070 font.weight: tz.currentTz ? Font.Normal : Font.Light
7171 fontSize: "medium"
72− color: "#525252"
72+ color: textColor
7373 }
7474 Label {
7575 id: timeLabel
7676 text: !!time ? time + " " + abbreviation : ""
7777 font.weight: tz.currentTz ? Font.Normal : Font.Light
7878 fontSize: "small"
79− color: "#525252"
79+ color: textColor
8080 }
8181 }
8282 Image {
@@ -122,7 +122,7 @@ LocalComponents.Page {
122122 id: tzList;
123123
124124 boundsBehavior: Flickable.StopAtBounds
125− clip: true;
125+ clip: true
126126 currentIndex: -1
127127 snapMode: ListView.SnapToItem
128128
qml/Wizard/Pages/70-passwd-type.qml+47−27
@@ -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 }
qml/Wizard/Pages/80-finished.qml+1−1
@@ -60,7 +60,7 @@ LocalComponents.Page {
6060 anchors.horizontalCenter: parent.horizontalCenter
6161 text: i18n.tr("Get Started")
6262 onClicked: {
63− root.quitWizard()
63+ root.quitWizard();
6464 }
6565 }
6666 }
qml/Wizard/Pages/here-terms.qml+5−5
@@ -62,7 +62,7 @@ LocalComponents.Page {
6262 anchors.left: parent.left
6363 anchors.right: parent.right
6464 wrapMode: Text.Wrap
65− color: "black"
65+ color: textColor
6666 fontSize: "small"
6767 font.weight: Font.Light
6868 text: i18n.tr("Your device uses positioning technologies provided by HERE.")
@@ -73,7 +73,7 @@ LocalComponents.Page {
7373 anchors.left: parent.left
7474 anchors.right: parent.right
7575 wrapMode: Text.Wrap
76− color: "black"
76+ color: textColor
7777 fontSize: "small"
7878 font.weight: Font.Light
7979 text: i18n.tr("To provide you with positioning services and to improve their quality, HERE collects " +
@@ -86,7 +86,7 @@ LocalComponents.Page {
8686 anchors.left: parent.left
8787 anchors.right: parent.right
8888 wrapMode: Text.Wrap
89− color: "black"
89+ color: textColor
9090 fontSize: "small"
9191 font.weight: Font.Light
9292 text: i18n.tr("The information collected is used to analyze the service and to " +
@@ -98,7 +98,7 @@ LocalComponents.Page {
9898 anchors.left: parent.left
9999 anchors.right: parent.right
100100 wrapMode: Text.Wrap
101− color: "black"
101+ color: textColor
102102 fontSize: "small"
103103 font.weight: Font.Light
104104 linkColor: UbuntuColors.orange
@@ -115,7 +115,7 @@ LocalComponents.Page {
115115 anchors.left: parent.left
116116 anchors.right: parent.right
117117 wrapMode: Text.Wrap
118− color: "black"
118+ color: textColor
119119 fontSize: "small"
120120 font.weight: Font.Light
121121 linkColor: UbuntuColors.orange
qml/Wizard/Pages/passcode-confirm.qml+1−1
@@ -49,7 +49,7 @@ LocalComponents.Page {
4949
5050 errorText: i18n.tr("Incorrect passcode.") + "\n" + i18n.tr("Please re-enter.")
5151
52− foregroundColor: "#525252"
52+ foregroundColor: textColor
5353
5454 showEmergencyCallButton: false
5555 showCancelButton: false
qml/Wizard/Pages/passcode-set.qml+1−1
@@ -57,7 +57,7 @@ LocalComponents.Page {
5757 }
5858
5959 infoText: i18n.tr("Choose passcode")
60− foregroundColor: "#525252"
60+ foregroundColor: textColor
6161
6262 // Note that the number four comes from PAM settings,
6363 // which we don't have a good way to interrogate. We
qml/Wizard/Pages/password-set.qml+1−1
@@ -86,7 +86,7 @@ LocalComponents.Page {
8686 right: parent.right
8787 }
8888 wrapMode: Text.Wrap
89− color: hasError ? "#e14141": "#525252"
89+ color: hasError ? errorColor : textColor
9090 }
9191
9292 TextField {
qml/Wizard/Pages/uaccount-signin.qml+2−2
@@ -40,7 +40,7 @@ LocalComponents.Page {
4040 anchors.right: parent.right
4141 wrapMode: Text.Wrap
4242 text: i18n.tr("Email:")
43− color: "#525252"
43+ color: textColor
4444 font.weight: Font.Light
4545 }
4646
@@ -65,7 +65,7 @@ LocalComponents.Page {
6565 anchors.topMargin: units.gu(3)
6666 wrapMode: Text.Wrap
6767 text: i18n.tr("Password:")
68− color: "#525252"
68+ color: textColor
6969 font.weight: Font.Light
7070 }
7171
qml/Wizard/Pages/uaccount-signup.qml+4−4
@@ -37,7 +37,7 @@ LocalComponents.Page {
3737 anchors.right: parent.right
3838 wrapMode: Text.Wrap
3939 text: i18n.tr("Email:")
40− color: "#525252"
40+ color: textColor
4141 font.weight: Font.Light
4242 }
4343
@@ -63,7 +63,7 @@ LocalComponents.Page {
6363 anchors.topMargin: units.gu(3)
6464 wrapMode: Text.Wrap
6565 text: i18n.tr("Your name:")
66− color: "#525252"
66+ color: textColor
6767 font.weight: Font.Light
6868 }
6969
@@ -85,7 +85,7 @@ LocalComponents.Page {
8585 anchors.topMargin: units.gu(3)
8686 wrapMode: Text.Wrap
8787 text: i18n.tr("Password:")
88− color: "#525252"
88+ color: textColor
8989 font.weight: Font.Light
9090 }
9191
@@ -118,7 +118,7 @@ LocalComponents.Page {
118118 anchors.topMargin: passInput.text !== "" ? units.gu(6) : units.gu(3)
119119 wrapMode: Text.Wrap
120120 text: i18n.tr("Repeat password:")
121− color: "#525252"
121+ color: textColor
122122 font.weight: Font.Light
123123 }
124124
qml/Wizard/Pages/uaccount.qml+1−1
@@ -35,7 +35,7 @@ LocalComponents.Page {
3535 anchors.right: parent.right
3636 wrapMode: Text.Wrap
3737 text: i18n.tr("Secure my device using my Ubuntu account")
38− color: "#525252"
38+ color: textColor
3939 font.weight: Font.Light
4040 fontSize: "small"
4141 }
qml/Wizard/StackButton.qml+2−1
@@ -32,8 +32,9 @@ AbstractButton {
3232 anchors.verticalCenter: parent.verticalCenter
3333 anchors.left: parent.left
3434 anchors.right: parent.right
35− color: "#525252"
35+ color: textColor
3636 opacity: enabled ? 1.0 : 0.5
37+ fontSize: "medium"
3738 font.weight: backArrow ? Font.Normal : Font.DemiBold
3839 text: stackButton.text
3940 horizontalAlignment: backArrow ? Text.AlignLeft : Text.AlignRight