39 lines
736 B
Go
39 lines
736 B
Go
package main
|
|
|
|
import (
|
|
"image/color"
|
|
|
|
"fyne.io/fyne/v2"
|
|
"fyne.io/fyne/v2/theme"
|
|
)
|
|
|
|
type xinTheme struct{}
|
|
|
|
func (*xinTheme) Font(s fyne.TextStyle) fyne.Resource {
|
|
if s.Monospace {
|
|
return theme.DefaultTheme().Font(s)
|
|
}
|
|
if s.Bold {
|
|
if s.Italic {
|
|
return theme.DefaultTheme().Font(s)
|
|
}
|
|
return resourceGoRegularTtf
|
|
}
|
|
if s.Italic {
|
|
return theme.DefaultTheme().Font(s)
|
|
}
|
|
return resourceGoRegularTtf
|
|
}
|
|
|
|
func (*xinTheme) Color(n fyne.ThemeColorName, v fyne.ThemeVariant) color.Color {
|
|
return theme.DefaultTheme().Color(n, v)
|
|
}
|
|
|
|
func (*xinTheme) Icon(n fyne.ThemeIconName) fyne.Resource {
|
|
return theme.DefaultTheme().Icon(n)
|
|
}
|
|
|
|
func (*xinTheme) Size(n fyne.ThemeSizeName) float32 {
|
|
return theme.DefaultTheme().Size(n)
|
|
}
|