Skip to content

Commit

Permalink
Resize the window to the view when starting up
Browse files Browse the repository at this point in the history
  • Loading branch information
MartinBriza authored and patrickelectric committed Sep 8, 2023
1 parent 66a5f09 commit 6c50b53
Showing 1 changed file with 7 additions and 0 deletions.
7 changes: 7 additions & 0 deletions qml/main.qml
Original file line number Diff line number Diff line change
Expand Up @@ -123,6 +123,13 @@ ApplicationWindow {
} else {
button.visible = false
button.error = ""
// resize the window to fit the contents if it's larger and gives us implicit size
if (item) {
if (item.implicitWidth !== "undefined" && item.implicitWidth > window.width)
window.width = Math.min(item.implicitWidth, Screen.width)
if (item.implicitHeight !== "undefined" && item.implicitHeight > window.height)
window.height = Math.min(item.implicitHeight, Screen.height)
}
}
}
}
Expand Down

0 comments on commit 6c50b53

Please sign in to comment.