5
0
mirror of https://github.com/wailsapp/wails.git synced 2025-05-02 20:03:01 +08:00

[v2] Only call EnableSizable for normal windows

Frameless windows are always not resizable per default and
the resizing for those will be initiated by the frontend see
processMessage.

If EnableSizable is enabled for frameless windows, a small white
titlebar will be shown.

Fix #1049
This commit is contained in:
stffabi 2022-01-14 15:56:16 +01:00
parent 72a0936f49
commit c4b14740d5

View File

@ -55,12 +55,17 @@ func NewWindow(parent winc.Controller, appoptions *options.App) *Window {
result.SetSize(appoptions.Width, appoptions.Height)
result.SetText(appoptions.Title)
if appoptions.Frameless == false && !appoptions.Fullscreen {
result.EnableMaxButton(!appoptions.DisableResize)
result.SetMinSize(appoptions.MinWidth, appoptions.MinHeight)
result.SetMaxSize(appoptions.MaxWidth, appoptions.MaxHeight)
if appoptions.Frameless == false {
if !appoptions.Fullscreen {
result.EnableMaxButton(!appoptions.DisableResize)
result.SetMinSize(appoptions.MinWidth, appoptions.MinHeight)
result.SetMaxSize(appoptions.MaxWidth, appoptions.MaxHeight)
}
// Only call EnableSizable for normal windows, frameless windows are always not resizable per default and
// the resizing for those will be initiated by the frontend see processMessage.
// If EnableSizable is enabled for frameless windows, a small white titlebar will be shown.
result.EnableSizable(!appoptions.DisableResize)
}
result.EnableSizable(!appoptions.DisableResize)
if appoptions.Windows != nil {
if appoptions.Windows.WindowIsTranslucent {