From 669cbdaac58453f3d2c3219269a3eca43e73abea Mon Sep 17 00:00:00 2001 From: Dirk Hohndel Date: Sun, 10 Jan 2021 15:50:08 -0800 Subject: mobile/UI: add signal to redraw profile This allows us to force a redraw of the dive profile when settings change that require a refresh of the profile. Signed-off-by: Dirk Hohndel --- mobile-widgets/qml/DiveDetailsView.qml | 8 ++++++++ mobile-widgets/qml/main.qml | 4 ++++ 2 files changed, 12 insertions(+) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qml/DiveDetailsView.qml b/mobile-widgets/qml/DiveDetailsView.qml index b5aeb0249..fa0ebfb3f 100644 --- a/mobile-widgets/qml/DiveDetailsView.qml +++ b/mobile-widgets/qml/DiveDetailsView.qml @@ -16,6 +16,14 @@ Item { width: diveDetailsPage.width - diveDetailsPage.leftPadding - diveDetailsPage.rightPadding height: divePlate.implicitHeight + bottomLayout.implicitHeight + Kirigami.Units.iconSizes.large + + Connections { + target: rootItem + onSettingsChanged: { + qmlProfile.update() + } + } + Rectangle { z: 99 color: subsurfaceTheme.textColor diff --git a/mobile-widgets/qml/main.qml b/mobile-widgets/qml/main.qml index 915cecc26..298b746c9 100644 --- a/mobile-widgets/qml/main.qml +++ b/mobile-widgets/qml/main.qml @@ -46,6 +46,10 @@ Kirigami.ApplicationWindow { property string filterPattern: "" property int colWidth: undefined + // signal that the profile (and possibly other code) listens to so they + // can redraw if settings are changed + signal settingsChanged() + onNotificationTextChanged: { // once the app is fully initialized and the UI is running, we use passive // notifications to show the notification text, but during initialization -- cgit v1.2.3-70-g09d2