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

Dialog not resizing in newly created window #1692

Closed
Kriechi opened this issue Dec 28, 2020 · 4 comments
Closed

Dialog not resizing in newly created window #1692

Kriechi opened this issue Dec 28, 2020 · 4 comments
Labels
blocker Items that would block a forthcoming release bug Something isn't working

Comments

@Kriechi
Copy link

Kriechi commented Dec 28, 2020

Describe the bug:

I'm trying to create a new window and show a FolderOpen dialog that pretty much takes the full window.
However, it is not resizing as expected and instead stays at a small (default?) size.

Example code

w := fyne.CurrentApp().NewWindow("Select destination...")
w.Resize(fyne.NewSize(1000, 600))
w.Show()
dialog := dialog.NewFolderOpen(func(list fyne.ListableURI, err error) {
	fmt.Println(list, err)
	w.Close()
}, w)
dialog.Show()
dialog.Resize(fyne.NewSize(975, 575))

Screenshot of the too small dialog

screenshot_2020-12-28_at_18 55 20

Workaround

@andydotxyz pointed out that a sleep might be needed before showing the dialog.
Modifying the code snippet like this, results in the expected full-window dialog:

...
dialog.Show()
time.Sleep(100 * time.Millisecond) // YMMV, 100ms worked for me
dialog.Resize(fyne.NewSize(975, 575))

Device (please complete the following information):

  • OS: [e.g. Linux, MacOS or iOS] macOS
  • Version: [e.g. 22] 10.15.7
  • Go version: [e.g. 1.12.3] 1.15
  • Fyne version: [e.g. 1.2.0 or git SHA] 1.4.2
@Jacalz
Copy link
Member

Jacalz commented Dec 28, 2020

Just for reference, I think this might be related to #1382.

@andydotxyz
Copy link
Member

It could be, though I think the root cause is different.
The solution may fix both though ;).

@anderspitman
Copy link

I'm getting bit by this as well. The default folder select dialog is too small. Adding the sleep works for me as well, but is obviously very hacky.

andydotxyz pushed a commit that referenced this issue Feb 26, 2021
…resized, fixes #1692 (#1932)

* fix file dialog resize method, ensure popup overlays are refreshed when windows is created and resized
* remove logic in baseDialog.Resize that is already delegated to widget.PopUp
* remove unnecessary logic in popup.Resize
* changes applied to mobileDriver and testCanvas

fixes #1692
andydotxyz pushed a commit that referenced this issue Feb 26, 2021
…resized, fixes #1692 (#1932)

* fix file dialog resize method, ensure popup overlays are refreshed when windows is created and resized
* remove logic in baseDialog.Resize that is already delegated to widget.PopUp
* remove unnecessary logic in popup.Resize
* changes applied to mobileDriver and testCanvas

fixes #1692
@andydotxyz
Copy link
Member

Fixed on develop and release/v2.0.x

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

4 participants