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

DocTabs Indicator remains visible after last tab is removed #4220

Closed
2 tasks done
pbrown12303 opened this issue Sep 5, 2023 · 1 comment
Closed
2 tasks done

DocTabs Indicator remains visible after last tab is removed #4220

pbrown12303 opened this issue Sep 5, 2023 · 1 comment
Labels
unverified A bug that has been reported but not verified

Comments

@pbrown12303
Copy link
Contributor

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

If you remove all tabs from DocTabs, the selected indicator for the last tab remains visible.

How to reproduce

Run the attached test case. The first time will fail because the testdata is not present. Copy the failed files to the testdata folder and rerun - it will now run and pass all tests. Now compare emptyTabs.xml to afterTabRemoval.xml. The indicator rectangle which has a size of zero in emptyTabs now has an actual size and position in afterTabRemoval. Performing a DocTabs.SelectItem(-1) or DocTabs.Refresh() has no effect.

Screenshots

image

Example code

package container

import (
	"testing"
	"time"

	"fyne.io/fyne/v2"
	"fyne.io/fyne/v2/container"
	"fyne.io/fyne/v2/test"
	"fyne.io/fyne/v2/widget"
)

func TestEntryTextSize(t *testing.T) {
	tabs := container.NewDocTabs()
	tabs.Resize(fyne.NewSize(100, 100))
	tab1 := &container.TabItem{Text: "Test1", Content: widget.NewLabel("Test1")}
	time.Sleep(1000 * time.Millisecond)
	test.AssertObjectRendersToMarkup(t, "emptyTabs.xml", tabs)
	tabs.Append(tab1)
	time.Sleep(1000 * time.Millisecond)
	test.AssertObjectRendersToMarkup(t, "oneTab.xml", tabs)
	tabs.Select(tab1)
	time.Sleep(1000 * time.Millisecond)
	test.AssertObjectRendersToMarkup(t, "afterOneTabSelected.xml", tabs)
	tabs.Remove(tab1)
	time.Sleep(1000 * time.Millisecond)
	test.AssertObjectRendersToMarkup(t, "afterTabRemoval.xml", tabs)
	tabs.Refresh()
	time.Sleep(1000 * time.Millisecond)
	test.AssertObjectRendersToMarkup(t, "afterRefresh.xml", tabs)
	tabs.SelectIndex(-1)
	time.Sleep(1000 * time.Millisecond)
	test.AssertObjectRendersToMarkup(t, "afterSelectMinusOne.xml", tabs)
}

Fyne version

2.3.5

Go compiler version

1.21.0

Operating system and version

Windows 10

Additional Information

Here's the full test project, including testdata:

fyneDocTabsIndicatorTest.zip

@pbrown12303 pbrown12303 added the unverified A bug that has been reported but not verified label Sep 5, 2023
@andydotxyz
Copy link
Member

Thanks to @pbrown12303 this is now fixed on develop and will go into v2.4.1

@andydotxyz andydotxyz added this to the D fixes (v2.4.x) milestone Oct 3, 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