on xenial help sign in
add a custom WizardTextField with special style settings
cd4bc68Lukáš Tinkl
qml/Wizard/Pages/50-timezone.qml+2−3
@@ -52,7 +52,7 @@ LocalComponents.Page {
52 }
52 }
53 }
53 }
54
54
55− theme.palette.normal.backgroundText = textColor // "fix" the placeholder text in the search field
55+ theme.palette.normal.backgroundText = textColor
56 }
56 }
57
57
58 Component {
58 Component {
@@ -111,14 +111,13 @@ LocalComponents.Page {
111 }
111 }
112 spacing: units.gu(2)
112 spacing: units.gu(2)
113
113
114− TextField {
114+ LocalComponents.WizardTextField {
115 id: searchField
115 id: searchField
116 anchors.left: parent.left
116 anchors.left: parent.left
117 anchors.right: parent.right
117 anchors.right: parent.right
118 anchors.leftMargin: leftMargin
118 anchors.leftMargin: leftMargin
119 anchors.rightMargin: rightMargin
119 anchors.rightMargin: rightMargin
120 placeholderText: i18n.tr("Enter your city or country")
120 placeholderText: i18n.tr("Enter your city or country")
121− color: UbuntuColors.lightGrey
122 inputMethodHints: Qt.ImhNoPredictiveText
121 inputMethodHints: Qt.ImhNoPredictiveText
123 onTextChanged: {
122 onTextChanged: {
124 if (text == "") { // reset when switching between filter modes (text/country)
123 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 {
54 font.weight: Font.Light
54 font.weight: Font.Light
55 }
55 }
56
56
57− TextField {
57+ LocalComponents.WizardTextField {
58 id: emailInput
58 id: emailInput
59 anchors.left: parent.left
59 anchors.left: parent.left
60 anchors.right: parent.right
60 anchors.right: parent.right
@@ -80,7 +80,7 @@ LocalComponents.Page {
80 font.weight: Font.Light
80 font.weight: Font.Light
81 }
81 }
82
82
83− TextField {
83+ LocalComponents.WizardTextField {
84 id: nameInput
84 id: nameInput
85 anchors.left: parent.left
85 anchors.left: parent.left
86 anchors.right: parent.right
86 anchors.right: parent.right
@@ -102,7 +102,7 @@ LocalComponents.Page {
102 font.weight: Font.Light
102 font.weight: Font.Light
103 }
103 }
104
104
105− TextField {
105+ LocalComponents.WizardTextField {
106 id: passInput
106 id: passInput
107 anchors.left: parent.left
107 anchors.left: parent.left
108 anchors.right: parent.right
108 anchors.right: parent.right
@@ -135,7 +135,7 @@ LocalComponents.Page {
135 font.weight: Font.Light
135 font.weight: Font.Light
136 }
136 }
137
137
138− TextField {
138+ LocalComponents.WizardTextField {
139 id: pass2Input
139 id: pass2Input
140 anchors.left: parent.left
140 anchors.left: parent.left
141 anchors.right: parent.right
141 anchors.right: parent.right
qml/Wizard/Pages/password-set.qml+1−1
@@ -91,7 +91,7 @@ LocalComponents.Page {
91 color: hasError ? errorColor : textColor
91 color: hasError ? errorColor : textColor
92 }
92 }
93
93
94− TextField {
94+ LocalComponents.WizardTextField {
95 id: passwordField
95 id: passwordField
96 anchors {
96 anchors {
97 left: parent.left
97 left: parent.left
qml/Wizard/Pages/uaccount-signin.qml+2−2
@@ -44,7 +44,7 @@ LocalComponents.Page {
44 font.weight: Font.Light
44 font.weight: Font.Light
45 }
45 }
46
46
47− TextField {
47+ LocalComponents.WizardTextField {
48 id: emailInput
48 id: emailInput
49 anchors.left: parent.left
49 anchors.left: parent.left
50 anchors.right: parent.right
50 anchors.right: parent.right
@@ -69,7 +69,7 @@ LocalComponents.Page {
69 font.weight: Font.Light
69 font.weight: Font.Light
70 }
70 }
71
71
72− TextField {
72+ LocalComponents.WizardTextField {
73 id: passInput
73 id: passInput
74 anchors.left: parent.left
74 anchors.left: parent.left
75 anchors.right: parent.right
75 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+}