fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design

Home Page:https://fyne.io/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

AppTab does not display blue indicator line if you create it empty and then Append items to it later.

smanning-ds opened this issue · comments

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

AppTab is not rendered correctly if you create it empty and then Append items to it later.
In the first screenshot, you may notice that there is no blue indicator line under the first AppTab.
If I create with an initial dummy item as follows, I get the blue line as per the second screenshot.

How to reproduce

  1. Create empty AppTab at := container.NewAppTabs()
  2. Add items using Append method.
  3. Add AppTab to window canvas and run
  4. Click through tabs and observe that there is no blue line.
  5. Amend code to include a dummy tab when creating and observe that there is now a blue line.

Screenshots

image (4)
image (5)

Example code

envTabs := container.NewAppTabs()
...
	for _, env := range environ.Get() {
		envTabs.Append(
			container.NewTabItem(env.Id,
				widget.NewLabel(env.Longname),
			),
		)	
	}
...
	w.SetContent(container.NewVBox(
		widget.NewLabel("Test Environment Utilities"),
		envTabs,
		resTabs,
	))

Fyne version

2.4.4

Go compiler version

1.21.3

Operating system and version

macOS Big Sur 11.7.7

Additional Information

No response

Fixed on develop