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-04-20 22:57:40 +02:00
|
|
|
|
|
|
|
signal refresh()
|
|
|
|
|
|
|
|
anchors.margins: 10
|
|
|
|
anchors.rightMargin: 14
|
|
|
|
|
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-04-21 12:35:11 +02:00
|
|
|
|
2019-05-11 15:16:23 +02:00
|
|
|
Behavior on opacity {
|
2019-04-21 12:35:11 +02:00
|
|
|
NumberAnimation {
|
|
|
|
duration: 200
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-04-20 22:57:40 +02:00
|
|
|
InfoArea {
|
|
|
|
id: infoArea
|
|
|
|
|
|
|
|
anchors {
|
|
|
|
left: control.left
|
|
|
|
right: control.right
|
|
|
|
top: control.top
|
|
|
|
margins: app.landscape() ? control.width * 0.4:control.width * 0.3
|
|
|
|
topMargin: control.height*( status === 901 ? 0.6:0.5) - height * 0.8
|
|
|
|
}
|
|
|
|
|
2019-04-21 12:35:11 +02:00
|
|
|
excludedCodes: [200, 902, 905]
|
2019-04-20 22:57:40 +02:00
|
|
|
errorCode: control.status
|
|
|
|
}
|
2019-05-11 15:16:23 +02:00
|
|
|
|
|
|
|
PullRefresher {
|
|
|
|
target: control
|
|
|
|
|
|
|
|
postRefreshDelay: 0
|
|
|
|
|
|
|
|
busyIndicator: FancyBusyIndicator {}
|
|
|
|
|
|
|
|
onRefreshRequested: {
|
|
|
|
control.refresh()
|
|
|
|
}
|
|
|
|
}
|
2019-04-20 22:57:40 +02:00
|
|
|
}
|