fyne-io / fyne

Cross platform GUI toolkit in Go inspired by Material Design
https://fyne.io/
Other
25.15k stars 1.4k forks source link

DocTabItem update text doesn't update the underline select bar (graphic glitch) #3106

Closed matwachich closed 3 months ago

matwachich commented 2 years ago

Describe the bug:

When modifiying the text of a TabItem with a longer text, the underline blue bar (tab select mark) length doen't update to cover the entire tabitem length, until the item is clicked.

To Reproduce:

Run the code, and click the button

Screenshots:

image image

Example code:

package main

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

func main() {
    a := app.New()
    w := a.NewWindow("TEST")

    tab := container.NewDocTabs()
    tab.Append(&container.TabItem{
        Text: "Test",
        Content: container.NewCenter(
            widget.NewButton("Set Text", func() {
                tab.Items[0].Text = "Longer text to show the bug"
                tab.Refresh()
            }),
        ),
    })

    w.SetContent(tab)

    w.Resize(fyne.NewSize(800, 500))
    w.CenterOnScreen()
    w.ShowAndRun()
}

Device (please complete the following information):

dweymouth commented 3 months ago

This got fixed awhile ago in #3159 but forgot to close out the ticket