Fix #735: adjust spacing on Now Playing page card

This commit is contained in:
Drew Weymouth
2025-10-25 16:38:24 -07:00
parent 9e9aa3fc67
commit 86fd2967fc
3 changed files with 20 additions and 11 deletions
+1 -1
View File
@@ -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
+15 -8
View File
@@ -401,22 +401,29 @@ type ToolTipRichText struct {
OnTapped func(e *fyne.PointEvent)
}
type HSpace struct {
type Space struct {
widget.BaseWidget
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())
}
+3 -1
View File
@@ -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,
)