app/resources/qml/Components/DataListView.qml
2019-05-31 12:18:35 +02:00

91 lines
2.1 KiB
QML

/*
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/>.
*/
import QtQuick 2.9
import QtQuick.Controls 2.4
ListView {
id: control
property int status: -1
property bool loading: false
signal refresh()
anchors {
leftMargin: 10
rightMargin: 14
}
clip: true
//enabled: status === 200 || status === 902
//opacity: enabled ? 1:0
ScrollBar.vertical: ScrollBar {
parent: control.parent
anchors {
top: control.top
left: control.right
margins: 10
leftMargin: 3
bottom: control.bottom
}
width: 8
visible: control.model > 0
active: true
}
Behavior on opacity {
NumberAnimation {
duration: 200
}
}
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
}
excludedCodes: [200, 902, 905]
errorCode: control.status
}
PullRefresher {
target: control
postRefreshDelay: 0
busyIndicator: FancyBusyIndicator {}
refreshPosition: height * 1.3
onRefreshRequested: {
control.refresh()
}
}
}