diff --git a/res/bundled.go b/res/bundled.go index da4fd5d..b55797c 100644 --- a/res/bundled.go +++ b/res/bundled.go @@ -143,7 +143,7 @@ var ResFilterSvg = &fyne.StaticResource{ var ResDefaultToml = &fyne.StaticResource{ StaticName: "default.toml", StaticContent: []byte( - "[SupersonicTheme]\nName = \"Default\"\nVersion = \"0.1\"\nSupportsDark = true\nSupportsLight = true\n\n[DarkColors]\nPageBackground = \"#0F0F0F\"\nBackground = \"#232323\"\nScrollBar = \"#F3F3F3\"\nButton = \"#14141432\"\nInputBackground = \"#14141432\"\n\n[LightColors]\nPageBackground = \"#FAFAFA\"\nBackground = \"#E1DFE1\"\nScrollBar = \"#565656\"\nButton = \"#C8C8C8F0\"\nDisabledButton = \"#CDCDCDF0\"\nForeground = \"#0A0A0A\"\nPrimary = \"#1919FA\""), + "[SupersonicTheme]\nName = \"Default\"\nVersion = \"0.1\"\nSupportsDark = true\nSupportsLight = true\n\n[DarkColors]\nPageBackground = \"#0F0F0F\"\nListHeader = \"#232323\"\nBackground = \"#232323\"\nScrollBar = \"#F3F3F3\"\nButton = \"#14141432\"\nInputBackground = \"#14141432\"\n\n[LightColors]\nPageBackground = \"#FAFAFA\"\nListHeader = \"#E1DFE1\"\nBackground = \"#E1DFE1\"\nScrollBar = \"#565656\"\nButton = \"#C8C8C8F0\"\nDisabledButton = \"#CDCDCDF0\"\nForeground = \"#0A0A0A\"\nPrimary = \"#1919FA\""), } var ResLICENSE = &fyne.StaticResource{ StaticName: "LICENSE", diff --git a/res/themes/default.toml b/res/themes/default.toml index 7903deb..a7c0dc7 100644 --- a/res/themes/default.toml +++ b/res/themes/default.toml @@ -6,6 +6,7 @@ SupportsLight = true [DarkColors] PageBackground = "#0F0F0F" +ListHeader = "#232323" Background = "#232323" ScrollBar = "#F3F3F3" Button = "#14141432" @@ -13,6 +14,7 @@ InputBackground = "#14141432" [LightColors] PageBackground = "#FAFAFA" +ListHeader = "#E1DFE1" Background = "#E1DFE1" ScrollBar = "#565656" Button = "#C8C8C8F0" diff --git a/ui/theme/theme.go b/ui/theme/theme.go index 8a02bd3..8b2d484 100644 --- a/ui/theme/theme.go +++ b/ui/theme/theme.go @@ -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: diff --git a/ui/theme/themefile.go b/ui/theme/themefile.go index a9c6850..5f8bced 100644 --- a/ui/theme/themefile.go +++ b/ui/theme/themefile.go @@ -32,6 +32,8 @@ type ThemeFile struct { type ThemeColors struct { // Supersonic-specific colors + ListHeader string + PageBackground string // Fyne colors diff --git a/ui/widgets/listheader.go b/ui/widgets/listheader.go index 7f3d418..bbd7551 100644 --- a/ui/widgets/listheader.go +++ b/ui/widgets/listheader.go @@ -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