Add a busy indicator which will be overlaid during download
This gives some visual feedback to the post / pool download.
This commit is contained in:
parent
b6d71f3cbf
commit
59ccfb3aac
1 changed files with 26 additions and 3 deletions
|
@ -29,17 +29,39 @@ import DanbooruClient 1.0
|
||||||
|
|
||||||
Rectangle {
|
Rectangle {
|
||||||
id: rootObj
|
id: rootObj
|
||||||
|
objectName: "rootObj"
|
||||||
width: 500
|
width: 500
|
||||||
height: 500
|
height: 500
|
||||||
|
|
||||||
property bool poolMode: false;
|
property bool poolMode: false;
|
||||||
|
|
||||||
|
signal downloadFinished()
|
||||||
|
signal downloadRequested(url url)
|
||||||
|
signal downloadStarted()
|
||||||
|
signal fileInfo(url name, var tags)
|
||||||
|
|
||||||
|
|
||||||
KRun {
|
KRun {
|
||||||
id: runner
|
id: runner
|
||||||
}
|
}
|
||||||
|
|
||||||
signal downloadRequested(url url)
|
onDownloadFinished: {
|
||||||
signal fileInfo(url name, var tags)
|
runningIndicator.running = false
|
||||||
|
}
|
||||||
|
|
||||||
|
onDownloadStarted: {
|
||||||
|
runningIndicator.running = true
|
||||||
|
}
|
||||||
|
|
||||||
|
BusyIndicator {
|
||||||
|
id: runningIndicator
|
||||||
|
z: 1
|
||||||
|
width: grid.cellWidth / 2
|
||||||
|
height: grid.cellHeight / 2
|
||||||
|
anchors.horizontalCenter: parent.horizontalCenter
|
||||||
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
running: false
|
||||||
|
}
|
||||||
|
|
||||||
Component {
|
Component {
|
||||||
// This is just for testing
|
// This is just for testing
|
||||||
|
@ -206,6 +228,7 @@ Rectangle {
|
||||||
onAtYEndChanged: {
|
onAtYEndChanged: {
|
||||||
|
|
||||||
if (grid.atYEnd && danbooruModel.rowCount() > 0 && !rootObj.poolMode && infiniteScroll) {
|
if (grid.atYEnd && danbooruModel.rowCount() > 0 && !rootObj.poolMode && infiniteScroll) {
|
||||||
|
rootObj.downloadStarted()
|
||||||
danbooruService.nextPostPage();
|
danbooruService.nextPostPage();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue