mirror of
https://github.com/noctalia-dev/noctalia-shell.git
synced 2026-05-11 17:08:27 +08:00
refactor(settings): remove redundant right-click option from control center
This commit is contained in:
@@ -248,7 +248,6 @@
|
||||
},
|
||||
"controlCenter": {
|
||||
"position": "close_to_bar_button",
|
||||
"openAtMouseOnBarRightClick": true,
|
||||
"diskPath": "/",
|
||||
"shortcuts": {
|
||||
"left": [
|
||||
|
||||
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
@@ -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 {}
|
||||
}
|
||||
|
||||
@@ -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 {
|
||||
|
||||
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user