mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-01 07:35:40 +00:00
app: [Windows] hide the maximize button when MaxSize is set
Also, disable window frame resizing when MaxSize equals MinSize. Fixes: https://todo.sr.ht/~eliasnaur/gio/631 Signed-off-by: vasijob225 <vasijob225@protonmail.com>
This commit is contained in:
@@ -750,6 +750,16 @@ func (w *window) Configure(options []Option) {
|
||||
swpStyle |= windows.SWP_NOMOVE | windows.SWP_NOSIZE
|
||||
showMode = windows.SW_SHOWMAXIMIZED
|
||||
}
|
||||
|
||||
// Disable maximize button if MaxSize is set.
|
||||
if cnf.MaxSize != (image.Point{X: 0, Y: 0}) {
|
||||
style &^= windows.WS_MAXIMIZEBOX
|
||||
// Disable window resizing if MinSize and MaxSize are equal.
|
||||
if cnf.MinSize == cnf.MaxSize {
|
||||
style &^= windows.WS_THICKFRAME
|
||||
}
|
||||
}
|
||||
|
||||
windows.SetWindowLong(w.hwnd, windows.GWL_STYLE, style)
|
||||
windows.SetWindowPos(w.hwnd, 0, x, y, width, height, swpStyle)
|
||||
windows.ShowWindow(w.hwnd, showMode)
|
||||
|
||||
Reference in New Issue
Block a user