From 86fd2967fc6a54c3995ac3f0643ae92aae9e854d Mon Sep 17 00:00:00 2001 From: Drew Weymouth Date: Sat, 25 Oct 2025 16:38:24 -0700 Subject: [PATCH] Fix #735: adjust spacing on Now Playing page card --- ui/browsing/albumpage.go | 2 +- ui/util/util.go | 25 ++++++++++++++++--------- ui/widgets/largenowplayingcard.go | 4 +++- 3 files changed, 20 insertions(+), 11 deletions(-) diff --git a/ui/browsing/albumpage.go b/ui/browsing/albumpage.go index 8bb04a4..f29294f 100644 --- a/ui/browsing/albumpage.go +++ b/ui/browsing/albumpage.go @@ -212,7 +212,7 @@ type AlbumPageHeader struct { titleLabel *widget.RichText releaseTypeLabel *widget.RichText artistLabel *widgets.MultiHyperlink - artistLabelSpace *util.HSpace // TODO: remove when no longer needed + artistLabelSpace *util.Space // TODO: remove when no longer needed genreLabel *widgets.MultiHyperlink miscLabel *widget.Label shareMenuItem *fyne.MenuItem diff --git a/ui/util/util.go b/ui/util/util.go index 000e8a6..a77f915 100644 --- a/ui/util/util.go +++ b/ui/util/util.go @@ -401,22 +401,29 @@ type ToolTipRichText struct { OnTapped func(e *fyne.PointEvent) } -type HSpace struct { +type Space struct { widget.BaseWidget - Width float32 + Width float32 + Height float32 } -func NewHSpace(w float32) *HSpace { - h := &HSpace{Width: w} - h.ExtendBaseWidget(h) - return h +func NewHSpace(w float32) *Space { + s := &Space{Width: w} + s.ExtendBaseWidget(s) + return s } -func (h *HSpace) MinSize() fyne.Size { - return fyne.NewSize(h.Width, 0) +func NewVSpace(h float32) *Space { + s := &Space{Height: h} + s.ExtendBaseWidget(s) + return s } -func (h *HSpace) CreateRenderer() fyne.WidgetRenderer { +func (h *Space) MinSize() fyne.Size { + return fyne.NewSize(h.Width, h.Height) +} + +func (h *Space) CreateRenderer() fyne.WidgetRenderer { return widget.NewSimpleRenderer(layout.NewSpacer()) } diff --git a/ui/widgets/largenowplayingcard.go b/ui/widgets/largenowplayingcard.go index 1a92788..4935d84 100644 --- a/ui/widgets/largenowplayingcard.go +++ b/ui/widgets/largenowplayingcard.go @@ -11,6 +11,7 @@ import ( "fyne.io/fyne/v2/widget" "github.com/dweymouth/supersonic/backend/mediaprovider" myTheme "github.com/dweymouth/supersonic/ui/theme" + "github.com/dweymouth/supersonic/ui/util" ) // Shows the current album art, track name, artist name, and album name @@ -59,10 +60,11 @@ func NewLargeNowPlayingCard() *LargeNowPlayingCard { n.rating, layout.NewSpacer(), ) - n.Caption = container.New(layout.NewCustomPaddedVBoxLayout(theme.Padding()-13), + n.Caption = container.New(layout.NewCustomPaddedVBoxLayout(theme.Padding()-15), n.trackName, n.artistName, n.albumName, + util.NewVSpace(20), n.ratingFavoriteContainer, )