From a3189a9b3ea8c3af13ca0c7c3fcfb3da42da787d Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 14 Feb 2016 16:27:41 -0800 Subject: [PATCH] QML UI: don't show an odd profile for zero duration dive A dive with zero duration creates an odd profile that is 2min 30seconds long and looks just weird. Instead, simply show a text that there is on profile shown for such a dive. Signed-off-by: Dirk Hohndel --- qt-mobile/qml/DiveDetailsView.qml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/qt-mobile/qml/DiveDetailsView.qml b/qt-mobile/qml/DiveDetailsView.qml index 7e678c5c3..56d524f1f 100644 --- a/qt-mobile/qml/DiveDetailsView.qml +++ b/qt-mobile/qml/DiveDetailsView.qml @@ -111,6 +111,7 @@ Item { QMLProfile { id: qmlProfile + visible: !dive.noDive Layout.fillWidth: true Layout.preferredHeight: Layout.minimumHeight Layout.minimumHeight: width * 0.75 @@ -125,6 +126,15 @@ Item { anchors.fill: parent } } + MobileComponents.Label { + id: noProfile + visible: dive.noDive + Layout.fillWidth: true + Layout.columnSpan: 4 + Layout.margins: MobileComponents.Units.gridUnit + horizontalAlignment: Text.AlignHCenter + text: "No profile show for empty dive" + } } GridLayout { id: bottomLayout