From ef166d8ea7a6592017913f1c6cf958bb96f81dfd Mon Sep 17 00:00:00 2001 From: tibssy Date: Tue, 3 Mar 2026 02:43:10 +0000 Subject: [PATCH] refactor(settings): remove redundant right-click option from control center --- Assets/settings-default.json | 1 - Assets/settings-search-index.json | 9 -------- Commons/Migrations/Migration55.qml | 22 +++++++++++++++++++ Commons/Migrations/MigrationRegistry.qml | 4 +++- Commons/Settings.qml | 3 +-- .../Tabs/ControlCenter/AppearanceSubTab.qml | 8 ------- 6 files changed, 26 insertions(+), 21 deletions(-) create mode 100644 Commons/Migrations/Migration55.qml diff --git a/Assets/settings-default.json b/Assets/settings-default.json index c9133fe7c..ca2a5f32f 100644 --- a/Assets/settings-default.json +++ b/Assets/settings-default.json @@ -248,7 +248,6 @@ }, "controlCenter": { "position": "close_to_bar_button", - "openAtMouseOnBarRightClick": true, "diskPath": "/", "shortcuts": { "left": [ diff --git a/Assets/settings-search-index.json b/Assets/settings-search-index.json index 154398835..23ce77bda 100644 --- a/Assets/settings-search-index.json +++ b/Assets/settings-search-index.json @@ -584,15 +584,6 @@ "subTab": 0, "subTabLabel": "common.appearance" }, - { - "labelKey": "panels.control-center.open-at-mouse-label", - "descriptionKey": "panels.control-center.open-at-mouse-description", - "widget": "NToggle", - "tab": 7, - "tabLabel": "panels.control-center.title", - "subTab": 0, - "subTabLabel": "common.appearance" - }, { "labelKey": "panels.control-center.system-monitor-disk-path-label", "descriptionKey": "panels.control-center.system-monitor-disk-path-description", diff --git a/Commons/Migrations/Migration55.qml b/Commons/Migrations/Migration55.qml new file mode 100644 index 000000000..dcb249df3 --- /dev/null +++ b/Commons/Migrations/Migration55.qml @@ -0,0 +1,22 @@ +import QtQuick + +QtObject { + id: root + + function migrate(adapter, logger, rawJson) { + logger.i("Settings", "Migrating settings to v55"); + + // Check if the old setting exists + if (rawJson.controlCenter && rawJson.controlCenter.openAtMouseOnBarRightClick !== undefined) { + + if (!rawJson.bar) rawJson.bar = {}; + + rawJson.bar.rightClickFollowMouse = rawJson.controlCenter.openAtMouseOnBarRightClick; + delete rawJson.controlCenter.openAtMouseOnBarRightClick; + + logger.i("Settings", "Successfully moved openAtMouseOnBarRightClick to bar.rightClickFollowMouse"); + } + + return true; + } +} diff --git a/Commons/Migrations/MigrationRegistry.qml b/Commons/Migrations/MigrationRegistry.qml index 0ff2a5681..72f8943e6 100644 --- a/Commons/Migrations/MigrationRegistry.qml +++ b/Commons/Migrations/MigrationRegistry.qml @@ -26,7 +26,8 @@ QtObject { 49: migration49Component, 50: migration50Component, 53: migration53Component, - 54: migration54Component + 54: migration54Component, + 55: migration55Component }) // Migration components @@ -50,4 +51,5 @@ QtObject { property Component migration50Component: Migration50 {} property Component migration53Component: Migration53 {} property Component migration54Component: Migration54 {} + property Component migration55Component: Migration55 {} } diff --git a/Commons/Settings.qml b/Commons/Settings.qml index 336ed3659..92a3ce318 100644 --- a/Commons/Settings.qml +++ b/Commons/Settings.qml @@ -25,7 +25,7 @@ Singleton { - Default cache directory: ~/.cache/noctalia */ readonly property alias data: adapter // Used to access via Settings.data.xxx.yyy - readonly property int settingsVersion: 54 + readonly property int settingsVersion: 55 property bool isDebug: Quickshell.env("NOCTALIA_DEBUG") === "1" readonly property string shellName: "noctalia" readonly property string configDir: Quickshell.env("NOCTALIA_CONFIG_DIR") || (Quickshell.env("XDG_CONFIG_HOME") || Quickshell.env("HOME") + "/.config") + "/" + shellName + "/" @@ -442,7 +442,6 @@ 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 bool openAtMouseOnBarRightClick: true property string diskPath: "/" property JsonObject shortcuts shortcuts: JsonObject { diff --git a/Modules/Panels/Settings/Tabs/ControlCenter/AppearanceSubTab.qml b/Modules/Panels/Settings/Tabs/ControlCenter/AppearanceSubTab.qml index dc7055f69..279d0d160 100644 --- a/Modules/Panels/Settings/Tabs/ControlCenter/AppearanceSubTab.qml +++ b/Modules/Panels/Settings/Tabs/ControlCenter/AppearanceSubTab.qml @@ -63,14 +63,6 @@ ColumnLayout { defaultValue: Settings.getDefaultValue("controlCenter.position") } - NToggle { - label: I18n.tr("panels.control-center.open-at-mouse-label") - description: I18n.tr("panels.control-center.open-at-mouse-description") - checked: Settings.data.controlCenter.openAtMouseOnBarRightClick - onToggled: checked => Settings.data.controlCenter.openAtMouseOnBarRightClick = checked - defaultValue: Settings.getDefaultValue("controlCenter.openAtMouseOnBarRightClick") - } - NComboBox { id: diskPathComboBox Layout.fillWidth: true