desktop full screen remember
This commit is contained in:
parent
6328e7d83b
commit
795929186a
|
@ -37,9 +37,12 @@ func main() {
|
|||
}
|
||||
var runOptions []flutter.Option
|
||||
runOptions = append(runOptions, flutter.WindowInitialDimensions(width, height))
|
||||
runOptions = append(runOptions, options...)
|
||||
fullScreen, _ := properties.LoadBoolProperty("full_screen", false)
|
||||
if fullScreen {
|
||||
runOptions = append(runOptions, flutter.WindowMode(flutter.WindowModeMaximize))
|
||||
}
|
||||
// ------
|
||||
err := flutter.Run(append(runOptions, mainOptions...)...)
|
||||
err := flutter.Run(append(append(runOptions, options...), mainOptions...)...)
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
|
|
|
@ -79,5 +79,10 @@ func (p *PikapikaPlugin) InitPluginGLFW(window *glfw.Window) error {
|
|||
properties.SaveProperty("window_height", strconv.Itoa(height))
|
||||
}()
|
||||
})
|
||||
window.SetMaximizeCallback(func(w *glfw.Window, iconified bool) {
|
||||
go func() {
|
||||
properties.SaveProperty("full_screen", strconv.FormatBool(iconified))
|
||||
}()
|
||||
})
|
||||
return nil
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue