Skip to content

Commit

Permalink
Fix a few hyperlink tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed Feb 27, 2024
1 parent 0fd0cf5 commit 27c9f22
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
1 change: 1 addition & 0 deletions widget/hyperlink.go
Original file line number Diff line number Diff line change
Expand Up @@ -188,6 +188,7 @@ func (hl *Hyperlink) SetText(text string) {
return // Not initialized yet.
}
hl.syncSegments()
hl.ResetMinSizeCache()
hl.provider.Refresh()
}

Expand Down
6 changes: 6 additions & 0 deletions widget/widget.go
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,11 @@ func (w *BaseWidget) Refresh() {
render.Refresh()
}

// ResetMinSizeCache resets the cached MinSize for this widget.
func (w *BaseWidget) ResetMinSizeCache() {
w.minCache.Store(fyne.Size{})
}

// Theme returns a cached Theme instance for this widget (or its extending widget).
// This will be the app theme in most cases, or a widget specific theme if it is inside a ThemeOverride container.
//
Expand Down Expand Up @@ -181,6 +186,7 @@ func (w *BaseWidget) SetFieldsAndRefresh(f func()) {
return
}
impl.Refresh()
w.ResetMinSizeCache()
}

// super will return the actual object that this represents.
Expand Down

0 comments on commit 27c9f22

Please sign in to comment.