-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.go
35 lines (27 loc) · 818 Bytes
/
theme.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
package main
import (
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)
type myTheme struct{}
var _ fyne.Theme = (*myTheme)(nil)
func (m myTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
if name != theme.ColorNameDisabledButton {
return theme.DefaultTheme().Color(name, variant)
}
invertedVariant := theme.VariantDark
if variant == theme.VariantDark {
invertedVariant = theme.VariantLight
}
return theme.DefaultTheme().Color(name, invertedVariant)
}
func (m myTheme) Font(style fyne.TextStyle) fyne.Resource {
return theme.DefaultTheme().Font(style)
}
func (m myTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
return theme.DefaultTheme().Icon(name)
}
func (m myTheme) Size(name fyne.ThemeSizeName) float32 {
return theme.DefaultTheme().Size(name)
}