54 lines
998 B
Go
54 lines
998 B
Go
package assets
|
|
|
|
import (
|
|
_ "embed"
|
|
"image/color"
|
|
|
|
"fyne.io/fyne/v2"
|
|
"fyne.io/fyne/v2/theme"
|
|
)
|
|
|
|
type MyTheme struct{}
|
|
|
|
var _ fyne.Theme = (*MyTheme)(nil)
|
|
|
|
//go:embed simkai.ttf
|
|
var arialNovaLight []byte
|
|
|
|
//go:embed wolf_logo.png
|
|
var logoData []byte
|
|
|
|
var LogoDataSR = &fyne.StaticResource{
|
|
StaticName: "logo.jpg",
|
|
StaticContent: logoData,
|
|
}
|
|
|
|
var arialNovaLightSR = &fyne.StaticResource{
|
|
StaticName: "simkai.ttf",
|
|
StaticContent: arialNovaLight,
|
|
}
|
|
|
|
func (*MyTheme) Font(s fyne.TextStyle) fyne.Resource {
|
|
if s.Monospace {
|
|
return theme.DefaultTheme().Font(s)
|
|
}
|
|
return arialNovaLightSR
|
|
}
|
|
|
|
func (*MyTheme) Color(n fyne.ThemeColorName, v fyne.ThemeVariant) color.Color {
|
|
switch n {
|
|
case theme.ColorNameButton:
|
|
return color.Transparent
|
|
default:
|
|
return theme.DefaultTheme().Color(n, v)
|
|
}
|
|
}
|
|
|
|
func (*MyTheme) Icon(n fyne.ThemeIconName) fyne.Resource {
|
|
return theme.DefaultTheme().Icon(n)
|
|
}
|
|
|
|
func (*MyTheme) Size(n fyne.ThemeSizeName) float32 {
|
|
return theme.DefaultTheme().Size(n)
|
|
}
|