UserInterface: add shadow location setting (implements #652)

This commit is contained in:
Ly-sec
2025-11-04 15:08:00 +01:00
parent f3cb4f5095
commit 752c45e0b0
11 changed files with 198 additions and 10 deletions
@@ -47,6 +47,71 @@ ColumnLayout {
onToggled: checked => Settings.data.general.enableShadows = checked
}
// Shadow direction
NComboBox {
visible: Settings.data.general.enableShadows
label: I18n.tr("settings.user-interface.shadows.direction.label")
description: I18n.tr("settings.user-interface.shadows.direction.description")
Layout.fillWidth: true
readonly property var shadowOptionsMap: ({
"top_left": {
"name": I18n.tr("options.shadow-direction.top_left"),
"p": Qt.point(-2, -2)
},
"top": {
"name": I18n.tr("options.shadow-direction.top"),
"p": Qt.point(0, -3)
},
"top_right": {
"name": I18n.tr("options.shadow-direction.top_right"),
"p": Qt.point(2, -2)
},
"left": {
"name": I18n.tr("options.shadow-direction.left"),
"p": Qt.point(-3, 0)
},
"center": {
"name": I18n.tr("options.shadow-direction.center"),
"p": Qt.point(0, 0)
},
"right": {
"name": I18n.tr("options.shadow-direction.right"),
"p": Qt.point(3, 0)
},
"bottom_left": {
"name": I18n.tr("options.shadow-direction.bottom_left"),
"p": Qt.point(-2, 2)
},
"bottom": {
"name": I18n.tr("options.shadow-direction.bottom"),
"p": Qt.point(0, 3)
},
"bottom_right": {
"name": I18n.tr("options.shadow-direction.bottom_right"),
"p": Qt.point(2, 3)
}
})
model: Object.keys(shadowOptionsMap).map(function (k) {
return {
"key": k,
"name": shadowOptionsMap[k].name
}
})
currentKey: Settings.data.general.shadowDirection
onSelected: function (key) {
var opt = shadowOptionsMap[key]
if (opt) {
Settings.data.general.shadowDirection = key
Settings.data.general.shadowOffsetX = opt.p.x
Settings.data.general.shadowOffsetY = opt.p.y
}
}
}
NToggle {
label: I18n.tr("settings.user-interface.panels-overlay.label")
description: I18n.tr("settings.user-interface.panels-overlay.description")