Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dialogs are not refreshed correctly on .Show() #1866

Closed
Jacalz opened this issue Jan 26, 2021 · 1 comment
Closed

Dialogs are not refreshed correctly on .Show() #1866

Jacalz opened this issue Jan 26, 2021 · 1 comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working

Comments

@Jacalz
Copy link
Member

Jacalz commented Jan 26, 2021

Describe the bug:

The dialogs are not correctly refreshed when calling .Show() on a dialog that has already been created. This can be indicated by saving a reference to a dialog, hiding that dialog and then either changing the theme or resizing the window causes it to have the wrong colour or being at the wrong screen position.

To Reproduce:

Steps to reproduce the behaviour:

  1. Save a reference to a dialog
  2. Open the dialog
  3. Resize the window and/or change theme
  4. Notice incorrect size, position and/or wrong theme

Screenshots:

dialog-issues

Example code:

package main

import (
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/dialog"
	"fyne.io/fyne/v2/theme"
	"fyne.io/fyne/v2/widget"
)

func main() {
	a := app.New()
	w := a.NewWindow("Dialog resize")
	a.Settings().SetTheme(theme.LightTheme())

	themes := "light"
	ctheme := widget.NewButton("Change theme", func() {
		if themes == "dark" {
			a.Settings().SetTheme(theme.LightTheme())
			themes = "light"
			return
		}

		a.Settings().SetTheme(theme.DarkTheme())
		themes = "dark"
	})

	dialogs := dialog.NewInformation("Close me", "Close me and then resize window and/or change theme", w)

	w.SetContent(container.NewVBox(
		ctheme,
		widget.NewButton("Open dialog", func() {
			dialogs.Show()
		}),
	))

	w.ShowAndRun()
}

Device (please complete the following information):

  • OS: Linux
  • Version: 5.10.9
  • Go version: 1.15.7
  • Fyne version: 2.0.0
@Jacalz Jacalz added the bug Something isn't working label Jan 26, 2021
@andydotxyz andydotxyz added the blocker Items that would block a forthcoming release label Jan 26, 2021
andydotxyz pushed a commit that referenced this issue Feb 23, 2021
* fix modalPopUpRenderer refresh and refresh dialog when it is shown to fix #1866

* update themedBackgroundRenderer functions to respect fyne style guidelines
andydotxyz pushed a commit that referenced this issue Feb 23, 2021
* fix modalPopUpRenderer refresh and refresh dialog when it is shown to fix #1866

* update themedBackgroundRenderer functions to respect fyne style guidelines

Conflicts:
	dialog/base.go
@andydotxyz
Copy link
Member

On develop and release/v2.0.x branches

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
blocker Items that would block a forthcoming release bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants