forked from secretnamebasis/simple-wallet
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy paththeme.go
More file actions
41 lines (34 loc) · 910 Bytes
/
Copy paththeme.go
File metadata and controls
41 lines (34 loc) · 910 Bytes
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
// this is as generic as it gets.
// the disabled text color is too dark, imo; so...
// custom theme!
package main
import (
"image/color"
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/theme"
)
type customTheme struct{}
func (customTheme) Font(style fyne.TextStyle) fyne.Resource {
if style.Monospace {
return theme.DefaultTheme().Font(style)
}
if style.Bold {
if style.Italic {
return resourceNotoSansBoldItalicTtf
}
return resourceNotoSansBoldTtf
}
if style.Italic {
return resourceNotoSansItalicTtf
}
return resourceNotoSansRegularTtf
}
func (customTheme) Color(name fyne.ThemeColorName, variant fyne.ThemeVariant) color.Color {
return theme.DefaultTheme().Color(name, variant)
}
func (customTheme) Icon(name fyne.ThemeIconName) fyne.Resource {
return theme.DefaultTheme().Icon(name)
}
func (customTheme) Size(name fyne.ThemeSizeName) float32 {
return theme.DefaultTheme().Size(name)
}