Skip to content

Commit

Permalink
Remove a few MinSize methods overwrites
Browse files Browse the repository at this point in the history
The BaseWidget will call CreateRenderer() the first time and as such the widget will get extended anyhow.
  • Loading branch information
Jacalz committed Feb 27, 2024
1 parent 07c173f commit 1c074b9
Show file tree
Hide file tree
Showing 12 changed files with 0 additions and 78 deletions.
6 changes: 0 additions & 6 deletions widget/fileicon.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,12 +54,6 @@ func (i *FileIcon) setURI(uri fyne.URI) {
i.extension = trimmedExtension(uri)
}

// MinSize returns the size that this widget should not shrink below
func (i *FileIcon) MinSize() fyne.Size {
i.ExtendBaseWidget(i)
return i.BaseWidget.MinSize()
}

// CreateRenderer is a private method to Fyne which links this widget to its renderer
func (i *FileIcon) CreateRenderer() fyne.WidgetRenderer {
th := i.Theme()
Expand Down
6 changes: 0 additions & 6 deletions widget/gridwrap.go
Original file line number Diff line number Diff line change
Expand Up @@ -109,12 +109,6 @@ func (l *GridWrap) FocusLost() {
l.RefreshItem(l.currentFocus)
}

// MinSize returns the size that this widget should not shrink below.
func (l *GridWrap) MinSize() fyne.Size {
l.ExtendBaseWidget(l)
return l.BaseWidget.MinSize()
}

func (l *GridWrap) scrollTo(id GridWrapItemID) {
if l.scroller == nil {
return
Expand Down
6 changes: 0 additions & 6 deletions widget/list.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,12 +107,6 @@ func (l *List) FocusLost() {
l.RefreshItem(l.currentFocus)
}

// MinSize returns the size that this widget should not shrink below.
func (l *List) MinSize() fyne.Size {
l.ExtendBaseWidget(l)
return l.BaseWidget.MinSize()
}

// RefreshItem refreshes a single item, specified by the item ID passed in.
//
// Since: 2.4
Expand Down
8 changes: 0 additions & 8 deletions widget/menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -139,14 +139,6 @@ func (m *Menu) DeactivateLastSubmenu() bool {
return m.activeItem.deactivateLastSubmenu()
}

// MinSize returns the minimal size of the menu.
//
// Implements: fyne.Widget
func (m *Menu) MinSize() fyne.Size {
m.ExtendBaseWidget(m)
return m.BaseWidget.MinSize()
}

// Refresh updates the menu to reflect changes in the data.
//
// Implements: fyne.Widget
Expand Down
6 changes: 0 additions & 6 deletions widget/popup.go
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,6 @@ func (p *PopUp) TappedSecondary(_ *fyne.PointEvent) {
}
}

// MinSize returns the size that this widget should not shrink below
func (p *PopUp) MinSize() fyne.Size {
p.ExtendBaseWidget(p)
return p.BaseWidget.MinSize()
}

// CreateRenderer is a private method to Fyne which links this widget to its renderer
func (p *PopUp) CreateRenderer() fyne.WidgetRenderer {
th := p.Theme()
Expand Down
6 changes: 0 additions & 6 deletions widget/progressbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -120,12 +120,6 @@ func (p *ProgressBar) SetValue(v float64) {
p.Refresh()
}

// MinSize returns the size that this widget should not shrink below
func (p *ProgressBar) MinSize() fyne.Size {
p.ExtendBaseWidget(p)
return p.BaseWidget.MinSize()
}

// CreateRenderer is a private method to Fyne which links this widget to its renderer
func (p *ProgressBar) CreateRenderer() fyne.WidgetRenderer {
p.ExtendBaseWidget(p)
Expand Down
6 changes: 0 additions & 6 deletions widget/progressbarinfinite.go
Original file line number Diff line number Diff line change
Expand Up @@ -156,12 +156,6 @@ func (p *ProgressBarInfinite) Running() bool {
return cache.Renderer(p).(*infProgressRenderer).isRunning()
}

// MinSize returns the size that this widget should not shrink below
func (p *ProgressBarInfinite) MinSize() fyne.Size {
p.ExtendBaseWidget(p)
return p.BaseWidget.MinSize()
}

// CreateRenderer is a private method to Fyne which links this widget to its renderer
func (p *ProgressBarInfinite) CreateRenderer() fyne.WidgetRenderer {
p.ExtendBaseWidget(p)
Expand Down
8 changes: 0 additions & 8 deletions widget/select_entry.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ func (e *SelectEntry) Disable() {
e.Entry.Disable()
}

// MinSize returns the minimal size of the select entry.
//
// Implements: fyne.Widget
func (e *SelectEntry) MinSize() fyne.Size {
e.ExtendBaseWidget(e)
return e.Entry.MinSize()
}

// Move changes the relative position of the select entry.
//
// Implements: fyne.Widget
Expand Down
8 changes: 0 additions & 8 deletions widget/separator.go
Original file line number Diff line number Diff line change
Expand Up @@ -50,14 +50,6 @@ func (s *Separator) CreateRenderer() fyne.WidgetRenderer {
}
}

// MinSize returns the minimal size of the separator.
//
// Implements: fyne.Widget
func (s *Separator) MinSize() fyne.Size {
s.ExtendBaseWidget(s)
return s.BaseWidget.MinSize()
}

var _ fyne.WidgetRenderer = (*separatorRenderer)(nil)

type separatorRenderer struct {
Expand Down
6 changes: 0 additions & 6 deletions widget/slider.go
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,6 @@ func (s *Slider) SetValue(value float64) {
s.fireChangeEnded()
}

// MinSize returns the size that this widget should not shrink below
func (s *Slider) MinSize() fyne.Size {
s.ExtendBaseWidget(s)
return s.BaseWidget.MinSize()
}

// Disable disables the slider
//
// Since: 2.5
Expand Down
6 changes: 0 additions & 6 deletions widget/textgrid.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,12 +73,6 @@ type TextGrid struct {
TabWidth int // If set to 0 the fyne.DefaultTabWidth is used
}

// MinSize returns the smallest size this widget can shrink to
func (t *TextGrid) MinSize() fyne.Size {
t.ExtendBaseWidget(t)
return t.BaseWidget.MinSize()
}

// Resize is called when this widget changes size. We should make sure that we refresh cells.
func (t *TextGrid) Resize(size fyne.Size) {
t.BaseWidget.Resize(size)
Expand Down
6 changes: 0 additions & 6 deletions widget/toolbar.go
Original file line number Diff line number Diff line change
Expand Up @@ -119,12 +119,6 @@ func (t *Toolbar) Prepend(item ToolbarItem) {
t.Refresh()
}

// MinSize returns the size that this widget should not shrink below
func (t *Toolbar) MinSize() fyne.Size {
t.ExtendBaseWidget(t)
return t.BaseWidget.MinSize()
}

// NewToolbar creates a new toolbar widget.
func NewToolbar(items ...ToolbarItem) *Toolbar {
t := &Toolbar{Items: items}
Expand Down

0 comments on commit 1c074b9

Please sign in to comment.