From 3e0360401bbbb0f640958998f6625495e5b3fdff Mon Sep 17 00:00:00 2001 From: Robin Seger Date: Tue, 10 Mar 2026 15:22:23 +0100 Subject: dashboard: dynamic dashboard tabs + fix performance settings updating (#1253) * [CI] chore: update flake * Dashboard perf settings save, visibility on none enabled * Dashboard heigh stutter fixed, persist current tab * restore binding * wrapper async=false * ScriptModel, centralized tabs/panes, individual toggle * fixes, missed mediaUpdateInterval, passing values --------- Co-authored-by: github-actions <41898282+github-actions[bot]@users.noreply.github.com> --- modules/controlcenter/dashboard/GeneralSection.qml | 105 +++++++++++++++------ 1 file changed, 76 insertions(+), 29 deletions(-) (limited to 'modules/controlcenter/dashboard/GeneralSection.qml') diff --git a/modules/controlcenter/dashboard/GeneralSection.qml b/modules/controlcenter/dashboard/GeneralSection.qml index bf54e97..95e7531 100644 --- a/modules/controlcenter/dashboard/GeneralSection.qml +++ b/modules/controlcenter/dashboard/GeneralSection.qml @@ -38,44 +38,91 @@ SectionContainer { } } - SectionContainer { - contentSpacing: Appearance.spacing.normal + RowLayout { + Layout.fillWidth: true + spacing: Appearance.spacing.normal - SliderInput { + SwitchRow { Layout.fillWidth: true - - label: qsTr("Update interval") - value: root.rootItem.updateInterval - from: 100 - to: 10000 - stepSize: 100 - suffix: "ms" - validator: IntValidator { bottom: 100; top: 10000 } - formatValueFunction: (val) => Math.round(val).toString() - parseValueFunction: (text) => parseInt(text) - - onValueModified: (newValue) => { - root.rootItem.updateInterval = Math.round(newValue); + label: qsTr("Show Dashboard tab") + checked: root.rootItem.showDashboard + onToggled: checked => { + root.rootItem.showDashboard = checked; root.rootItem.saveConfig(); } } - SliderInput { + SwitchRow { Layout.fillWidth: true - - label: qsTr("Drag threshold") - value: root.rootItem.dragThreshold - from: 0 - to: 100 - suffix: "px" - validator: IntValidator { bottom: 0; top: 100 } - formatValueFunction: (val) => Math.round(val).toString() - parseValueFunction: (text) => parseInt(text) - - onValueModified: (newValue) => { - root.rootItem.dragThreshold = Math.round(newValue); + label: qsTr("Show Media tab") + checked: root.rootItem.showMedia + onToggled: checked => { + root.rootItem.showMedia = checked; root.rootItem.saveConfig(); } } + + SwitchRow { + Layout.fillWidth: true + label: qsTr("Show Performance tab") + checked: root.rootItem.showPerformance + onToggled: checked => { + root.rootItem.showPerformance = checked; + root.rootItem.saveConfig(); + } + } + + SwitchRow { + Layout.fillWidth: true + label: qsTr("Show Weather tab") + checked: root.rootItem.showWeather + onToggled: checked => { + root.rootItem.showWeather = checked; + root.rootItem.saveConfig(); + } + } + } + + SliderInput { + Layout.fillWidth: true + + label: qsTr("Media update interval") + value: root.rootItem.mediaUpdateInterval + from: 100 + to: 10000 + stepSize: 100 + suffix: "ms" + validator: IntValidator { + bottom: 100 + top: 10000 + } + formatValueFunction: val => Math.round(val).toString() + parseValueFunction: text => parseInt(text) + + onValueModified: newValue => { + root.rootItem.mediaUpdateInterval = Math.round(newValue); + root.rootItem.saveConfig(); + } + } + + SliderInput { + Layout.fillWidth: true + + label: qsTr("Drag threshold") + value: root.rootItem.dragThreshold + from: 0 + to: 100 + suffix: "px" + validator: IntValidator { + bottom: 0 + top: 100 + } + formatValueFunction: val => Math.round(val).toString() + parseValueFunction: text => parseInt(text) + + onValueModified: newValue => { + root.rootItem.dragThreshold = Math.round(newValue); + root.rootItem.saveConfig(); + } } } -- cgit v1.2.3-freya