mirror of
https://github.com/AynaLivePlayer/AynaLivePlayer.git
synced 2026-03-19 02:19:45 +08:00
* rewrite * update submodule * make width height configurable * update dependency * update * update file * update dep * fix basic config layout * update plugin management * more stuff * add blacklist * fix todo * fix windows gethandle * update windows update guide * update windows build guide * include go mod tidy in script * update todo * fix source session * fix text output * add plugin play duration control * fix id diange not working * update todo * update version number
43 lines
814 B
Go
43 lines
814 B
Go
package gui
|
|
|
|
import (
|
|
"AynaLivePlayer/resource"
|
|
"fyne.io/fyne/v2"
|
|
"image/color"
|
|
|
|
xtheme "fyne.io/x/fyne/theme"
|
|
)
|
|
|
|
type myTheme struct{}
|
|
|
|
var _ fyne.Theme = (*myTheme)(nil)
|
|
|
|
// return bundled font resource
|
|
func (*myTheme) Font(s fyne.TextStyle) fyne.Resource {
|
|
if s.Monospace {
|
|
return resource.FontMSYaHei
|
|
}
|
|
if s.Bold {
|
|
if s.Italic {
|
|
return resource.FontMSYaHeiBold
|
|
}
|
|
return resource.FontMSYaHei
|
|
}
|
|
if s.Italic {
|
|
return resource.FontMSYaHei
|
|
}
|
|
return resource.FontMSYaHei
|
|
}
|
|
|
|
func (*myTheme) Color(n fyne.ThemeColorName, v fyne.ThemeVariant) color.Color {
|
|
return xtheme.AdwaitaTheme().Color(n, v)
|
|
}
|
|
|
|
func (*myTheme) Icon(n fyne.ThemeIconName) fyne.Resource {
|
|
return xtheme.AdwaitaTheme().Icon(n)
|
|
}
|
|
|
|
func (*myTheme) Size(n fyne.ThemeSizeName) float32 {
|
|
return xtheme.AdwaitaTheme().Size(n)
|
|
}
|