From 0d986b9cfd400d774a540b80255d9cd53235cb5e Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Tue, 14 Jun 2016 12:03:19 -0700 Subject: QML UI: show an empty dive list with explanation If the credentials are valid we should show the dive list. If there are no dives, simply say so. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveList.qml | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/mobile-widgets/qml/DiveList.qml b/mobile-widgets/qml/DiveList.qml index 223afdce4..e405bcb79 100644 --- a/mobile-widgets/qml/DiveList.qml +++ b/mobile-widgets/qml/DiveList.qml @@ -212,7 +212,7 @@ Kirigami.ScrollablePage { ScrollView { id: startPageWrapper anchors.fill: parent - opacity: credentialStatus === QMLManager.NOCLOUD || (diveListView.count > 0 && (credentialStatus === QMLManager.VALID || credentialStatus === QMLManager.VALID_EMAIL)) ? 0 : 1 + opacity: credentialStatus === QMLManager.NOCLOUD || (credentialStatus === QMLManager.VALID || credentialStatus === QMLManager.VALID_EMAIL) ? 0 : 1 visible: opacity > 0 Behavior on opacity { NumberAnimation { duration: Kirigami.Units.shortDuration } } onVisibleChanged: { @@ -273,6 +273,11 @@ Kirigami.ScrollablePage { } } + Kirigami.Label { + text: qsTr("No dives in dive list") + visible: diveListView.visible && diveListView.count === 0 + } + property QtObject addDiveAction: Action { iconName: "list-add" onTriggered: { -- cgit v1.2.3-70-g09d2