switch GridView to icon placeholder

This commit is contained in:
Drew Weymouth
2023-05-23 17:35:26 -07:00
parent 5acd9dd37f
commit de7a16639e
16 changed files with 92 additions and 88 deletions
+8 -3
View File
@@ -11,7 +11,9 @@ type ThemedRectangle struct {
rect *canvas.Rectangle
ColorName fyne.ThemeColorName
ColorName fyne.ThemeColorName
BorderWidth float32
BorderColorName fyne.ThemeColorName
}
func NewThemedRectangle(colorName fyne.ThemeColorName) *ThemedRectangle {
@@ -25,8 +27,11 @@ func NewThemedRectangle(colorName fyne.ThemeColorName) *ThemedRectangle {
}
func (t *ThemedRectangle) Refresh() {
t.rect.FillColor = fyne.CurrentApp().Settings().Theme().Color(t.ColorName,
fyne.CurrentApp().Settings().ThemeVariant())
settings := fyne.CurrentApp().Settings()
theme := settings.Theme()
t.rect.FillColor = theme.Color(t.ColorName, settings.ThemeVariant())
t.rect.StrokeWidth = t.BorderWidth
t.rect.StrokeColor = theme.Color(t.BorderColorName, settings.ThemeVariant())
t.BaseWidget.Refresh()
}