diff options
Diffstat (limited to 'modules/controlcenter/dashboard')
| -rw-r--r-- | modules/controlcenter/dashboard/DashboardPane.qml | 20 | ||||
| -rw-r--r-- | modules/controlcenter/dashboard/GeneralSection.qml | 105 | ||||
| -rw-r--r-- | modules/controlcenter/dashboard/PerformanceSection.qml | 45 |
3 files changed, 125 insertions, 45 deletions
diff --git a/modules/controlcenter/dashboard/DashboardPane.qml b/modules/controlcenter/dashboard/DashboardPane.qml index 72e3e6e..df29f09 100644 --- a/modules/controlcenter/dashboard/DashboardPane.qml +++ b/modules/controlcenter/dashboard/DashboardPane.qml @@ -22,15 +22,22 @@ Item { // General Settings property bool enabled: Config.dashboard.enabled ?? true property bool showOnHover: Config.dashboard.showOnHover ?? true - property int updateInterval: Config.dashboard.updateInterval ?? 1000 + property int mediaUpdateInterval: Config.dashboard.mediaUpdateInterval ?? 1000 + property int resourceUpdateInterval: Config.dashboard.resourceUpdateInterval ?? 1000 property int dragThreshold: Config.dashboard.dragThreshold ?? 50 - + + // Dashboard Tabs + property bool showDashboard: Config.dashboard.showDashboard ?? true + property bool showMedia: Config.dashboard.showMedia ?? true + property bool showPerformance: Config.dashboard.showPerformance ?? true + property bool showWeather: Config.dashboard.showWeather ?? true + // Performance Resources property bool showBattery: Config.dashboard.performance.showBattery ?? false property bool showGpu: Config.dashboard.performance.showGpu ?? true property bool showCpu: Config.dashboard.performance.showCpu ?? true property bool showMemory: Config.dashboard.performance.showMemory ?? true - property bool showStorage: Config.dashboard.performance.showStorage ?? true + property bool showStorage: Config.dashboard.performance.showStorage ?? true property bool showNetwork: Config.dashboard.performance.showNetwork ?? true anchors.fill: parent @@ -38,8 +45,13 @@ Item { function saveConfig() { Config.dashboard.enabled = root.enabled; Config.dashboard.showOnHover = root.showOnHover; - Config.dashboard.updateInterval = root.updateInterval; + Config.dashboard.mediaUpdateInterval = root.mediaUpdateInterval; + Config.dashboard.resourceUpdateInterval = root.resourceUpdateInterval; Config.dashboard.dragThreshold = root.dragThreshold; + Config.dashboard.showDashboard = root.showDashboard; + Config.dashboard.showMedia = root.showMedia; + Config.dashboard.showPerformance = root.showPerformance; + Config.dashboard.showWeather = root.showWeather; Config.dashboard.performance.showBattery = root.showBattery; Config.dashboard.performance.showGpu = root.showGpu; Config.dashboard.performance.showCpu = root.showCpu; 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(); + } } } diff --git a/modules/controlcenter/dashboard/PerformanceSection.qml b/modules/controlcenter/dashboard/PerformanceSection.qml index 7e72782..ac84752 100644 --- a/modules/controlcenter/dashboard/PerformanceSection.qml +++ b/modules/controlcenter/dashboard/PerformanceSection.qml @@ -33,7 +33,7 @@ SectionContainer { opts.push({ "label": qsTr("Battery"), "propertyName": "showBattery", - "onToggled": function(checked) { + "onToggled": function (checked) { root.rootItem.showBattery = checked; root.rootItem.saveConfig(); } @@ -41,39 +41,39 @@ SectionContainer { if (root.gpuAvailable) opts.push({ - "label": qsTr("GPU"), - "propertyName": "showGpu", - "onToggled": function(checked) { - root.rootItem.showGpu = checked; - root.rootItem.saveConfig(); - } - }); + "label": qsTr("GPU"), + "propertyName": "showGpu", + "onToggled": function (checked) { + root.rootItem.showGpu = checked; + root.rootItem.saveConfig(); + } + }); opts.push({ "label": qsTr("CPU"), "propertyName": "showCpu", - "onToggled": function(checked) { + "onToggled": function (checked) { root.rootItem.showCpu = checked; root.rootItem.saveConfig(); } }, { "label": qsTr("Memory"), "propertyName": "showMemory", - "onToggled": function(checked) { + "onToggled": function (checked) { root.rootItem.showMemory = checked; root.rootItem.saveConfig(); } }, { "label": qsTr("Storage"), "propertyName": "showStorage", - "onToggled": function(checked) { + "onToggled": function (checked) { root.rootItem.showStorage = checked; root.rootItem.saveConfig(); } }, { "label": qsTr("Network"), "propertyName": "showNetwork", - "onToggled": function(checked) { + "onToggled": function (checked) { root.rootItem.showNetwork = checked; root.rootItem.saveConfig(); } @@ -82,4 +82,25 @@ SectionContainer { } } + SliderInput { + Layout.fillWidth: true + + label: qsTr("Resource update interval") + value: root.rootItem.resourceUpdateInterval + 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.resourceUpdateInterval = Math.round(newValue); + root.rootItem.saveConfig(); + } + } } |