fyne
fyne copied to clipboard
Proposal: Move Window.Resize() and Window.CenterOnScreen() to desktop package
On thinking more about this I realise that having no-op functions at the top level isn't smart. I propose deprecating these and moving them to the desktop package, something like:
if win, ok := thisWin.(desktop.Window); ok {
win.Resize(fyne.NewSize(200, 200))
}
It is a little more hidden away, but it does more truly stick to what will happen when called...?
I guess it makes sense that any "Desktop" related features are available from the desktop package instead of having to write noop functions etc. for other drivers.
I think the feedback on moving CenterOnScreen is getting approval - but the Resize()
feature is used far too much to bury away.
I wonder if it should be renamed to indicate that it may not do what is expected - maybe RequestSize()
could warrant it staying at the main Window
interface?
How to get the resolution of the computer screen and center the whole program interface?
You center a window by calling Window.CenterOnScreen