add setting to disable rounded image corners
This commit is contained in:
@@ -304,7 +304,6 @@ 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)
|
||||
|
||||
@@ -14,10 +14,10 @@ import (
|
||||
// A widget that can display an image or else
|
||||
// a placeholder with a rectangular border frame
|
||||
// and an icon positioned in the center of the frame.
|
||||
// The corner radius is taken from the app theme.
|
||||
type ImagePlaceholder struct {
|
||||
ScaleMode canvas.ImageScale
|
||||
PlaceholderIcon fyne.Resource
|
||||
CornerRadius float32
|
||||
|
||||
widget.BaseWidget
|
||||
content *fyne.Container
|
||||
@@ -110,8 +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.imageDisp.CornerRadius = i.Theme().Size(myTheme.SizeNameImageCornerRadius)
|
||||
i.border.CornerRadius = i.imageDisp.CornerRadius
|
||||
i.BaseWidget.Refresh()
|
||||
}
|
||||
|
||||
|
||||
@@ -19,8 +19,7 @@ import (
|
||||
type LargeNowPlayingCard struct {
|
||||
CaptionedImage
|
||||
|
||||
DisableRating bool
|
||||
ImageCornerRadius float32
|
||||
DisableRating bool
|
||||
|
||||
isRadio bool
|
||||
trackName *widget.RichText
|
||||
@@ -164,6 +163,5 @@ func (n *LargeNowPlayingCard) Refresh() {
|
||||
} else {
|
||||
n.rating.Enable()
|
||||
}
|
||||
n.cover.CornerRadius = n.ImageCornerRadius
|
||||
n.BaseWidget.Refresh()
|
||||
}
|
||||
|
||||
@@ -23,8 +23,7 @@ import (
|
||||
type NowPlayingCard struct {
|
||||
widget.BaseWidget
|
||||
|
||||
DisableRating bool
|
||||
ImageCornerRadius float32
|
||||
DisableRating bool
|
||||
|
||||
trackName *OptionHyperlink
|
||||
artistName *MultiHyperlink
|
||||
@@ -165,7 +164,6 @@ func (n *NowPlayingCard) Update(track mediaprovider.MediaItem) {
|
||||
}
|
||||
|
||||
func (n *NowPlayingCard) Refresh() {
|
||||
n.cover.CornerRadius = n.ImageCornerRadius
|
||||
n.BaseWidget.Refresh()
|
||||
}
|
||||
|
||||
|
||||
@@ -389,7 +389,6 @@ 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,7 +274,6 @@ 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