AusweisApp2/resources/qml/Governikus/HistoryView/+android/HistoryView.qml

65 lines
1.4 KiB
QML
Raw Normal View History

2017-07-03 09:30:10 +02:00
import QtQuick 2.5
2018-03-28 15:10:51 +02:00
import QtQuick.Controls 2.2
2017-07-03 09:30:10 +02:00
import QtQuick.Controls.Styles 1.4
import QtQuick.Layouts 1.2
2018-03-28 15:10:51 +02:00
import QtQuick.Dialogs 1.2
2017-07-03 09:30:10 +02:00
2017-12-20 14:54:05 +01:00
import Governikus.Global 1.0
import Governikus.TitleBar 1.0
2017-07-03 09:30:10 +02:00
SectionPage {
2018-03-28 15:10:51 +02:00
id: rootPage
2017-07-03 09:30:10 +02:00
property alias listViewModel: listView.model
property var selectedIndices: []
2017-12-20 14:54:05 +01:00
headerTitleBarAction: TitleBarAction { text: qsTr("History") + settingsModel.translationTrigger; font.bold: true }
2018-03-28 15:10:51 +02:00
rightTitleBarAction: HistoryContextMenu { historyReminderPopup: deleteHistoryConfirmationDialog }
HistoryViewConfirmationPopup {
id: deleteHistoryConfirmationDialog
baseItem: rootPage
}
2017-07-03 09:30:10 +02:00
Text {
2018-03-28 15:10:51 +02:00
color: Constants.secondary_text
2017-07-03 09:30:10 +02:00
anchors.centerIn: parent
2017-12-20 14:54:05 +01:00
text: qsTr("Currently there are no history entries.") + settingsModel.translationTrigger
2017-07-03 09:30:10 +02:00
wrapMode: Text.WordWrap
2017-07-03 09:33:28 +02:00
font.pixelSize: Constants.normal_font_size
2017-07-03 09:30:10 +02:00
visible: listView.count === 0
}
ListView {
id: listView
anchors.fill: parent
model: historyModel
2017-07-03 09:33:28 +02:00
onContentYChanged: {
if (contentY < 0) {
// prevent flicking over the top
contentY = 0
}
}
2017-07-03 09:30:10 +02:00
delegate:
HistoryListViewDelegate {
id: historyDelegate
anchors.left: parent.left
anchors.right: parent.right
height: Utils.dp(120)
2017-07-03 09:33:28 +02:00
listModel: historyModel
property var historyModelItem: model
2017-07-03 09:30:10 +02:00
showDetail: false
}
}
HistoryViewPage {
id: providerHistoryView
visible: false
}
HistoryViewDetails {
id: detailsHistoryView
visible: false
}
}