Added Use Keybinds on Options.

This commit is contained in:
fde-capu 2025-03-03 15:09:55 -03:00
parent 64f2b6a14a
commit db9d899080
3 changed files with 19 additions and 2 deletions

View File

@ -57,6 +57,7 @@ QtObject {
property real burnInQuality: 0.5 property real burnInQuality: 0.5
property bool blinkingCursor: false property bool blinkingCursor: false
property bool useKeybinds: false
onWindowScalingChanged: handleFontChanged() onWindowScalingChanged: handleFontChanged()
@ -271,6 +272,7 @@ QtObject {
"fontWidth": fontWidth, "fontWidth": fontWidth,
"margin": _margin, "margin": _margin,
"blinkingCursor": blinkingCursor, "blinkingCursor": blinkingCursor,
"useKeybinds": useKeybinds,
"frameMargin": _frameMargin, "frameMargin": _frameMargin,
} }
return settings return settings
@ -381,6 +383,7 @@ QtObject {
_frameMargin = settings.frameMargin !== undefined ? settings.frameMargin : _frameMargin _frameMargin = settings.frameMargin !== undefined ? settings.frameMargin : _frameMargin
blinkingCursor = settings.blinkingCursor !== undefined ? settings.blinkingCursor : blinkingCursor blinkingCursor = settings.blinkingCursor !== undefined ? settings.blinkingCursor : blinkingCursor
useKeybinds = settings.useKeybinds !== undefined ? settings.useKeybinds : useKeybinds
handleFontChanged() handleFontChanged()
} }

View File

@ -114,9 +114,9 @@ ColumnLayout {
} }
} }
GroupBox { GroupBox {
title: qsTr("Cursor") title: qsTr("Misc.")
Layout.fillWidth: true Layout.fillWidth: true
ColumnLayout { RowLayout {
anchors.fill: parent anchors.fill: parent
CheckBox { CheckBox {
id: blinkingCursor id: blinkingCursor
@ -129,6 +129,12 @@ ColumnLayout {
property: "checked" property: "checked"
value: appSettings.blinkingCursor value: appSettings.blinkingCursor
} }
CheckBox {
id: useBindings
text: qsTr("Use Keybinds")
checked: appSettings.useKeybinds
onCheckedChanged: appSettings.useKeybinds = checked
}
} }
} }
GroupBox { GroupBox {

View File

@ -130,9 +130,11 @@ ApplicationWindow {
shortcut: "Ctrl+-" shortcut: "Ctrl+-"
onTriggered: appSettings.decrementScaling() onTriggered: appSettings.decrementScaling()
} }
Action { Action {
id: lessOpaque id: lessOpaque
text: qsTr("Make less opaque.") text: qsTr("Make less opaque.")
enabled: appSettings.useKeybinds
shortcut: "Ctrl+Shift+Up" shortcut: "Ctrl+Shift+Up"
onTriggered: { onTriggered: {
appSettings.windowOpacity -= appSettings.windowOpacity > keybindStep ? keybindStep : 0 appSettings.windowOpacity -= appSettings.windowOpacity > keybindStep ? keybindStep : 0
@ -141,6 +143,7 @@ ApplicationWindow {
Action { Action {
id: moreOpaque id: moreOpaque
text: qsTr("Make more opaque.") text: qsTr("Make more opaque.")
enabled: appSettings.useKeybinds
shortcut: "Ctrl+Shift+Down" shortcut: "Ctrl+Shift+Down"
onTriggered: { onTriggered: {
appSettings.windowOpacity += appSettings.windowOpacity < (1 - keybindStep) ? keybindStep : 0 appSettings.windowOpacity += appSettings.windowOpacity < (1 - keybindStep) ? keybindStep : 0
@ -149,6 +152,7 @@ ApplicationWindow {
Action { Action {
id: moreContrast id: moreContrast
text: qsTr("More contrast.") text: qsTr("More contrast.")
enabled: appSettings.useKeybinds
shortcut: "Ctrl+Up" shortcut: "Ctrl+Up"
onTriggered: { onTriggered: {
appSettings.contrast += appSettings.contrast < (1 - keybindStep) ? keybindStep : 0 appSettings.contrast += appSettings.contrast < (1 - keybindStep) ? keybindStep : 0
@ -157,6 +161,7 @@ ApplicationWindow {
Action { Action {
id: lessContrast id: lessContrast
text: qsTr("Less contrast.") text: qsTr("Less contrast.")
enabled: appSettings.useKeybinds
shortcut: "Ctrl+Down" shortcut: "Ctrl+Down"
onTriggered: { onTriggered: {
appSettings.contrast -= appSettings.contrast > keybindStep ? keybindStep : 0 appSettings.contrast -= appSettings.contrast > keybindStep ? keybindStep : 0
@ -165,6 +170,7 @@ ApplicationWindow {
Action { Action {
id: brighter id: brighter
text: qsTr("Brighter.") text: qsTr("Brighter.")
enabled: appSettings.useKeybinds
shortcut: "Alt+Up" shortcut: "Alt+Up"
onTriggered: { onTriggered: {
appSettings.brightness += appSettings.brightness < (1 - keybindStep) ? keybindStep : 0 appSettings.brightness += appSettings.brightness < (1 - keybindStep) ? keybindStep : 0
@ -173,11 +179,13 @@ ApplicationWindow {
Action { Action {
id: darker id: darker
text: qsTr("Darker.") text: qsTr("Darker.")
enabled: appSettings.useKeybinds
shortcut: "Alt+Down" shortcut: "Alt+Down"
onTriggered: { onTriggered: {
appSettings.brightness -= appSettings.brightness > keybindStep ? keybindStep : 0 appSettings.brightness -= appSettings.brightness > keybindStep ? keybindStep : 0
} }
} }
Action { Action {
id: showAboutAction id: showAboutAction
text: qsTr("About") text: qsTr("About")