diff --git a/app/qml/ApplicationSettings.qml b/app/qml/ApplicationSettings.qml index 424f0bd..f170d2f 100644 --- a/app/qml/ApplicationSettings.qml +++ b/app/qml/ApplicationSettings.qml @@ -57,6 +57,8 @@ QtObject { property real burnInQuality: 0.5 property bool blinkingCursor: false + property bool useKeybinds: false + property real currentProfileIndex: 0 onWindowScalingChanged: handleFontChanged() diff --git a/app/qml/main.qml b/app/qml/main.qml index 8ae0774..4bc188b 100644 --- a/app/qml/main.qml +++ b/app/qml/main.qml @@ -128,6 +128,36 @@ ApplicationWindow { shortcut: "Ctrl+-" onTriggered: appSettings.decrementScaling() } + Action { + id: previousProfie + text: qsTr("Previous profile.") + enabled: appSettings.useKeybinds + shortcut: "Shift+Alt+Left" + onTriggered: { + var current = appSettings.currentProfileIndex + current -= 1 + current = current < 0 ? appSettings.profilesList.count - 1 : current + appSettings.currentProfileIndex = current + var unload = (appSettings.brightness, appSettings.contrast, appSettings.windowOpacity) + appSettings.loadProfile(current) + appSettings.brightness, appSettings.contrast, appSettings.windowOpacity = unload + } + } + Action { + id: nextProfile + text: qsTr("Next profile.") + enabled: appSettings.useKeybinds + shortcut: "Shift+Alt+Right" + onTriggered: { + var current = appSettings.currentProfileIndex + current += 1 + current = current < appSettings.profilesList.count ? current : 0 + appSettings.currentProfileIndex = current + var unload = (appSettings.brightness, appSettings.contrast, appSettings.windowOpacity) + appSettings.loadProfile(current) + appSettings.brightness, appSettings.contrast, appSettings.windowOpacity = unload + } + } Action { id: showAboutAction text: qsTr("About")