app: [Windows] show the maximize button even when MaxSize is set

According to @kkeybbs, pressing the maximize button on Windows only
resizes the window up to its maximum bounds. That means we can leave the
button available, and only hide it when the window has a fixed size.

Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
Elias Naur
2025-07-01 09:20:51 +02:00
parent d50ef687b8
commit ea979b436d
+3 -6
View File
@@ -759,13 +759,10 @@ func (w *window) Configure(options []Option) {
showMode = windows.SW_SHOWMAXIMIZED showMode = windows.SW_SHOWMAXIMIZED
} }
// Disable maximize button if MaxSize is set. // Disable window resizing if MinSize and MaxSize are equal.
if cnf.MaxSize != (image.Point{X: 0, Y: 0}) { if cnf.MaxSize != (image.Point{}) && cnf.MinSize == cnf.MaxSize {
style &^= windows.WS_MAXIMIZEBOX style &^= windows.WS_MAXIMIZEBOX
// Disable window resizing if MinSize and MaxSize are equal. style &^= windows.WS_THICKFRAME
if cnf.MinSize == cnf.MaxSize {
style &^= windows.WS_THICKFRAME
}
} }
// Note: these invocation all trigger the windows callback method which may process a pending system.ActionCenter // Note: these invocation all trigger the windows callback method which may process a pending system.ActionCenter