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

on Windows 10 NewAdaptiveGrid(0) blanks app window on start until resized #3669

Closed
2 tasks done
vinser opened this issue Feb 18, 2023 · 7 comments
Closed
2 tasks done
Labels
unverified A bug that has been reported but not verified

Comments

@vinser
Copy link

vinser commented Feb 18, 2023

Checklist

  • I have searched the issue tracker for open issues that relate to the same problem, before opening a new one.
  • This issue only relates to a single bug. I will open new issues for any other problems.

Describe the bug

On Windows 10 when the app starts the single base window is empty.
When the window is resized or when it is minimized and then maximized, all elements in the window become visible.
No matter what theme is used custom or default.
I built the app using MSYS2 and TDM-GCC the result was the same.
On my SBC with Ubuntu arm64 it builds and works fyne.

How to reproduce

Run the code below and try to resize app window

Screenshots

No response

Example code

package main

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

func main() {
	a := app.New()

	tab := container.NewTabItemWithIcon("Choice", theme.GridIcon(), container.NewAdaptiveGrid(0))

	contentTabs := container.NewAppTabs(tab)
	contentTabs.SetTabLocation(container.TabLocationBottom)

	wMain := a.NewWindow("TABS")
	wMain.Resize(fyne.NewSize(1344, 756))
	wMain.CenterOnScreen()
	wMain.SetContent(contentTabs)
	wMain.ShowAndRun()
}

Fyne version

2.3.1

Go compiler version

go1.20.1 windows/amd64

Operating system

Windows

Operating system version

Windows 10 22H2

Additional Information

No response

@vinser vinser added the unverified A bug that has been reported but not verified label Feb 18, 2023
@andydotxyz
Copy link
Member

What is the expected outcome when you add a grid that has 0 rows? This doesn't seem like a desirable configuration...

@vinser
Copy link
Author

vinser commented Feb 18, 2023

I use grid to display images from GetWD or preferred folder. When no images found I show empty UI which allows to choose other folder. Simple code sample above is not my app. I put it here to locate the trouble. My app works as expected on Ubuntu but on Windows it needs window resize to display UI. I hoped that app will work identically on different platforms as stated :)

@andydotxyz
Copy link
Member

I agree that it should work as stated, but "0 columns" is quite an edge case, what is the expected behaviour?

@vinser
Copy link
Author

vinser commented Feb 19, 2023

IMO expected grid behavior with 0 rows/columns is to display nothing, something like Label does with empty string.
And it behaves so on Linux and even on Windows but after resizing.

	-- tab := container.NewTabItemWithIcon("Choice", theme.GridIcon(), container.NewAdaptiveGrid(0))
	++ tab := container.NewTabItemWithIcon("Choice", theme.GridIcon(), widget.NewLabel(""))

Unlike the grid, the label works correctly both on Linux and on Windows in such "edge" case :)

andydotxyz pushed a commit to andydotxyz/fyne that referenced this issue Feb 27, 2023
@andydotxyz
Copy link
Member

The PR #3689 should fix this inconsistency.
I decided that 0 rows does not make sense, as the min size can't make sensible decisions on that.
Instead we assume at least 1 row/column.

@vinser
Copy link
Author

vinser commented Feb 28, 2023

Thank you. I attached a software crutch to workaround this case in app - an empty text canvas in onecolumn grid :)

@andydotxyz
Copy link
Member

Fixed on develop ready for next release

andydotxyz pushed a commit that referenced this issue Mar 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
unverified A bug that has been reported but not verified
Projects
None yet
Development

No branches or pull requests

2 participants