Skip to content

Commit

Permalink
Merge pull request #59 from AlpineMapsOrg/fullscreen_toggle
Browse files Browse the repository at this point in the history
f11 toggles fullscreen (tested on desktop, on webassembly the behavio…
  • Loading branch information
adam-ce authored Nov 24, 2023
2 parents b870df9 + 174cf84 commit 839362f
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/main_loader.qml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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() {
Expand Down

0 comments on commit 839362f

Please sign in to comment.