summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/qml/RequiredTextField.qml32
-rw-r--r--framework/qmldir1
2 files changed, 33 insertions, 0 deletions
diff --git a/framework/qml/RequiredTextField.qml b/framework/qml/RequiredTextField.qml
new file mode 100644
index 00000000..2e3512a4
--- /dev/null
+++ b/framework/qml/RequiredTextField.qml
@@ -0,0 +1,32 @@
1/*
2 * Copyright (C) 2017 Michael Bohlender, <bohlender@kolabsys.com>
3 * Copyright (C) 2017 Christian Mollekopf, <mollekopf@kolabsys.com>
4 *
5 * This program is free software; you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation; either version 2 of the License, or
8 * (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License along
16 * with this program; if not, write to the Free Software Foundation, Inc.,
17 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
18 */
19
20import QtQuick 2.7
21import org.kube.framework 1.0 as Kube
22
23Kube.TextField {
24 id: root
25 validator: RegExpValidator { regExp: /.*\S.*/ }
26 Rectangle {
27 anchors.fill: parent
28 opacity: 0.2
29 color: Kube.Colors.warningColor
30 visible: !root.acceptableInput
31 }
32}
diff --git a/framework/qmldir b/framework/qmldir
index 6b3f355c..461bd653 100644
--- a/framework/qmldir
+++ b/framework/qmldir
@@ -24,6 +24,7 @@ CheckBox 1.0 CheckBox.qml
24PositiveButton 1.0 PositiveButton.qml 24PositiveButton 1.0 PositiveButton.qml
25TextButton 1.0 TextButton.qml 25TextButton 1.0 TextButton.qml
26TextField 1.0 TextField.qml 26TextField 1.0 TextField.qml
27RequiredTextField 1.0 RequiredTextField.qml
27PasswordField 1.0 PasswordField.qml 28PasswordField 1.0 PasswordField.qml
28TextArea 1.0 TextArea.qml 29TextArea 1.0 TextArea.qml
29TextEditor 1.0 TextEditor.qml 30TextEditor 1.0 TextEditor.qml