WIP replace png icons - heart icon doesn't theme
This commit is contained in:
committed by
Natalí Paura
parent
407b5f2780
commit
b041602899
@@ -0,0 +1,33 @@
|
||||
package widgets
|
||||
|
||||
import (
|
||||
"fyne.io/fyne/v2"
|
||||
"fyne.io/fyne/v2/container"
|
||||
"fyne.io/fyne/v2/theme"
|
||||
"fyne.io/fyne/v2/widget"
|
||||
myTheme "github.com/dweymouth/supersonic/ui/theme"
|
||||
)
|
||||
|
||||
type Carousel struct {
|
||||
widget.BaseWidget
|
||||
|
||||
Title string
|
||||
Items []GridViewItemModel
|
||||
|
||||
titleDisplay *widget.Label
|
||||
}
|
||||
|
||||
func NewCarousel(title string, items []GridViewItemModel) *Carousel {
|
||||
c := &Carousel{Title: title, Items: items}
|
||||
c.ExtendBaseWidget(c)
|
||||
c.titleDisplay = widget.NewLabelWithStyle(title, fyne.TextAlignLeading, fyne.TextStyle{Bold: true})
|
||||
|
||||
return c
|
||||
}
|
||||
|
||||
func (c *Carousel) CreateRenderer() fyne.WidgetRenderer {
|
||||
bg := myTheme.NewThemedRectangle(myTheme.ColorNamePageHeader)
|
||||
bg.CornerRadiusName = theme.SizeNameInputRadius
|
||||
container := container.NewStack(bg)
|
||||
return widget.NewSimpleRenderer(container)
|
||||
}
|
||||
@@ -1,7 +1,6 @@
|
||||
package widgets
|
||||
|
||||
import (
|
||||
"github.com/dweymouth/supersonic/res"
|
||||
"github.com/dweymouth/supersonic/ui/theme"
|
||||
|
||||
"fyne.io/fyne/v2"
|
||||
@@ -18,7 +17,7 @@ func NewFavoriteButton(onTapped func()) *FavoriteButton {
|
||||
f := &FavoriteButton{
|
||||
Button: widget.Button{
|
||||
OnTapped: onTapped,
|
||||
Icon: res.ResHeartOutlineInvertPng,
|
||||
Icon: theme.NotFavoriteIcon,
|
||||
},
|
||||
}
|
||||
f.ExtendBaseWidget(f)
|
||||
|
||||
Reference in New Issue
Block a user