-
Notifications
You must be signed in to change notification settings - Fork 0
/
theme.go
41 lines (30 loc) · 855 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
36
37
38
39
40
41
package main
import (
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)
type newTheme struct{}
var _ fyne.Theme = (*newTheme)(nil)
func (m newTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
none := color.RGBA{R: 0, G: 0, B: 0, A: 0}
switch name {
case theme.ColorNameButton, theme.ColorNameHover:
return none
case theme.ColorNameOverlayBackground:
return OverlayBackgroundColor
}
return theme.DefaultTheme().Color(name, variant)
}
func (m newTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
return theme.DefaultTheme().Icon(name)
}
func (m newTheme) Font(style fyne.TextStyle) fyne.Resource {
return theme.DefaultTheme().Font(style)
}
func (m newTheme) Size(name fyne.ThemeSizeName) float32 {
if name == theme.SizeNamePadding {
return 0
}
return theme.DefaultTheme().Size(name)
}