make ListHeader color independently customizable

This commit is contained in:
Drew Weymouth
2023-06-20 18:33:41 -07:00
parent c6fc76172a
commit ecffb81f72
5 changed files with 12 additions and 3 deletions
+6 -1
View File
@@ -18,7 +18,10 @@ import (
"fyne.io/fyne/v2/theme"
)
const ColorNamePageBackground fyne.ThemeColorName = "PageBackground"
const (
ColorNameListHeader fyne.ThemeColorName = "ListHeader"
ColorNamePageBackground fyne.ThemeColorName = "PageBackground"
)
type AppearanceMode string
@@ -80,6 +83,8 @@ func (m *MyTheme) Color(name fyne.ThemeColorName, _ fyne.ThemeVariant) color.Col
defColors = m.defaultThemeFile.LightColors
}
switch name {
case ColorNameListHeader:
return colorOrDefault(colors.ListHeader, defColors.ListHeader, name, variant)
case ColorNamePageBackground:
return colorOrDefault(colors.PageBackground, defColors.PageBackground, name, variant)
case theme.ColorNameBackground:
+2
View File
@@ -32,6 +32,8 @@ type ThemeFile struct {
type ThemeColors struct {
// Supersonic-specific colors
ListHeader string
PageBackground string
// Fyne colors
+1 -1
View File
@@ -62,7 +62,7 @@ func NewListHeader(cols []ListColumn, layout *layouts.ColumnsLayout) *ListHeader
for i := range l.columnVisible {
l.columnVisible[i] = true
}
l.container = container.NewMax(myTheme.NewThemedRectangle(theme.ColorNameBackground), l.columnsContainer)
l.container = container.NewMax(myTheme.NewThemedRectangle(myTheme.ColorNameListHeader), l.columnsContainer)
l.ExtendBaseWidget(l)
l.buildColumns()
return l