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 {
 | 
			
		||||
    id: rootObj
 | 
			
		||||
    objectName: "rootObj"
 | 
			
		||||
    width: 500
 | 
			
		||||
    height: 500
 | 
			
		||||
 | 
			
		||||
    property bool poolMode: false;
 | 
			
		||||
 | 
			
		||||
    signal downloadFinished()
 | 
			
		||||
    signal downloadRequested(url url)
 | 
			
		||||
    signal downloadStarted()
 | 
			
		||||
    signal fileInfo(url name, var tags)
 | 
			
		||||
 | 
			
		||||
 | 
			
		||||
    KRun {
 | 
			
		||||
        id: runner
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    signal downloadRequested(url url)
 | 
			
		||||
    signal fileInfo(url name, var tags)
 | 
			
		||||
    onDownloadFinished: {
 | 
			
		||||
        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 {
 | 
			
		||||
        // This is just for testing
 | 
			
		||||
| 
						 | 
				
			
			@ -206,7 +228,8 @@ Rectangle {
 | 
			
		|||
            onAtYEndChanged: {
 | 
			
		||||
 | 
			
		||||
                if (grid.atYEnd && danbooruModel.rowCount() > 0 && !rootObj.poolMode && infiniteScroll) {
 | 
			
		||||
                     danbooruService.nextPostPage();
 | 
			
		||||
                    rootObj.downloadStarted()
 | 
			
		||||
                    danbooruService.nextPostPage();
 | 
			
		||||
                }
 | 
			
		||||
            }
 | 
			
		||||
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue