@@ -18,6 +18,7 @@ import QtQuick 2.0
18import Ubuntu.Components 0.1
18import Ubuntu.Components 0.1
19import Ubuntu.Components.Popups 0.1
19import Ubuntu.Components.Popups 0.1
20import Ubuntu.Components.ListItems 0.1 as ListItem
20import Ubuntu.Components.ListItems 0.1 as ListItem
@@ -30,6 +31,8 @@ Item {
30 property bool searchEntryEnabled: false
31 property bool searchEntryEnabled: false
31 property alias searchQuery: searchField.text
32 property alias searchQuery: searchField.text
32 property ListModel searchHistory: SearchHistoryModel {}
33 property ListModel searchHistory: SearchHistoryModel {}
35+ property bool searchInProgress: false
34 height: units.gu(8.5)
37 height: units.gu(8.5)
35 implicitHeight: units.gu(8.5)
38 implicitHeight: units.gu(8.5)
@@ -46,6 +49,11 @@ Item {
46 searchField.focus = false;
49 searchField.focus = false;
54+ onSearchInProgressChanged: searchInProgress = scope.searchInProgress
49 Connections {
57 Connections {
50 target: greeter
58 target: greeter
51 onShownChanged: if (shown) resetSearch()
59 onShownChanged: if (shown) resetSearch()
@@ -148,7 +156,7 @@ Item {
148 hasClearButton: false
156 hasClearButton: false
150 primaryItem: AbstractButton {
158 primaryItem: AbstractButton {
151− enabled: searchField.text != ""
159+ enabled: searchField.text != "" && !searchIndicator.running
152 onClicked: {
160 onClicked: {
153 if (searchField.text != "") {
161 if (searchField.text != "") {
154 searchHistory.addQuery(searchField.text)
162 searchHistory.addQuery(searchField.text)
@@ -158,6 +166,22 @@ Item {
158 height: parent.height
166 height: parent.height
159 width: height
167 width: height
171+ objectName: "searchIndicator"
174+ verticalCenter: parent.verticalCenter
176+ leftMargin: units.gu(0.5)
179+ running: searchInProgress && searchField.text !== ""
180+ opacity: running ? 1 : 0
182+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing.type: Easing.Linear } }
162 id: primaryImage
186 id: primaryImage
163 anchors {
187 anchors {
@@ -167,6 +191,10 @@ Item {
168 width: units.gu(3)
192 width: units.gu(3)
169 height: units.gu(3)
193 height: units.gu(3)
194+ visible: opacity > 0
195+ opacity: searchIndicator.running ? 0 : 1
197+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing.type: Easing.Linear } }