2019-05-11 15:21:43 +02:00
|
|
|
/*
|
|
|
|
blueROCK - for digital rock
|
|
|
|
Copyright (C) 2019 Dorian Zedler
|
|
|
|
|
|
|
|
This program is free software: you can redistribute it and/or modify
|
|
|
|
it under the terms of the GNU General Public License as published by
|
|
|
|
the Free Software Foundation, either version 3 of the License, or
|
|
|
|
(at your option) any later version.
|
|
|
|
|
|
|
|
This program is distributed in the hope that it will be useful,
|
|
|
|
but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
GNU General Public License for more details.
|
|
|
|
|
|
|
|
You should have received a copy of the GNU General Public License
|
|
|
|
along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*/
|
|
|
|
|
2019-04-20 22:57:40 +02:00
|
|
|
import QtQuick 2.9
|
|
|
|
import QtQuick.Controls 2.4
|
|
|
|
|
|
|
|
ListView {
|
|
|
|
id: control
|
|
|
|
|
|
|
|
property int status: -1
|
2019-05-11 15:16:23 +02:00
|
|
|
property bool loading: false
|
2019-07-04 09:03:39 +02:00
|
|
|
property var listData
|
|
|
|
property var emptyProperties: []
|
2019-07-04 23:00:43 +02:00
|
|
|
property bool useBuiltInPullRefresher: true
|
2019-04-20 22:57:40 +02:00
|
|
|
|
|
|
|
signal refresh()
|
|
|
|
|
2019-05-31 12:18:35 +02:00
|
|
|
anchors {
|
|
|
|
leftMargin: 10
|
|
|
|
rightMargin: 14
|
|
|
|
}
|
2019-04-20 22:57:40 +02:00
|
|
|
|
2019-05-11 15:16:23 +02:00
|
|
|
clip: true
|
2019-04-21 12:35:11 +02:00
|
|
|
|
2019-05-11 15:16:23 +02:00
|
|
|
//enabled: status === 200 || status === 902
|
|
|
|
//opacity: enabled ? 1:0
|
2019-04-21 12:35:11 +02:00
|
|
|
|
2019-04-20 22:57:40 +02:00
|
|
|
ScrollBar.vertical: ScrollBar {
|
|
|
|
parent: control.parent
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
top: control.top
|
|
|
|
left: control.right
|
|
|
|
margins: 10
|
|
|
|
leftMargin: 3
|
|
|
|
bottom: control.bottom
|
|
|
|
}
|
|
|
|
|
|
|
|
width: 8
|
|
|
|
|
2019-04-21 12:35:11 +02:00
|
|
|
visible: control.model > 0
|
|
|
|
|
2019-04-20 22:57:40 +02:00
|
|
|
active: true
|
|
|
|
}
|
|
|
|
|
2019-05-11 15:16:23 +02:00
|
|
|
Behavior on opacity {
|
2019-04-21 12:35:11 +02:00
|
|
|
NumberAnimation {
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-05-11 15:16:23 +02:00
|
|
|
PullRefresher {
|
|
|
|
target: control
|
|
|
|
|
2019-07-04 23:00:43 +02:00
|
|
|
visible: control.useBuiltInPullRefresher
|
|
|
|
|
2019-05-11 15:16:23 +02:00
|
|
|
postRefreshDelay: 0
|
|
|
|
|
|
|
|
busyIndicator: FancyBusyIndicator {}
|
2019-05-31 12:18:35 +02:00
|
|
|
refreshPosition: height * 1.3
|
2019-05-11 15:16:23 +02:00
|
|
|
|
|
|
|
onRefreshRequested: {
|
2019-07-04 23:00:43 +02:00
|
|
|
if(control.useBuiltInPullRefresher) {
|
|
|
|
control.refresh()
|
|
|
|
}
|
2019-05-11 15:16:23 +02:00
|
|
|
}
|
|
|
|
}
|
2019-04-20 22:57:40 +02:00
|
|
|
}
|