0.0.0 第一次提交
This commit is contained in:
Binary file not shown.
Binary file not shown.
|
After Width: | Height: | Size: 141 KiB |
Binary file not shown.
@@ -0,0 +1,53 @@
|
||||
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 logo.jpg
|
||||
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)
|
||||
}
|
||||
Reference in New Issue
Block a user