diff options
Diffstat (limited to 'framework')
-rw-r--r-- | framework/qml/AutocompleteLineEdit.qml | 35 |
1 files changed, 5 insertions, 30 deletions
diff --git a/framework/qml/AutocompleteLineEdit.qml b/framework/qml/AutocompleteLineEdit.qml index 1be8f7eb..e5368fe9 100644 --- a/framework/qml/AutocompleteLineEdit.qml +++ b/framework/qml/AutocompleteLineEdit.qml | |||
@@ -125,53 +125,28 @@ Kube.TextField { | |||
125 | width: parent.width | 125 | width: parent.width |
126 | interactive: true | 126 | interactive: true |
127 | model: root.model | 127 | model: root.model |
128 | //TODO abstract listItem | 128 | delegate: Kube.ListDelegate { |
129 | delegate: T.ItemDelegate { | ||
130 | id: listDelegate | 129 | id: listDelegate |
131 | 130 | ||
132 | width: listView.width | ||
133 | height: root.height | 131 | height: root.height |
134 | padding: Kube.Units.smallSpacing | 132 | padding: Kube.Units.smallSpacing |
135 | 133 | ||
136 | text: model.text | 134 | text: model.text |
137 | 135 | ||
138 | checked: listView.currentIndex == index | ||
139 | |||
140 | onClicked: { | ||
141 | listView.currentIndex = model.index | ||
142 | accept() | ||
143 | } | ||
144 | |||
145 | //Content | ||
146 | contentItem: Item { | 136 | contentItem: Item { |
147 | width: parent.width - padding * 2 | 137 | width: parent.width - padding * 2 |
148 | height: parent.height - padding * 2 | 138 | height: parent.height - padding * 2 |
149 | 139 | Kube.Label{ | |
150 | Column { | ||
151 | anchors { | 140 | anchors { |
152 | verticalCenter: parent.verticalCenter | 141 | verticalCenter: parent.verticalCenter |
153 | left: parent.left | 142 | left: parent.left |
154 | right: parent.right | 143 | right: parent.right |
155 | } | 144 | } |
156 | 145 | text: model.text | |
157 | Kube.Label{ | 146 | color: listDelegate.textColor |
158 | anchors { | 147 | elide: Text.ElideRight |
159 | left: parent.left | ||
160 | right: parent.right | ||
161 | } | ||
162 | text: model.text | ||
163 | color: listDelegate.checked ? Kube.Colors.highlightedTextColor : Kube.Colors.textColor | ||
164 | elide: Text.ElideRight | ||
165 | } | ||
166 | } | 148 | } |
167 | } | 149 | } |
168 | |||
169 | background: Rectangle { | ||
170 | color: listDelegate.checked ? Kube.Colors.highlightColor : Kube.Colors.viewBackgroundColor | ||
171 | |||
172 | border.width: 1 | ||
173 | border.color: Kube.Colors.buttonColor | ||
174 | } | ||
175 | } | 150 | } |
176 | } | 151 | } |
177 | } | 152 | } |