From ee210c3bcdbbe174c6b519896fd1b3e3c3d8ec03 Mon Sep 17 00:00:00 2001 From: Joakim Bygdell Date: Thu, 20 Jul 2017 21:53:42 +0200 Subject: QML UI: enable auto-save on settings page Automatically save changes made on the settings page on completion of text fields or theme checkboxes. Signed-off-by: Joakim Bygdell --- mobile-widgets/qml/Settings.qml | 14 ++++++++++++++ 1 file changed, 14 insertions(+) (limited to 'mobile-widgets') diff --git a/mobile-widgets/qml/Settings.qml b/mobile-widgets/qml/Settings.qml index 5e4553518..4cd28bb14 100644 --- a/mobile-widgets/qml/Settings.qml +++ b/mobile-widgets/qml/Settings.qml @@ -106,6 +106,8 @@ Kirigami.ScrollablePage { checked: subsurfaceTheme.currentTheme === "Blue" onClicked: { blueTheme() + manager.theme = subsurfaceTheme.currentTheme + manager.savePreferences() } indicator: Rectangle { implicitWidth: 20 @@ -175,6 +177,8 @@ Kirigami.ScrollablePage { Layout.preferredWidth: settingsPage.col4Width onClicked: { pinkTheme() + manager.theme = subsurfaceTheme.currentTheme + manager.savePreferences() } indicator: Rectangle { implicitWidth: 20 @@ -244,6 +248,8 @@ Kirigami.ScrollablePage { Layout.preferredWidth: settingsPage.col4Width onClicked: { darkTheme() + manager.theme = subsurfaceTheme.currentTheme + manager.savePreferences() } indicator: Rectangle { implicitWidth: 20 @@ -296,6 +302,10 @@ Kirigami.ScrollablePage { id: distanceThreshold text: manager.distanceThreshold Layout.preferredWidth: settingsPage.col4Width + onEditingFinished: { + manager.distanceThreshold = distanceThreshold.text + manager.savePreferences() + } } Kirigami.Label { @@ -308,6 +318,10 @@ Kirigami.ScrollablePage { id: timeThreshold text: manager.timeThreshold Layout.preferredWidth: settingsPage.col4Width + onEditingFinished: { + manager.timeThreshold = timeThreshold.text + manager.savePreferences() + } } Kirigami.Label { -- cgit v1.2.3-70-g09d2