Fixed bug related to incorrect window size.
Sometimes when starting a program the program window was small.
This commit is contained in:
parent
a95692196e
commit
7b7c15ad27
@ -22,7 +22,8 @@ type Window struct {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func newWindow(w fyne.Window, layout LayoutContract) Window {
|
func newWindow(w fyne.Window, layout LayoutContract) Window {
|
||||||
w.Resize(fyne.Size{Width: 1039, Height: 599})
|
windowSize := fyne.Size{Width: 1039, Height: 599}
|
||||||
|
w.Resize(windowSize)
|
||||||
w.CenterOnScreen()
|
w.CenterOnScreen()
|
||||||
|
|
||||||
go func() {
|
go func() {
|
||||||
@ -30,11 +31,10 @@ func newWindow(w fyne.Window, layout LayoutContract) Window {
|
|||||||
* Bug fixed.
|
* Bug fixed.
|
||||||
* When starting the program, sometimes the window was displayed incorrectly.
|
* When starting the program, sometimes the window was displayed incorrectly.
|
||||||
*/
|
*/
|
||||||
|
windowSize.Width += 1
|
||||||
|
windowSize.Height += 1
|
||||||
time.Sleep(time.Millisecond * 500)
|
time.Sleep(time.Millisecond * 500)
|
||||||
size := w.Canvas().Size()
|
w.Resize(windowSize)
|
||||||
size.Width += 1
|
|
||||||
size.Height += 1
|
|
||||||
w.Resize(size)
|
|
||||||
}()
|
}()
|
||||||
|
|
||||||
return Window{
|
return Window{
|
||||||
|
Loading…
Reference in New Issue
Block a user