diff options
author | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-13 08:52:14 +0200 |
---|---|---|
committer | Christian Mollekopf <chrigi_1@fastmail.fm> | 2017-06-13 08:52:14 +0200 |
commit | 2cc6ff760c6fe90deacf72c2de857eaa89b73f1a (patch) | |
tree | 6de1c46ff1c7b2a884f2ad2a930274710dbee1ba | |
parent | 0ef55c3bf02f8730ab821c3409c71e67bd382ecc (diff) | |
download | kube-2cc6ff760c6fe90deacf72c2de857eaa89b73f1a.tar.gz kube-2cc6ff760c6fe90deacf72c2de857eaa89b73f1a.zip |
Forgot to push AddresseeListEditor
-rw-r--r-- | components/kube/contents/ui/AddresseeListEditor.qml | 67 |
1 files changed, 67 insertions, 0 deletions
diff --git a/components/kube/contents/ui/AddresseeListEditor.qml b/components/kube/contents/ui/AddresseeListEditor.qml new file mode 100644 index 00000000..71854b7f --- /dev/null +++ b/components/kube/contents/ui/AddresseeListEditor.qml | |||
@@ -0,0 +1,67 @@ | |||
1 | /* | ||
2 | * Copyright (C) 2017 Michael Bohlender, <michael.bohlender@kdemail.net> | ||
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 | |||
20 | |||
21 | import QtQuick 2.7 | ||
22 | import QtQuick.Controls 1.3 | ||
23 | import QtQuick.Layouts 1.1 | ||
24 | |||
25 | import org.kube.framework 1.0 as Kube | ||
26 | |||
27 | Item { | ||
28 | id: root | ||
29 | property variant completer | ||
30 | property alias model: listView.model | ||
31 | |||
32 | signal added(string text) | ||
33 | signal removed(string text) | ||
34 | |||
35 | implicitHeight: listView.height + lineEdit.height | ||
36 | height: implicitHeight | ||
37 | |||
38 | Column { | ||
39 | anchors.fill: parent | ||
40 | ListView { | ||
41 | id: listView | ||
42 | anchors { | ||
43 | left: parent.left | ||
44 | right: parent.right | ||
45 | } | ||
46 | height: contentHeight | ||
47 | delegate: Text { | ||
48 | text: display | ||
49 | } | ||
50 | } | ||
51 | Kube.AutocompleteLineEdit { | ||
52 | id: lineEdit | ||
53 | anchors { | ||
54 | left: parent.left | ||
55 | right: parent.right | ||
56 | } | ||
57 | placeholderText: "Add recepient" | ||
58 | model: root.completer.model | ||
59 | onSearchTermChanged: root.completer.searchString = searchTerm | ||
60 | onAccepted: { | ||
61 | root.added(text); | ||
62 | console.warn("Accepted input: ", text) | ||
63 | clear() | ||
64 | } | ||
65 | } | ||
66 | } | ||
67 | } | ||