| 1 | package main |
| 2 | |
| 3 | // MinimiseMainWindow backs the Windows frameless titlebar controls. |
| 4 | func (a *App) MinimiseMainWindow() { |
| 5 | if a.ctx == nil { |
| 6 | return |
| 7 | } |
| 8 | a.nativeHost().MinimiseWindow(a.ctx) |
| 9 | } |
| 10 | |
| 11 | // ToggleMaximiseMainWindow backs the Windows frameless titlebar controls. |
| 12 | func (a *App) ToggleMaximiseMainWindow() { |
| 13 | if a.ctx == nil { |
| 14 | return |
| 15 | } |
| 16 | a.nativeHost().ToggleMaximiseWindow(a.ctx) |
| 17 | } |
| 18 | |
| 19 | // IsMainWindowMaximised reports the native maximise state for the Windows |
| 20 | // frameless titlebar controls. |
| 21 | func (a *App) IsMainWindowMaximised() bool { |
| 22 | if a.ctx == nil { |
| 23 | return false |
| 24 | } |
| 25 | return a.nativeHost().WindowIsMaximised(a.ctx) |
| 26 | } |
| 27 | |
| 28 | // CloseMainWindow preserves Reasonix's configured close behavior for the |
| 29 | // Windows frameless titlebar close button. |
| 30 | func (a *App) CloseMainWindow() { |
| 31 | if a.ctx == nil { |
| 32 | return |
| 33 | } |
| 34 | if a.beforeClose(a.ctx) { |
| 35 | return |
| 36 | } |
| 37 | a.forceQuit.Store(true) |
| 38 | a.nativeHost().Quit(a.ctx) |
| 39 | } |
| 40 |