Support for minimum and maximum window sizes (#612)

* add support for minimum and maximum window sizes

* attempt to fix windows

* bug fixes

* support min/max window sizes on Linux and Windows

* fix min/max window sizes on Linux

* formatting and comments

* fixes Windows DPI issue, clamps width/height values to min/max

* App can't go into full screen when max size is set for Mac

* fixed Linux maximum width/height on window maximize

* Revert "fixed Linux maximum width/height on window maximize"

This reverts commit 3f7ba8b264.

The fix glitches on PopOS

Co-authored-by: Lea Anthony <lea.anthony@gmail.com>
This commit is contained in:
RH12503 2021-04-02 13:14:09 +08:00 committed by GitHub
commit a1bd1013cb
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
10 changed files with 299 additions and 5 deletions

View file

@ -67,6 +67,16 @@ func (r *Window) SetColour(colour string) error {
return r.renderer.SetColour(colour)
}
// SetMinSize sets the minimum size of a resizable window
func (r *Window) SetMinSize(width, height int) {
r.renderer.SetMinSize(width, height)
}
// SetMaxSize sets the maximum size of a resizable window
func (r *Window) SetMaxSize(width, height int) {
r.renderer.SetMaxSize(width, height)
}
// Fullscreen makes the window fullscreen
func (r *Window) Fullscreen() {
r.renderer.Fullscreen()