summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--framework/qml/TextField.qml51
1 files changed, 51 insertions, 0 deletions
diff --git a/framework/qml/TextField.qml b/framework/qml/TextField.qml
new file mode 100644
index 00000000..7542af65
--- /dev/null
+++ b/framework/qml/TextField.qml
@@ -0,0 +1,51 @@
1/*
2 * Copyright (C) 2017 Michael Bohlender, <bohlender@kolabsys.com>
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; either version 2 of the License, or
7 * (at your option) any later version.
8 *
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along
15 * with this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
17 */
18
19import QtQuick 2.7
20import QtQuick.Templates 2.0 as T
21import org.kube.framework 1.0
22
23T.TextField {
24 id: root
25
26 implicitHeight: Units.gridUnit + Units.smallSpacing * 2
27 implicitWidth: Units.gridUnit * 5 + Units.smallSpacing * 2
28
29 padding: Units.smallSpacing
30
31 color: Colors.textColor
32
33 Text {
34 id: placeholder
35 x: root.leftPadding
36 y: root.topPadding
37
38 width: root.width - (root.leftPadding + root.rightPadding)
39 height: root.height - (root.topPadding + root.bottomPadding)
40
41 text: root.placeholderText
42 //TODO font:
43
44 color: Colors.disabledTextColor
45 elide: Text.ElideRight
46 }
47
48 background: Rectangle {
49 color: Colors.viewBackgroundColor
50 }
51}