use rounded image corners (TODO: allow disabling this)
This commit is contained in:
@@ -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)
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
|
||||
@@ -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()
|
||||
}
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
|
||||
@@ -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
|
||||
|
||||
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user