Let Fyne size content after fullscreen
This commit is contained in:
parent
ed7a618a57
commit
c1c72fa417
4
main.go
4
main.go
|
|
@ -1860,7 +1860,6 @@ func (r *mouseButtonRenderer) BackgroundColor() color.Color {
|
||||||
|
|
||||||
func (s *appState) setContent(body fyne.CanvasObject) {
|
func (s *appState) setContent(body fyne.CanvasObject) {
|
||||||
update := func() {
|
update := func() {
|
||||||
currentSize := s.window.Canvas().Size()
|
|
||||||
bg := canvas.NewRectangle(backgroundColor)
|
bg := canvas.NewRectangle(backgroundColor)
|
||||||
if body == nil {
|
if body == nil {
|
||||||
s.window.SetContent(bg)
|
s.window.SetContent(bg)
|
||||||
|
|
@ -1869,9 +1868,6 @@ func (s *appState) setContent(body fyne.CanvasObject) {
|
||||||
// Wrap content with mouse button handler
|
// Wrap content with mouse button handler
|
||||||
wrapped := newMouseButtonHandler(container.NewMax(bg, body), s)
|
wrapped := newMouseButtonHandler(container.NewMax(bg, body), s)
|
||||||
s.window.SetContent(wrapped)
|
s.window.SetContent(wrapped)
|
||||||
if currentSize.Width > 0 && currentSize.Height > 0 {
|
|
||||||
wrapped.Resize(currentSize)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use async Do() instead of DoAndWait() to avoid deadlock when called from main goroutine
|
// Use async Do() instead of DoAndWait() to avoid deadlock when called from main goroutine
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user