forked from Shinonome/dots-hyprland
feat: add custom super key icon, mac symbol for mods keys and icon for function keys
This commit is contained in:
@@ -14,18 +14,48 @@ Item {
|
||||
property real padding: 4
|
||||
implicitWidth: row.implicitWidth + padding * 2
|
||||
implicitHeight: row.implicitHeight + padding * 2
|
||||
|
||||
property list<string> superMap: [
|
||||
"", "", "", "", "", "", "",
|
||||
"", "", "", "", "", " ", "", ""
|
||||
]
|
||||
property var keyBlacklist: ["Super_L"]
|
||||
property var keySubstitutions: ({
|
||||
"Super": "",
|
||||
"mouse_up": "Scroll ↓", // ikr, weird
|
||||
"mouse_down": "Scroll ↑", // trust me bro
|
||||
"mouse:272": "LMB",
|
||||
"mouse:273": "RMB",
|
||||
"Super": superMap[Config.options.appearance.keybinds.superKey],
|
||||
"Ctrl": Config.options.appearance.keybinds.useMacSymbol ? "" : "Ctrl",
|
||||
"Alt": Config.options.appearance.keybinds.useMacSymbol ? "" : "Alt",
|
||||
"Shift": Config.options.appearance.keybinds.useMacSymbol ? "" : "Shift",
|
||||
"Space": Config.options.appearance.keybinds.useMacSymbol ? "" : "Space",
|
||||
"Tab": Config.options.appearance.keybinds.useMacSymbol ? "" : "Tab",
|
||||
"Equal": Config.options.appearance.keybinds.useMacSymbol ? "" : "Equal",
|
||||
"Minus": Config.options.appearance.keybinds.useMacSymbol ? "" : "Minus",
|
||||
"Print": Config.options.appearance.keybinds.useMacSymbol ? "" : "Print",
|
||||
"Delete": Config.options.appearance.keybinds.useMacSymbol ? "" : "Delete",
|
||||
"Return": Config.options.appearance.keybinds.useMacSymbol ? "" : "Enter",
|
||||
"Period": Config.options.appearance.keybinds.useMacSymbol ? "." : "Period",
|
||||
|
||||
// Function keys
|
||||
"Escape": Config.options.appearance.keybinds.useFnSymbol ? "" : "Escape",
|
||||
"F1": Config.options.appearance.keybinds.useFnSymbol ? "" : "F1",
|
||||
"F2": Config.options.appearance.keybinds.useFnSymbol ? "" : "F2",
|
||||
"F3": Config.options.appearance.keybinds.useFnSymbol ? "" : "F3",
|
||||
"F4": Config.options.appearance.keybinds.useFnSymbol ? "" : "F4",
|
||||
"F5": Config.options.appearance.keybinds.useFnSymbol ? "" : "F5",
|
||||
"F6": Config.options.appearance.keybinds.useFnSymbol ? "" : "F6",
|
||||
"F7": Config.options.appearance.keybinds.useFnSymbol ? "" : "F7",
|
||||
"F8": Config.options.appearance.keybinds.useFnSymbol ? "" : "F8",
|
||||
"F9": Config.options.appearance.keybinds.useFnSymbol ? "" : "F9",
|
||||
"F10": Config.options.appearance.keybinds.useFnSymbol ? "" : "F10",
|
||||
"F11": Config.options.appearance.keybinds.useFnSymbol ? "" : "F11",
|
||||
"F12": Config.options.appearance.keybinds.useFnSymbol ? "" : "F12",
|
||||
|
||||
// Mouse keys
|
||||
"mouse_up": Config.options.appearance.keybinds.useMouseSymbol ? "" : "Scroll ↓", // ikr, weird
|
||||
"mouse_down": Config.options.appearance.keybinds.useMouseSymbol ? "" : "Scroll ↑", // trust me bro
|
||||
"mouse:272": Config.options.appearance.keybinds.useMouseSymbol ? "L" : "LMB",
|
||||
"mouse:273": Config.options.appearance.keybinds.useMouseSymbol ? "R" : "RMB",
|
||||
"mouse:275": "MouseBack",
|
||||
"Slash": "/",
|
||||
"Hash": "#",
|
||||
"Return": "Enter",
|
||||
// "Shift": "",
|
||||
})
|
||||
|
||||
@@ -149,4 +179,4 @@ Item {
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -123,6 +123,16 @@ Singleton {
|
||||
property JsonObject palette: JsonObject {
|
||||
property string type: "auto" // Allowed: auto, scheme-content, scheme-expressive, scheme-fidelity, scheme-fruit-salad, scheme-monochrome, scheme-neutral, scheme-rainbow, scheme-tonal-spot
|
||||
}
|
||||
property JsonObject keybinds: JsonObject {
|
||||
// Use a nerdfont to see the icons
|
||||
// 0: | 1: | 2: | 3: | 4:
|
||||
// 5: | 6: | 7: | 8: | 9:
|
||||
// 10: | 11: | 12: | 13: | 14:
|
||||
property int superKey: 0
|
||||
property bool useMacSymbol: false
|
||||
property bool useMouseSymbol: false
|
||||
property bool useFnSymbol: false
|
||||
}
|
||||
}
|
||||
|
||||
property JsonObject audio: JsonObject {
|
||||
|
||||
@@ -90,4 +90,119 @@ ContentPage {
|
||||
}
|
||||
}
|
||||
|
||||
ContentSection {
|
||||
icon: "keyboard"
|
||||
title: Translation.tr("Keybinds Cheatsheet")
|
||||
|
||||
ContentSubsection {
|
||||
title: Translation.tr("Super Key Symbol")
|
||||
ConfigSelectionArray {
|
||||
currentValue: Config.options.appearance.keybinds.superKey
|
||||
onSelected: newValue => {
|
||||
Config.options.appearance.keybinds.superKey = newValue;
|
||||
}
|
||||
// Use a nerdfont to see the icons
|
||||
// 0: | 1: | 2: | 3: | 4:
|
||||
// 5: | 6: | 7: | 8: | 9:
|
||||
// 10: | 11: | 12: | 13: | 14:
|
||||
options: [
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 0
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 3
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 4
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 5
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 7
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 12
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 13
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 11
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 10
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 8
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 14
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 9
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 6
|
||||
},
|
||||
{
|
||||
displayName: "",
|
||||
icon: "",
|
||||
value: 2
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
ConfigSwitch {
|
||||
buttonIcon: ""
|
||||
text: Translation.tr("Use macOS-like symbols for mods keys")
|
||||
checked: Config.options.appearance.keybinds.useMacSymbol
|
||||
onCheckedChanged: {
|
||||
Config.options.appearance.keybinds.useMacSymbol = checked;
|
||||
}
|
||||
}
|
||||
ConfigSwitch {
|
||||
buttonIcon: ""
|
||||
text: Translation.tr("Use symbols for function keys")
|
||||
checked: Config.options.appearance.keybinds.useFnSymbol
|
||||
onCheckedChanged: {
|
||||
Config.options.appearance.keybinds.useFnSymbol = checked;
|
||||
}
|
||||
}
|
||||
ConfigSwitch {
|
||||
buttonIcon: ""
|
||||
text: Translation.tr("Use symbols for mouse")
|
||||
checked: Config.options.appearance.keybinds.s
|
||||
onCheckedChanged: {
|
||||
Config.options.appearance.keybinds.useMouseSymbol = checked;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user