Commit 8570cee0 authored by Lamarque Souza's avatar Lamarque Souza
Browse files

Add busy indicator to ViewSearch.qml to indicate ongoing search.

CCBUG: 296958
(cherry picked from commit 29301f97)
parent f1ee2173
......@@ -161,6 +161,7 @@ PlasmaComponents.Page {
onSearchQueryChanged: {
metadataModel.extraParameters["nfo:fileName"] = searchBox.searchQuery
busy = (searchBox.searchQuery.length > 0)
}
}
}
......@@ -182,6 +183,7 @@ PlasmaComponents.Page {
Connections {
target: metadataModel
onModelReset: selectedModel.clear()
onCountChanged: { searchBox.restartBusyTimer() }
}
//This pinch area is for selection
......
......@@ -92,10 +92,16 @@ PlasmaComponents.Page {
}
onSearchQueryChanged: {
metadataModel.extraParameters["nfo:fileName"] = searchBox.searchQuery
busy = (searchBox.searchQuery.length > 0)
}
}
}
Connections {
target: metadataModel
onCountChanged: { searchBox.restartBusyTimer() }
}
MobileComponents.IconGrid {
id: resultsGrid
anchors.fill: parent
......
......@@ -79,6 +79,11 @@ PlasmaCore.FrameSvgItem {
}
onSearchQueryChanged: {
filterModel.filterRegExp = ".*"+searchBox.searchQuery+".*"
busy = (searchBox.searchQuery.length > 0)
}
Connections {
target: filterModel
onCountChanged: { searchBox.restartBusyTimer() }
}
opacity: viewer.scale==1?0:1
Behavior on opacity {
......
......@@ -29,6 +29,7 @@ Item {
property string searchQuery
property int delay : 100
property bool busy: false
onSearchQueryChanged: {
searchField.text = searchQuery
......@@ -47,6 +48,28 @@ Item {
onTextChanged: searchTimer.restart()
}
PlasmaComponents.BusyIndicator {
anchors.verticalCenter: searchField.verticalCenter
anchors.right: searchField.right
anchors.rightMargin: searchFieldContainer.height
height: searchField.height
width: searchField.height
visible: searchFieldContainer.busy
running: searchFieldContainer.busy
}
function restartBusyTimer() {
busyTimer.restart()
}
Timer {
id: busyTimer
repeat: false
interval: 1000
running: false
onTriggered: { searchFieldContainer.busy = false }
}
Timer {
id: searchTimer
interval: delay
......
......@@ -86,6 +86,7 @@ MouseArea {
RunnerModels.RunnerModel {
id: runnerModel
runners: [ "services", "nepomuksearch", "recentdocuments", "desktopsessions" , "PowerDevil", "calculator" ]
onCountChanged: { searchField.restartBusyTimer() }
}
MobileComponents.ViewSearch {
......@@ -104,9 +105,11 @@ MouseArea {
appGrid.model = null
appGrid.model = appsModel
runnerModel.query = ""
busy = false
} else {
appGrid.model = runnerModel
runnerModel.query = searchQuery
busy = true
}
}
......
......@@ -131,6 +131,9 @@ MobileComponents.Sheet {
onSearchQueryChanged: {
if (stack.depth == 1 && searchQuery.length > 3) {
stack.push(globalSearchComponent)
busy = true
} else {
busy = false
}
}
},
......@@ -161,6 +164,7 @@ MobileComponents.Sheet {
stack.pop()
}
}
onCountChanged: { searchField.restartBusyTimer() }
}
}
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment