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

Aggressive refresh on resize of Tree widget #5395

Closed
2 tasks done
Jacalz opened this issue Jan 11, 2025 · 0 comments
Closed
2 tasks done

Aggressive refresh on resize of Tree widget #5395

Jacalz opened this issue Jan 11, 2025 · 0 comments
Labels
bug Something isn't working optimization Tickets that could help Fyne apps run faster

Comments

@Jacalz
Copy link
Member

Jacalz commented Jan 11, 2025

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

I noticed in some code refactoring that the Tree widget overrides the .Resize() methods using some internal parts of the base widget and manually does a refresh instead of repaint. This is technically wrong both from how widgets should be have and from a performance stand point.

fyne/widget/tree.go

Lines 239 to 248 in 4a875d9

// Resize sets a new size for a widget.
func (t *Tree) Resize(size fyne.Size) {
if size == t.size.Load() {
return
}
t.size.Store(size)
t.Refresh() // trigger a redraw
}

fyne/widget/tree.go

Lines 599 to 607 in 4a875d9

func (c *treeContent) Resize(size fyne.Size) {
if size == c.size.Load() {
return
}
c.size.Store(size)
c.Refresh() // trigger a redraw
}

How to reproduce

  1. Remove extended resize methods
  2. Notice that the test fail

Screenshots

No response

Example code

See reproduction steps above. Easier to see in tests and than demo.

Fyne version

v2.5.3

Go compiler version

1.23.4

Operating system and version

Fedora Silverblue 41

Additional Information

No response

@Jacalz Jacalz added bug Something isn't working optimization Tickets that could help Fyne apps run faster labels Jan 11, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working optimization Tickets that could help Fyne apps run faster
Projects
None yet
Development

No branches or pull requests

2 participants