Merge pull request #1221 from bokicoder/main

make diskPath option in ControlCenter tab work logically
This commit is contained in:
Lemmy
2026-01-02 10:47:53 -05:00
committed by GitHub
5 changed files with 6 additions and 15 deletions
+1 -1
View File
@@ -192,6 +192,7 @@
},
"controlCenter": {
"position": "close_to_bar_button",
"diskPath": "/",
"shortcuts": {
"left": [
{
@@ -271,7 +272,6 @@
"useCustomColors": false,
"warningColor": "",
"criticalColor": "",
"diskPath": "/",
"externalMonitor": "resources || missioncenter || jdsystemmonitor || corestats || system-monitoring-center || gnome-system-monitor || plasma-systemmonitor || mate-system-monitor || ukui-system-monitor || deepin-system-monitor || pantheon-system-monitor"
},
"dock": {
+1 -1
View File
@@ -415,6 +415,7 @@ Singleton {
property JsonObject controlCenter: JsonObject {
// Position: close_to_bar_button, center, top_left, top_right, bottom_left, bottom_right, bottom_center, top_center
property string position: "close_to_bar_button"
property string diskPath: "/"
property JsonObject shortcuts
shortcuts: JsonObject {
property list<var> left: [
@@ -497,7 +498,6 @@ Singleton {
property bool useCustomColors: false
property string warningColor: ""
property string criticalColor: ""
property string diskPath: "/"
property string externalMonitor: "resources || missioncenter || jdsystemmonitor || corestats || system-monitoring-center || gnome-system-monitor || plasma-systemmonitor || mate-system-monitor || ukui-system-monitor || deepin-system-monitor || pantheon-system-monitor"
}
+1 -9
View File
@@ -10,15 +10,7 @@ import qs.Widgets
NBox {
id: root
// Get diskPath from bar's SystemMonitor widget if available, otherwise use settings
readonly property string diskPath: {
const sysMonWidget = BarService.lookupWidget("SystemMonitor");
if (sysMonWidget && sysMonWidget.diskPath) {
return sysMonWidget.diskPath;
}
return Settings.data.systemMonitor.diskPath || "/";
}
readonly property string diskPath: Settings.data.controlCenter.diskPath || "/"
readonly property real contentScale: 0.95 * Style.uiScaleRatio
Item {
@@ -150,7 +150,6 @@ ColumnLayout {
Layout.fillWidth: true
label: I18n.tr("bar.widget-settings.system-monitor.disk-path.label")
description: I18n.tr("bar.widget-settings.system-monitor.disk-path.description")
visible: valueShowDiskUsage
model: {
const paths = Object.keys(SystemStatService.diskPercents).sort();
return paths.map(path => ({
@@ -184,10 +184,10 @@ ColumnLayout {
name: path
}));
}
currentKey: Settings.data.systemMonitor.diskPath || "/"
onSelected: key => Settings.data.systemMonitor.diskPath = key
currentKey: Settings.data.controlCenter.diskPath || "/"
onSelected: key => Settings.data.controlCenter.diskPath = key
isSettings: true
defaultValue: Settings.getDefaultValue("systemMonitor.diskPath") || "/"
defaultValue: Settings.getDefaultValue("controlCenter.diskPath") || "/"
}
}