forked from fyne-io/fyne
/
theme.go
89 lines (67 loc) · 1.47 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
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
package main
import (
"image/color"
"fyne.io/fyne"
"fyne.io/fyne/theme"
)
var (
purple = &color.RGBA{128, 0, 128, 255}
orange = &color.RGBA{198, 123, 0, 255}
grey = &color.Gray{123}
)
type customTheme struct {
}
func (customTheme) BackgroundColor() color.Color {
return purple
}
func (customTheme) ButtonColor() color.Color {
return color.Black
}
func (customTheme) HyperlinkColor() color.Color {
return orange
}
func (customTheme) TextColor() color.Color {
return color.White
}
func (customTheme) PlaceHolderColor() color.Color {
return grey
}
func (customTheme) PrimaryColor() color.Color {
return orange
}
func (customTheme) FocusColor() color.Color {
return orange
}
func (customTheme) ScrollBarColor() color.Color {
return grey
}
func (customTheme) TextSize() int {
return 12
}
func (customTheme) TextFont() fyne.Resource {
return theme.DefaultTextBoldFont()
}
func (customTheme) TextBoldFont() fyne.Resource {
return theme.DefaultTextBoldFont()
}
func (customTheme) TextItalicFont() fyne.Resource {
return theme.DefaultTextBoldItalicFont()
}
func (customTheme) TextBoldItalicFont() fyne.Resource {
return theme.DefaultTextBoldItalicFont()
}
func (customTheme) TextMonospaceFont() fyne.Resource {
return theme.DefaultTextMonospaceFont()
}
func (customTheme) Padding() int {
return 10
}
func (customTheme) IconInlineSize() int {
return 20
}
func (customTheme) ScrollBarSize() int {
return 10
}
func newCustomTheme() fyne.Theme {
return &customTheme{}
}