/
config.go
58 lines (50 loc) · 1.28 KB
/
config.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
package palette
type Config struct {
Window configWindow `json:"window"`
Boxes configBoxes `json:"boxes"`
Fonts configFonts `json:"fonts"`
}
type configWindow struct {
Size configSize `json:"size"`
}
type configSize struct {
Width int `json:"width"`
Height int `json:"height"`
}
type configBoxes struct {
Align configSize `json:"align"`
Offset configSize `json:"offset"`
Widths []int `json:"widths"`
}
type configFonts struct {
Default configFont `json:"default"`
Cursor configCursor `json:"cursor"`
}
type configFont struct {
Height int `json:"height"`
Attributes map[string]string `json:"attributes"`
Align configSize `json:"align"`
Offset int `json:"offset"`
}
type configCursor struct {
Width int `json:"width"`
}
func defaultConfig() *Config {
return &Config{
Window: configWindow{
Size: configSize{Width: 1280, Height: 768},
},
Boxes: configBoxes{
Align: configSize{Width: 20, Height: 16},
Offset: configSize{Width: 50, Height: 16},
Widths: []int{100, 140, 300},
},
Fonts: configFonts{
Default: configFont{
Attributes: map[string]string{"family": "Verdana"},
Height: 12,
Align: configSize{Width: 10, Height: 6}, Offset: 2},
Cursor: configCursor{Width: 2},
},
}
}