From 174cf84ba5f95e634c4d0f4f07465eb3f74d2934 Mon Sep 17 00:00:00 2001 From: Adam Celarek <5292991+adam-ce@users.noreply.github.com> Date: Fri, 24 Nov 2023 16:32:46 +0100 Subject: [PATCH] f11 toggles fullscreen (tested on desktop, on webassembly the behaviour didn't change) --- app/main_loader.qml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/app/main_loader.qml b/app/main_loader.qml index cd5ec0b8..eb0b0557 100644 --- a/app/main_loader.qml +++ b/app/main_loader.qml @@ -23,6 +23,7 @@ import Alpine ApplicationWindow { visible: true + id: application_window property alias loaded_item: mainLoader.item Material.theme: loaded_item ? loaded_item.theme : Material.System Material.accent: loaded_item ? loaded_item.accent : Material.Pink @@ -34,6 +35,20 @@ ApplicationWindow { focus: true } + Shortcut { + property int old_visiblity: application_window.visibility + sequences: ["F11"] + onActivated: { + if (application_window.visibility === Window.FullScreen){ + application_window.visibility = old_visiblity; + } + else { + old_visiblity = application_window.visibility + application_window.visibility = Window.FullScreen + } + } + } + Connections{ target: _hotreloader function onWatched_source_changed() {