summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Bohlender <michael.bohlender@kdemail.net>2017-06-29 17:17:43 +0200
committerMichael Bohlender <michael.bohlender@kdemail.net>2017-06-29 17:17:43 +0200
commita393d5e1a0ad7bb42d9ee0c1e43a2437a957c416 (patch)
tree5dafab3bcbaa414e423a0f7c5f0485f7fa21f3c4
parent69e44a40d0e4d374d25689fd12d8c0bada4988bc (diff)
downloadkube-a393d5e1a0ad7bb42d9ee0c1e43a2437a957c416.tar.gz
kube-a393d5e1a0ad7bb42d9ee0c1e43a2437a957c416.zip
fix autocompletelineedit delegate
-rw-r--r--framework/qml/AutocompleteLineEdit.qml34
1 files changed, 19 insertions, 15 deletions
diff --git a/framework/qml/AutocompleteLineEdit.qml b/framework/qml/AutocompleteLineEdit.qml
index c5f89450..165b7a14 100644
--- a/framework/qml/AutocompleteLineEdit.qml
+++ b/framework/qml/AutocompleteLineEdit.qml
@@ -19,6 +19,8 @@
19import QtQuick 2.7 19import QtQuick 2.7
20import QtQuick.Controls 2.0 as Controls2 20import QtQuick.Controls 2.0 as Controls2
21import QtQuick.Layouts 1.1 21import QtQuick.Layouts 1.1
22import QtQuick.Templates 2.1 as T
23
22 24
23import org.kube.framework 1.0 as Kube 25import org.kube.framework 1.0 as Kube
24 26
@@ -109,31 +111,26 @@ Kube.TextField {
109 interactive: true 111 interactive: true
110 model: root.model 112 model: root.model
111 //TODO abstract listItem 113 //TODO abstract listItem
112 delegate: Rectangle { 114 delegate: T.ItemDelegate {
113 id: listDelegate 115 id: listDelegate
114 property string text: model.text
115 116
116 width: listView.width 117 width: listView.width
117 height: root.height 118 height: root.height
119 padding: Kube.Units.smallSpacing
118 120
119 //enabled: true 121 text: model.text
120 //supportsMouseEvents: true
121
122 //checked: listView.currentIndex == index
123 122
124 MouseArea { 123 checked: listView.currentIndex == index
125 anchors.fill: parent
126 124
127 onClicked: { 125 onClicked: {
128 listView.currentIndex = model.index 126 listView.currentIndex = model.index
129 accept() 127 accept()
130 }
131 } 128 }
132 129
133 //Content 130 //Content
134 Item { 131 contentItem: Item {
135 width: parent.width 132 width: parent.width - padding * 2
136 height: parent.height 133 height: parent.height - padding * 2
137 134
138 Column { 135 Column {
139 anchors { 136 anchors {
@@ -153,6 +150,13 @@ Kube.TextField {
153 } 150 }
154 } 151 }
155 } 152 }
153
154 background: Rectangle {
155 color: listDelegate.checked ? Kube.Colors.highlightColor : Kube.Colors.viewBackgroundColor
156
157 border.width: 1
158 color: Kube.Colors.buttonColor
159 }
156 } 160 }
157 } 161 }
158 } 162 }