Customizable keybind display options to Cheatsheet (#2338)

This commit is contained in:
end-4
2025-11-07 09:52:25 +01:00
committed by GitHub
5 changed files with 180 additions and 7 deletions
@@ -90,4 +90,6 @@ ContentPage {
}
}
}
@@ -7,6 +7,98 @@ import qs.modules.common.widgets
ContentPage {
forceWidth: true
ContentSection {
icon: "keyboard"
title: Translation.tr("Cheat sheet")
ContentSubsection {
title: Translation.tr("Super key symbol")
tooltip: Translation.tr("You can also manually edit cheatsheet.superKey")
ConfigSelectionArray {
currentValue: Config.options.cheatsheet.superKey
onSelected: newValue => {
Config.options.cheatsheet.superKey = newValue;
}
// Use a nerdfont to see the icons
options: ([
"󰖳", "", "󰨡", "", "󰌽", "󰣇", "", "", "",
"", "", "󱄛", "", "", "⌘", "󰀲", "󰟍", ""
]).map(icon => { return {
displayName: icon,
value: icon
}
})
}
}
ConfigSwitch {
buttonIcon: "󰘵"
text: Translation.tr("Use macOS-like symbols for mods keys")
checked: Config.options.cheatsheet.useMacSymbol
onCheckedChanged: {
Config.options.cheatsheet.useMacSymbol = checked;
}
StyledToolTip {
text: Translation.tr("e.g. 󰘴 for Ctrl, 󰘵 for Alt, 󰘶 for Shift, etc")
}
}
ConfigSwitch {
buttonIcon: "󱊶"
text: Translation.tr("Use symbols for function keys")
checked: Config.options.cheatsheet.useFnSymbol
onCheckedChanged: {
Config.options.cheatsheet.useFnSymbol = checked;
}
StyledToolTip {
text: Translation.tr("e.g. 󱊫 for F1, 󱊶 for F12")
}
}
ConfigSwitch {
buttonIcon: "󰍽"
text: Translation.tr("Use symbols for mouse")
checked: Config.options.cheatsheet.useMouseSymbol
onCheckedChanged: {
Config.options.cheatsheet.useMouseSymbol = checked;
}
StyledToolTip {
text: Translation.tr("Replace 󱕐 for \"Scroll ↓\", 󱕑 \"Scroll ↑\", L󰍽 \"LMB\", R󰍽 \"RMB\", 󱕒 \"Scroll ↑/↓\" and ⇞/⇟ for \"Page_↑/↓\"")
}
}
ConfigSwitch {
buttonIcon: "highlight_keyboard_focus"
text: Translation.tr("Split buttons")
checked: Config.options.cheatsheet.splitButtons
onCheckedChanged: {
Config.options.cheatsheet.splitButtons = checked;
}
StyledToolTip {
text: Translation.tr("Display modifiers and keys in multiple keycap (e.g., \"Ctrl + A\" instead of \"Ctrl A\" or \"󰘴 + A\" instead of \"󰘴 A\")")
}
}
ConfigSpinBox {
text: Translation.tr("Keybind font size")
value: Config.options.cheatsheet.fontSize.key
from: 8
to: 30
stepSize: 1
onValueChanged: {
Config.options.cheatsheet.fontSize.key = value;
}
}
ConfigSpinBox {
text: Translation.tr("Description font size")
value: Config.options.cheatsheet.fontSize.comment
from: 8
to: 30
stepSize: 1
onValueChanged: {
Config.options.cheatsheet.fontSize.comment = value;
}
}
}
ContentSection {
icon: "call_to_action"
title: Translation.tr("Dock")
@@ -647,4 +739,5 @@ ContentPage {
}
}
}
}