Skip to content

Commit

Permalink
Don't force a layout when using progress bar constructor
Browse files Browse the repository at this point in the history
  • Loading branch information
Jacalz committed May 18, 2024
1 parent 68e8b07 commit 61c2a43
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions widget/progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,6 @@ import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/canvas"
"fyne.io/fyne/v2/data/binding"
"fyne.io/fyne/v2/internal/cache"
col "fyne.io/fyne/v2/internal/color"
"fyne.io/fyne/v2/internal/widget"
"fyne.io/fyne/v2/theme"
Expand Down Expand Up @@ -177,10 +176,9 @@ func (p *ProgressBar) Unbind() {
// The default Min is 0 and Max is 1, Values set should be between those numbers.
// The display will convert this to a percentage.
func NewProgressBar() *ProgressBar {
p := &ProgressBar{Min: 0, Max: 1}

cache.Renderer(p).Layout(p.MinSize())
return p
bar := &ProgressBar{Min: 0, Max: 1}
bar.ExtendBaseWidget(bar)
return bar
}

// NewProgressBarWithData returns a progress bar connected with the specified data source.
Expand All @@ -189,7 +187,6 @@ func NewProgressBar() *ProgressBar {
func NewProgressBarWithData(data binding.Float) *ProgressBar {
p := NewProgressBar()
p.Bind(data)

return p
}

Expand Down

0 comments on commit 61c2a43

Please sign in to comment.