From 1228dec19f7d26886498d6a0dd0e7e1cc543c611 Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Mon, 21 Dec 2020 04:38:48 -0800 Subject: mobile/profile: directly set up the diveId The weird 'Component.onCompleted' always felt like the wrong way to do this. Setting this directly from the model seems like the much cleaner solution. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetails.qml | 1 + mobile-widgets/qml/DiveDetailsView.qml | 7 ++----- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/mobile-widgets/qml/DiveDetails.qml b/mobile-widgets/qml/DiveDetails.qml index a71b85d12..71fad0a65 100644 --- a/mobile-widgets/qml/DiveDetails.qml +++ b/mobile-widgets/qml/DiveDetails.qml @@ -411,6 +411,7 @@ Kirigami.Page { DiveDetailsView { id: diveDetails width: internalScrollView.width + myId: model.id } ScrollBar.vertical: ScrollBar { } } diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index bd6fbbd89..b5aeb0249 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -12,6 +12,7 @@ Item { property real col1Width: gridWidth * 0.40 property real col2Width: gridWidth * 0.30 property real col3Width: gridWidth * 0.30 + property int myId: -1 width: diveDetailsPage.width - diveDetailsPage.leftPadding - diveDetailsPage.rightPadding height: divePlate.implicitHeight + bottomLayout.implicitHeight + Kirigami.Units.iconSizes.large @@ -229,6 +230,7 @@ Item { anchors.fill: parent clip: true property real lastScale: 1.0 // final scale at the end of previous pinch + diveId: detailsView.myId Rectangle { color: "transparent" opacity: 0.6 @@ -573,10 +575,5 @@ Item { Layout.fillWidth: true Layout.minimumHeight: Kirigami.Units.gridUnit * 6 } - Component.onCompleted: { - qmlProfile.setMargin(Kirigami.Units.smallSpacing) - qmlProfile.diveId = model.id; - qmlProfile.update(); - } } } -- cgit v1.2.3-70-g09d2