mirror of
https://git.sr.ht/~eliasnaur/gio
synced 2026-07-03 16:35:36 +00:00
app/internal/window: [Windows] fix min/max size
Fixes gio#141 Signed-off-by: Elias Naur <mail@eliasnaur.com>
This commit is contained in:
@@ -153,10 +153,10 @@ func initResources() error {
|
||||
|
||||
func getWindowConstraints(cfg unit.Metric, opts *Options, d winDeltas) winConstraints {
|
||||
var minmax winConstraints
|
||||
minmax.minWidth = int32(cfg.Px(opts.MinWidth)) + d.width
|
||||
minmax.minHeight = int32(cfg.Px(opts.MinHeight)) + d.height
|
||||
minmax.maxWidth = int32(cfg.Px(opts.MaxWidth)) + d.width
|
||||
minmax.maxHeight = int32(cfg.Px(opts.MaxHeight)) + d.height
|
||||
minmax.minWidth = int32(cfg.Px(opts.MinWidth))
|
||||
minmax.minHeight = int32(cfg.Px(opts.MinHeight))
|
||||
minmax.maxWidth = int32(cfg.Px(opts.MaxWidth))
|
||||
minmax.maxHeight = int32(cfg.Px(opts.MaxHeight))
|
||||
return minmax
|
||||
}
|
||||
|
||||
@@ -288,14 +288,14 @@ func windowProc(hwnd syscall.Handle, msg uint32, wParam, lParam uintptr) uintptr
|
||||
mm := (*windows.MinMaxInfo)(unsafe.Pointer(uintptr(lParam)))
|
||||
if w.minmax.minWidth > 0 || w.minmax.minHeight > 0 {
|
||||
mm.PtMinTrackSize = windows.Point{
|
||||
w.minmax.minWidth,
|
||||
w.minmax.minHeight,
|
||||
w.minmax.minWidth+w.deltas.width,
|
||||
w.minmax.minHeight+w.deltas.height,
|
||||
}
|
||||
}
|
||||
if w.minmax.maxWidth > 0 || w.minmax.maxHeight > 0 {
|
||||
mm.PtMaxTrackSize = windows.Point{
|
||||
w.minmax.maxWidth,
|
||||
w.minmax.maxHeight,
|
||||
w.minmax.maxWidth+w.deltas.width,
|
||||
w.minmax.maxHeight+w.deltas.height,
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user