summaryrefslogtreecommitdiffstats
path: root/mobile-widgets
diff options
context:
space:
mode:
authorGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-10 15:50:08 -0800
committerGravatar Dirk Hohndel <dirk@hohndel.org>2021-01-10 15:57:39 -0800
commit669cbdaac58453f3d2c3219269a3eca43e73abea (patch)
treea7eb9a7817f5ccfd6c89c271dc8a5952b80dfccf /mobile-widgets
parent7fc2071059511cf1727c5562439ad32c240de2ba (diff)
downloadsubsurface-669cbdaac58453f3d2c3219269a3eca43e73abea.tar.gz
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 <dirk@hohndel.org>
Diffstat (limited to 'mobile-widgets')
-rw-r--r--mobile-widgets/qml/DiveDetailsView.qml8
-rw-r--r--mobile-widgets/qml/main.qml4
2 files changed, 12 insertions, 0 deletions
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