From db9d8990803531736a9db8cdf63011ac92a76500 Mon Sep 17 00:00:00 2001 From: fde-capu Date: Mon, 3 Mar 2025 15:09:55 -0300 Subject: [PATCH] Added Use Keybinds on Options. --- app/qml/ApplicationSettings.qml | 3 +++ app/qml/SettingsTerminalTab.qml | 10 ++++++++-- app/qml/main.qml | 8 ++++++++ 3 files changed, 19 insertions(+), 2 deletions(-) diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 424f0bd..2c77ede 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -57,6 +57,7 @@ QtObject { property real burnInQuality: 0.5 property bool blinkingCursor: false + property bool useKeybinds: false onWindowScalingChanged: handleFontChanged() @@ -271,6 +272,7 @@ QtObject { "fontWidth": fontWidth, "margin": _margin, "blinkingCursor": blinkingCursor, + "useKeybinds": useKeybinds, "frameMargin": _frameMargin, } return settings @@ -381,6 +383,7 @@ QtObject { _frameMargin = settings.frameMargin !== undefined ? settings.frameMargin : _frameMargin blinkingCursor = settings.blinkingCursor !== undefined ? settings.blinkingCursor : blinkingCursor + useKeybinds = settings.useKeybinds !== undefined ? settings.useKeybinds : useKeybinds handleFontChanged() } diff --git a/app/qml/SettingsTerminalTab.qml b/app/qml/SettingsTerminalTab.qml index 222ea78..7ea4142 100644 --- a/app/qml/SettingsTerminalTab.qml +++ b/app/qml/SettingsTerminalTab.qml @@ -114,9 +114,9 @@ ColumnLayout { } } GroupBox { - title: qsTr("Cursor") + title: qsTr("Misc.") Layout.fillWidth: true - ColumnLayout { + RowLayout { anchors.fill: parent CheckBox { id: blinkingCursor @@ -129,6 +129,12 @@ ColumnLayout { property: "checked" value: appSettings.blinkingCursor } + CheckBox { + id: useBindings + text: qsTr("Use Keybinds") + checked: appSettings.useKeybinds + onCheckedChanged: appSettings.useKeybinds = checked + } } } GroupBox { diff --git a/app/qml/main.qml b/app/qml/main.qml index 0be972d..8207385 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -130,9 +130,11 @@ ApplicationWindow { shortcut: "Ctrl+-" onTriggered: appSettings.decrementScaling() } + Action { id: lessOpaque text: qsTr("Make less opaque.") + enabled: appSettings.useKeybinds shortcut: "Ctrl+Shift+Up" onTriggered: { appSettings.windowOpacity -= appSettings.windowOpacity > keybindStep ? keybindStep : 0 @@ -141,6 +143,7 @@ ApplicationWindow { Action { id: moreOpaque text: qsTr("Make more opaque.") + enabled: appSettings.useKeybinds shortcut: "Ctrl+Shift+Down" onTriggered: { appSettings.windowOpacity += appSettings.windowOpacity < (1 - keybindStep) ? keybindStep : 0 @@ -149,6 +152,7 @@ ApplicationWindow { Action { id: moreContrast text: qsTr("More contrast.") + enabled: appSettings.useKeybinds shortcut: "Ctrl+Up" onTriggered: { appSettings.contrast += appSettings.contrast < (1 - keybindStep) ? keybindStep : 0 @@ -157,6 +161,7 @@ ApplicationWindow { Action { id: lessContrast text: qsTr("Less contrast.") + enabled: appSettings.useKeybinds shortcut: "Ctrl+Down" onTriggered: { appSettings.contrast -= appSettings.contrast > keybindStep ? keybindStep : 0 @@ -165,6 +170,7 @@ ApplicationWindow { Action { id: brighter text: qsTr("Brighter.") + enabled: appSettings.useKeybinds shortcut: "Alt+Up" onTriggered: { appSettings.brightness += appSettings.brightness < (1 - keybindStep) ? keybindStep : 0 @@ -173,11 +179,13 @@ ApplicationWindow { Action { id: darker text: qsTr("Darker.") + enabled: appSettings.useKeybinds shortcut: "Alt+Down" onTriggered: { appSettings.brightness -= appSettings.brightness > keybindStep ? keybindStep : 0 } } + Action { id: showAboutAction text: qsTr("About")