on xenial help sign in
add a custom WizardTextField with special style settings

and use it instead of the generic TextField

commitcd4bc681dd09276c6d2701adc451d10baadbbaa1 authorLukáš Tinkl <lukas.tinkl@canonical.com> dateThu 10 Sep 2015, 17:54 (11 years ago) parent82af3b4
5 files changed+38−10
qml/Wizard/Pages/50-timezone.qml+2−3 qml/Wizard/Pages/60-uaccount-signup.qml+4−4 qml/Wizard/Pages/password-set.qml+1−1 qml/Wizard/Pages/uaccount-signin.qml+2−2 qml/Wizard/WizardTextField.qml+29
qml/Wizard/Pages/50-timezone.qml+2−3
@@ -52,7 +52,7 @@ LocalComponents.Page {
5252 }
5353 }
5454
55− theme.palette.normal.backgroundText = textColor // "fix" the placeholder text in the search field
55+ theme.palette.normal.backgroundText = textColor
5656 }
5757
5858 Component {
@@ -111,14 +111,13 @@ LocalComponents.Page {
111111 }
112112 spacing: units.gu(2)
113113
114− TextField {
114+ LocalComponents.WizardTextField {
115115 id: searchField
116116 anchors.left: parent.left
117117 anchors.right: parent.right
118118 anchors.leftMargin: leftMargin
119119 anchors.rightMargin: rightMargin
120120 placeholderText: i18n.tr("Enter your city or country")
121− color: UbuntuColors.lightGrey
122121 inputMethodHints: Qt.ImhNoPredictiveText
123122 onTextChanged: {
124123 if (text == "") { // reset when switching between filter modes (text/country)
qml/Wizard/Pages/60-uaccount-signup.qml+4−4
@@ -54,7 +54,7 @@ LocalComponents.Page {
5454 font.weight: Font.Light
5555 }
5656
57− TextField {
57+ LocalComponents.WizardTextField {
5858 id: emailInput
5959 anchors.left: parent.left
6060 anchors.right: parent.right
@@ -80,7 +80,7 @@ LocalComponents.Page {
8080 font.weight: Font.Light
8181 }
8282
83− TextField {
83+ LocalComponents.WizardTextField {
8484 id: nameInput
8585 anchors.left: parent.left
8686 anchors.right: parent.right
@@ -102,7 +102,7 @@ LocalComponents.Page {
102102 font.weight: Font.Light
103103 }
104104
105− TextField {
105+ LocalComponents.WizardTextField {
106106 id: passInput
107107 anchors.left: parent.left
108108 anchors.right: parent.right
@@ -135,7 +135,7 @@ LocalComponents.Page {
135135 font.weight: Font.Light
136136 }
137137
138− TextField {
138+ LocalComponents.WizardTextField {
139139 id: pass2Input
140140 anchors.left: parent.left
141141 anchors.right: parent.right
qml/Wizard/Pages/password-set.qml+1−1
@@ -91,7 +91,7 @@ LocalComponents.Page {
9191 color: hasError ? errorColor : textColor
9292 }
9393
94− TextField {
94+ LocalComponents.WizardTextField {
9595 id: passwordField
9696 anchors {
9797 left: parent.left
qml/Wizard/Pages/uaccount-signin.qml+2−2
@@ -44,7 +44,7 @@ LocalComponents.Page {
4444 font.weight: Font.Light
4545 }
4646
47− TextField {
47+ LocalComponents.WizardTextField {
4848 id: emailInput
4949 anchors.left: parent.left
5050 anchors.right: parent.right
@@ -69,7 +69,7 @@ LocalComponents.Page {
6969 font.weight: Font.Light
7070 }
7171
72− TextField {
72+ LocalComponents.WizardTextField {
7373 id: passInput
7474 anchors.left: parent.left
7575 anchors.right: parent.right
qml/Wizard/WizardTextField.qmlnew file+29
@@ -0,0 +1,29 @@
1+/*
2+ * Copyright (C) 2015 Canonical, Ltd.
3+ *
4+ * This program is free software; you can redistribute it and/or modify
5+ * it under the terms of the GNU General Public License as published by
6+ * the Free Software Foundation; version 3.
7+ *
8+ * This program is distributed in the hope that it will be useful,
9+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
10+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11+ * GNU General Public License for more details.
12+ *
13+ * You should have received a copy of the GNU General Public License
14+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
15+ */
16+
17+import QtQuick 2.4
18+import Ubuntu.Components 1.2
19+import Ubuntu.Components.Themes.Ambiance 1.2
20+
21+TextField {
22+ id: styledItem
23+ style: TextFieldStyle {
24+ color: "#5d5d5d"
25+ backgroundColor: (focus || highlighted) ? "#fdfdfd" : "#f5f5f5"
26+ errorColor: "#e14141"
27+ selectionColor: "#cdcdcd"
28+ }
29+}