move HSpace to util package

This commit is contained in:
Drew Weymouth
2023-03-14 10:21:22 -07:00
parent 8c6b2fa789
commit 26c6ee7ac8
8 changed files with 33 additions and 35 deletions
-27
View File
@@ -1,27 +0,0 @@
package widgets
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/layout"
"fyne.io/fyne/v2/widget"
)
type HSpace struct {
widget.BaseWidget
Width float32
}
func NewHSpace(w float32) *HSpace {
h := &HSpace{Width: w}
h.ExtendBaseWidget(h)
return h
}
func (h *HSpace) MinSize() fyne.Size {
return fyne.NewSize(h.Width, 0)
}
func (h *HSpace) CreateRenderer() fyne.WidgetRenderer {
return widget.NewSimpleRenderer(layout.NewSpacer())
}
+1 -1
View File
@@ -75,7 +75,7 @@ func NewTracklist(tracks []*subsonic.Child) *Tracklist {
t.OnColumnVisibilityMenuShown(pop)
}
}
playingIcon := container.NewCenter(container.NewHBox(NewHSpace(2), widget.NewIcon(theme.MediaPlayIcon())))
playingIcon := container.NewCenter(container.NewHBox(util.NewHSpace(2), widget.NewIcon(theme.MediaPlayIcon())))
t.list = widget.NewList(
func() int { return len(t.Tracks) },
func() fyne.CanvasObject {