@@ -18,6 +18,7 @@ import QtQuick 2.0
1818import Ubuntu.Components 0.1
1919import Ubuntu.Components.Popups 0.1
2020import Ubuntu.Components.ListItems 0.1 as ListItem
21+import Unity 0.1
2122
2223Item {
2324 /*!
@@ -30,6 +31,7 @@ Item {
3031 property bool searchEntryEnabled: false
3132 property alias searchQuery: searchField.text
3233 property ListModel searchHistory: SearchHistoryModel {}
34+ property Scope scope
3335
3436 height: units.gu(8.5)
3537 implicitHeight: units.gu(8.5)
@@ -148,7 +150,7 @@ Item {
148150 hasClearButton: false
149151
150152 primaryItem: AbstractButton {
151− enabled: searchField.text != ""
153+ enabled: searchField.text != "" && !searchIndicator.running
152154 onClicked: {
153155 if (searchField.text != "") {
154156 searchHistory.addQuery(searchField.text)
@@ -158,8 +160,25 @@ Item {
158160 height: parent.height
159161 width: height
160162
163+ ActivityIndicator {
164+ id: searchIndicator
165+ objectName: "searchIndicator"
166+
167+ anchors {
168+ verticalCenter: parent.verticalCenter
169+ left: parent.left
170+ leftMargin: units.gu(0.5)
171+ }
172+
173+ running: scope.searchInProgress && searchField.text !== ""
174+ opacity: running ? 1 : 0
175+
176+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing.type: Easing.Linear } }
177+ }
178+
161179 Image {
162180 id: primaryImage
181+ objectName: "primaryImage"
163182 anchors {
164183 verticalCenter: parent.verticalCenter
165184 left: parent.left
@@ -167,6 +186,10 @@ Item {
167186 }
168187 width: units.gu(3)
169188 height: units.gu(3)
189+ visible: opacity > 0
190+ opacity: searchIndicator.running ? 0 : 1
191+
192+ Behavior on opacity { NumberAnimation { duration: UbuntuAnimation.SnapDuration; easing.type: Easing.Linear } }
170193 }
171194
172195 Item {