From 2cc6ff760c6fe90deacf72c2de857eaa89b73f1a Mon Sep 17 00:00:00 2001 From: Christian Mollekopf Date: Tue, 13 Jun 2017 08:52:14 +0200 Subject: Forgot to push AddresseeListEditor --- .../kube/contents/ui/AddresseeListEditor.qml | 67 ++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 components/kube/contents/ui/AddresseeListEditor.qml (limited to 'components') 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 @@ +/* + * Copyright (C) 2017 Michael Bohlender, + * Copyright (C) 2017 Christian Mollekopf, + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. + */ + + +import QtQuick 2.7 +import QtQuick.Controls 1.3 +import QtQuick.Layouts 1.1 + +import org.kube.framework 1.0 as Kube + +Item { + id: root + property variant completer + property alias model: listView.model + + signal added(string text) + signal removed(string text) + + implicitHeight: listView.height + lineEdit.height + height: implicitHeight + + Column { + anchors.fill: parent + ListView { + id: listView + anchors { + left: parent.left + right: parent.right + } + height: contentHeight + delegate: Text { + text: display + } + } + Kube.AutocompleteLineEdit { + id: lineEdit + anchors { + left: parent.left + right: parent.right + } + placeholderText: "Add recepient" + model: root.completer.model + onSearchTermChanged: root.completer.searchString = searchTerm + onAccepted: { + root.added(text); + console.warn("Accepted input: ", text) + clear() + } + } + } +} -- cgit v1.2.3