-
-
Notifications
You must be signed in to change notification settings - Fork 12
/
Copy paththeme.go
59 lines (50 loc) · 1.69 KB
/
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
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
"image/color"
)
var (
orange = &color.NRGBA{R: 198, G: 123, B: 0, A: 255}
orangeTransparent = &color.NRGBA{R: 198, G: 123, B: 0, A: 180}
orangeTransparentSelection = &color.NRGBA{R: 198, G: 123, B: 0, A: 100}
colorDarkHover = color.NRGBA{R: 0xff, G: 0xff, B: 0xff, A: 0x0f}
colorDarkDisabled = color.NRGBA{R: 80, G: 80, B: 81, A: 255}
colorDarkInputBackground = color.NRGBA{R: 0x25, G: 0x25, B: 0x28, A: 0xff}
ColorSeparator = color.NRGBA{R: 120, G: 120, B: 120, A: 255}
)
type AppTheme struct{}
var _ fyne.Theme = (*AppTheme)(nil)
func (m AppTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
switch name {
case theme.ColorNamePrimary:
return orange
case theme.ColorNameScrollBar:
return orangeTransparent
case theme.ColorNameHover, theme.ColorNameFocus:
return colorDarkHover
case theme.ColorNameSelection:
return orangeTransparentSelection
case theme.ColorNameDisabled:
return colorDarkDisabled
case theme.ColorNameInputBackground:
return colorDarkInputBackground
case theme.ColorNameSeparator:
return ColorSeparator
}
variant = theme.VariantDark
return theme.DefaultTheme().Color(name, variant)
}
func (m AppTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
return theme.DefaultTheme().Icon(name)
}
func (m AppTheme) Font(style fyne.TextStyle) fyne.Resource {
if style.Monospace {
return theme.DefaultTheme().Font(style)
}
return theme.DefaultTheme().Font(style)
//return Resources.ResourceGoNotoKurrentRegularTtf
}
func (m AppTheme) Size(name fyne.ThemeSizeName) float32 {
return theme.DefaultTheme().Size(name)
}