From a878d3cfe1a9ade1f4bee939053c5cee257f64eb Mon Sep 17 00:00:00 2001 From: Michael Bohlender Date: Tue, 6 Dec 2016 17:11:43 +0100 Subject: port autocompletelineedit to qqc2 --- .../package/contents/ui/AutocompleteLineEdit.qml | 104 ++++++++++----------- 1 file changed, 49 insertions(+), 55 deletions(-) (limited to 'components/package/contents') diff --git a/components/package/contents/ui/AutocompleteLineEdit.qml b/components/package/contents/ui/AutocompleteLineEdit.qml index cb6e4fcb..a24ed0ee 100644 --- a/components/package/contents/ui/AutocompleteLineEdit.qml +++ b/components/package/contents/ui/AutocompleteLineEdit.qml @@ -1,26 +1,24 @@ /* - Copyright (C) 2016 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. -*/ + * Copyright (C) 2016 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.4 as Controls1 import QtQuick.Controls 2.0 as Controls2 import QtQuick.Layouts 1.1 -import QtQuick.Dialogs 1.0 import org.kde.kirigami 1.0 as Kirigami @@ -94,46 +92,42 @@ Controls2.TextField { width: textField.width border.color: "Black" radius: 5 - Controls1.ScrollView { - id: scrollView - anchors.fill: parent - ListView { - id: listView - height: childrenRect.height - width: scrollView.width - interactive: true - model: textField.model - delegate: Kirigami.AbstractListItem { - id: listDelegate - property string text: model.text - - width: listView.width - height: textField.height - - enabled: true - supportsMouseEvents: true - - checked: listView.currentIndex == index - onClicked: { - listView.currentIndex = model.index - accept() - } + ListView { + id: listView + height: childrenRect.height + width: parent.width + interactive: true + model: textField.model + delegate: Kirigami.AbstractListItem { + id: listDelegate + property string text: model.text + + width: listView.width + height: textField.height + + enabled: true + supportsMouseEvents: true + + checked: listView.currentIndex == index + onClicked: { + listView.currentIndex = model.index + accept() + } - //Content - Item { - width: parent.width - height: parent.height + //Content + Item { + width: parent.width + height: parent.height - Column { - anchors { - verticalCenter: parent.verticalCenter - left: parent.left - } + Column { + anchors { + verticalCenter: parent.verticalCenter + left: parent.left + } - Text{ - text: model.text - color: listDelegate.checked ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor - } + Text{ + text: model.text + color: listDelegate.checked ? Kirigami.Theme.highlightedTextColor : Kirigami.Theme.textColor } } } -- cgit v1.2.3