diff --git a/ui/bottompanel.go b/ui/bottompanel.go index ce0a2ba..33e534e 100644 --- a/ui/bottompanel.go +++ b/ui/bottompanel.go @@ -11,6 +11,7 @@ import ( "fyne.io/fyne/v2" "fyne.io/fyne/v2/container" + "fyne.io/fyne/v2/theme" "fyne.io/fyne/v2/widget" ) @@ -47,6 +48,7 @@ func NewBottomPanel(pm *backend.PlaybackManager, im *backend.ImageManager, contr pm.OnStopped(util.FyneDoFunc(func() { bp.Controls.SetPlaying(false) })) bp.NowPlaying = widgets.NewNowPlayingCard() + bp.NowPlaying.ImageCornerRadius = theme.InputRadiusSize() bp.NowPlaying.OnCoverTapped = func() { contr.NavigateTo(controller.NowPlayingRoute()) } diff --git a/ui/browsing/albumpage.go b/ui/browsing/albumpage.go index f29294f..3cf3d04 100644 --- a/ui/browsing/albumpage.go +++ b/ui/browsing/albumpage.go @@ -231,6 +231,7 @@ func NewAlbumPageHeader(page *AlbumPage) *AlbumPageHeader { a.ExtendBaseWidget(a) a.cover = widgets.NewImagePlaceholder(myTheme.AlbumIcon, 225) a.cover.OnTapped = func(*fyne.PointEvent) { go a.showPopUpCover() } + a.cover.CornerRadius = theme.InputRadiusSize() a.titleLabel = widget.NewRichTextWithText("") a.titleLabel.Truncation = fyne.TextTruncateEllipsis diff --git a/ui/browsing/artistpage.go b/ui/browsing/artistpage.go index f62523f..1005c3f 100644 --- a/ui/browsing/artistpage.go +++ b/ui/browsing/artistpage.go @@ -503,6 +503,7 @@ func NewArtistPageHeader(page *ArtistPage) *ArtistPageHeader { } a.artistImage = widgets.NewImagePlaceholder(myTheme.ArtistIcon, 225) a.artistImage.OnTapped = func(*fyne.PointEvent) { a.showPopUpCover() } + a.artistImage.CornerRadius = theme.InputRadiusSize() a.favoriteBtn = widgets.NewFavoriteButton(func() { go a.toggleFavorited() }) a.playBtn = widget.NewButtonWithIcon(lang.L("Play Discography"), theme.MediaPlayIcon(), func() { go a.artistPage.pm.PlayArtistDiscography(a.artistID, false /*shuffle*/) diff --git a/ui/browsing/nowplayingpage.go b/ui/browsing/nowplayingpage.go index 48fe285..04840a6 100644 --- a/ui/browsing/nowplayingpage.go +++ b/ui/browsing/nowplayingpage.go @@ -110,6 +110,7 @@ func NewNowPlayingPage( pm.OnStopped(doFmtStatus) a.card = widgets.NewLargeNowPlayingCard() + a.card.ImageCornerRadius = theme.InputRadiusSize() a.card.OnAlbumNameTapped = func() { contr.NavigateTo(controller.AlbumRoute(a.nowPlaying.Metadata().AlbumID)) } diff --git a/ui/browsing/playlistpage.go b/ui/browsing/playlistpage.go index 5448eb1..40b8e48 100644 --- a/ui/browsing/playlistpage.go +++ b/ui/browsing/playlistpage.go @@ -328,6 +328,7 @@ func NewPlaylistPageHeader(page *PlaylistPage) *PlaylistPageHeader { a.image = widgets.NewImagePlaceholder(myTheme.PlaylistIcon, 225) a.image.OnTapped = func(*fyne.PointEvent) { go a.showPopUpCover() } + a.image.CornerRadius = theme.InputRadiusSize() a.titleLabel = util.NewTruncatingRichText() a.titleLabel.Segments[0].(*widget.TextSegment).Style = widget.RichTextStyle{ SizeName: theme.SizeNameHeadingText, diff --git a/ui/theme/themedrectangle.go b/ui/theme/themedrectangle.go index 34ca653..603f0a3 100644 --- a/ui/theme/themedrectangle.go +++ b/ui/theme/themedrectangle.go @@ -15,11 +15,11 @@ type ThemedRectangle struct { rect *canvas.Rectangle - ColorName fyne.ThemeColorName - Translucent bool - BorderWidth float32 - BorderColorName fyne.ThemeColorName - CornerRadiusName fyne.ThemeSizeName + ColorName fyne.ThemeColorName + Translucent bool + BorderWidth float32 + BorderColorName fyne.ThemeColorName + CornerRadius float32 } func NewThemedRectangle(colorName fyne.ThemeColorName) *ThemedRectangle { @@ -43,9 +43,7 @@ func (t *ThemedRectangle) Refresh() { t.rect.FillColor = fc t.rect.StrokeWidth = t.BorderWidth t.rect.StrokeColor = theme.Color(t.BorderColorName, settings.ThemeVariant()) - if t.CornerRadiusName != "" { - t.rect.CornerRadius = theme.Size(t.CornerRadiusName) - } + t.rect.CornerRadius = t.CornerRadius t.BaseWidget.Refresh() } diff --git a/ui/util/util.go b/ui/util/util.go index 9891499..afcf9c6 100644 --- a/ui/util/util.go +++ b/ui/util/util.go @@ -365,7 +365,7 @@ func AddHeaderBackground(obj fyne.CanvasObject) *fyne.Container { func AddHeaderBackgroundWithColorName(obj fyne.CanvasObject, colorName fyne.ThemeColorName) *fyne.Container { bgrnd := myTheme.NewThemedRectangle(colorName) - bgrnd.CornerRadiusName = theme.SizeNameInputRadius + bgrnd.CornerRadius = theme.InputRadiusSize() return container.NewStack(bgrnd, container.New(&layout.CustomPaddedLayout{LeftPadding: 10, RightPadding: 10, TopPadding: 10, BottomPadding: 10}, obj)) diff --git a/ui/widgets/gridview.go b/ui/widgets/gridview.go index 03142d4..f263b8e 100644 --- a/ui/widgets/gridview.go +++ b/ui/widgets/gridview.go @@ -304,6 +304,7 @@ func (g *GridView) createGridWrap() { func (g *GridView) createNewItemCard() fyne.CanvasObject { card := NewGridViewItem(g.Placeholder) + card.Cover.Im.CornerRadius = theme.InputRadiusSize() card.SetSize(backend.AppInstance().Config.GridView.CardSize) card.ItemIndex = -1 card.ImgLoader = util.NewThumbnailLoader(g.imageFetcher, card.Cover.SetImage) diff --git a/ui/widgets/imageplaceholder.go b/ui/widgets/imageplaceholder.go index 5cc2365..3caa93c 100644 --- a/ui/widgets/imageplaceholder.go +++ b/ui/widgets/imageplaceholder.go @@ -17,6 +17,7 @@ import ( type ImagePlaceholder struct { ScaleMode canvas.ImageScale PlaceholderIcon fyne.Resource + CornerRadius float32 widget.BaseWidget content *fyne.Container @@ -109,6 +110,8 @@ func (i *ImagePlaceholder) Refresh() { i.imageDisp.Hidden = !i.HaveImage() i.imageDisp.ScaleMode = i.ScaleMode i.iconImage.ScaleMode = i.ScaleMode + i.imageDisp.CornerRadius = i.CornerRadius + i.border.CornerRadius = i.CornerRadius i.BaseWidget.Refresh() } diff --git a/ui/widgets/largenowplayingcard.go b/ui/widgets/largenowplayingcard.go index 4935d84..99452da 100644 --- a/ui/widgets/largenowplayingcard.go +++ b/ui/widgets/largenowplayingcard.go @@ -19,7 +19,8 @@ import ( type LargeNowPlayingCard struct { CaptionedImage - DisableRating bool + DisableRating bool + ImageCornerRadius float32 isRadio bool trackName *widget.RichText @@ -163,5 +164,6 @@ func (n *LargeNowPlayingCard) Refresh() { } else { n.rating.Enable() } + n.cover.CornerRadius = n.ImageCornerRadius n.BaseWidget.Refresh() } diff --git a/ui/widgets/listheader.go b/ui/widgets/listheader.go index 09359d5..2c0ed12 100644 --- a/ui/widgets/listheader.go +++ b/ui/widgets/listheader.go @@ -64,7 +64,7 @@ func NewListHeader(cols []ListColumn, layout *layouts.ColumnsLayout) *ListHeader l.columnVisible[i] = true } rect := myTheme.NewThemedRectangle(myTheme.ColorNameListHeader) - rect.CornerRadiusName = theme.SizeNameSelectionRadius + rect.CornerRadius = theme.SelectionRadiusSize() l.container = container.NewStack(rect, l.columnsContainer) l.ExtendBaseWidget(l) l.buildColumns() diff --git a/ui/widgets/nowplayingcard.go b/ui/widgets/nowplayingcard.go index 5618b06..1538a1c 100644 --- a/ui/widgets/nowplayingcard.go +++ b/ui/widgets/nowplayingcard.go @@ -23,7 +23,8 @@ import ( type NowPlayingCard struct { widget.BaseWidget - DisableRating bool + DisableRating bool + ImageCornerRadius float32 trackName *OptionHyperlink artistName *MultiHyperlink @@ -163,6 +164,11 @@ func (n *NowPlayingCard) Update(track mediaprovider.MediaItem) { n.Refresh() } +func (n *NowPlayingCard) Refresh() { + n.cover.CornerRadius = n.ImageCornerRadius + n.BaseWidget.Refresh() +} + func (n *NowPlayingCard) SetImage(cover image.Image) { n.cover.SetImage(cover, true) } diff --git a/ui/widgets/playqueuelist.go b/ui/widgets/playqueuelist.go index 06947ce..9ee3e32 100644 --- a/ui/widgets/playqueuelist.go +++ b/ui/widgets/playqueuelist.go @@ -389,6 +389,7 @@ func NewPlayQueueListRow(playQueueList *PlayQueueList, im *backend.ImageManager, p.ExtendBaseWidget(p) p.cover.ScaleMode = canvas.ImageScaleFastest + p.cover.CornerRadius = theme.InputRadiusSize() p.title.OnMouseIn = p.MouseIn p.title.OnMouseOut = p.MouseOut p.artist.OnTapped = playQueueList.onArtistTapped diff --git a/ui/widgets/tracklistrow.go b/ui/widgets/tracklistrow.go index e4dd0be..847afdc 100644 --- a/ui/widgets/tracklistrow.go +++ b/ui/widgets/tracklistrow.go @@ -274,6 +274,7 @@ func NewExpandedTracklistRow(tracklist *Tracklist, im *backend.ImageManager, pla t.playingIcon = playingIcon t.img = NewImagePlaceholder(myTheme.TracksIcon, tracklistThumbnailSize) t.img.ScaleMode = canvas.ImageScaleFastest + t.img.CornerRadius = theme.InputRadiusSize() t.imageLoader = util.NewThumbnailLoader(im, func(i image.Image) { t.img.SetImage(i, false)