Fix #625: Allow customization of grid card size

This commit is contained in:
Drew Weymouth
2025-05-28 09:21:24 -07:00
parent af1ae4641e
commit 0fd8b4621b
7 changed files with 49 additions and 4 deletions
+3
View File
@@ -9,6 +9,7 @@ import (
"fyne.io/fyne/v2/lang"
"github.com/dweymouth/supersonic/backend"
"github.com/dweymouth/supersonic/backend/mediaprovider"
"github.com/dweymouth/supersonic/sharedutil"
myTheme "github.com/dweymouth/supersonic/ui/theme"
@@ -282,6 +283,7 @@ func (g *GridView) createGridWrap() {
// update func
func(itemID widget.GridWrapItemID, obj fyne.CanvasObject) {
ac := obj.(*GridViewItem)
ac.SetSize(backend.AppInstance().Config.GridView.CardSize)
g.doUpdateItemCard(int(itemID), ac)
},
)
@@ -289,6 +291,7 @@ func (g *GridView) createGridWrap() {
func (g *GridView) createNewItemCard() fyne.CanvasObject {
card := NewGridViewItem(g.Placeholder)
card.SetSize(backend.AppInstance().Config.GridView.CardSize)
card.ItemIndex = -1
card.ImgLoader = util.NewThumbnailLoader(g.imageFetcher, card.Cover.SetImage)
card.ImgLoader.OnBeforeLoad = func() { card.Cover.SetImage(nil) }