theme

package
v0.10.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 21, 2024 License: GPL-3.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ColorNameListHeader     fyne.ThemeColorName = "ListHeader"
	ColorNamePageBackground fyne.ThemeColorName = "PageBackground"
	ColorNamePageHeader     fyne.ThemeColorName = "PageHeader"
)

Variables

View Source
var (
	AlbumIcon       fyne.Resource = theme.NewThemedResource(res.ResDiscSvg)
	ArtistIcon      fyne.Resource = theme.NewThemedResource(res.ResPeopleSvg)
	BroadcastIcon   fyne.Resource = theme.NewThemedResource(res.ResBroadcastSvg)
	FavoriteIcon    fyne.Resource = theme.NewThemedResource(res.ResHeartFilledSvg)
	NotFavoriteIcon fyne.Resource = theme.NewThemedResource(res.ResHeartOutlineSvg)
	NowPlayingIcon  fyne.Resource = theme.NewThemedResource(res.ResHeadphonesSvg)
	PlaylistIcon    fyne.Resource = theme.NewThemedResource(res.ResPlaylistSvg)
	PlayNextIcon    fyne.Resource = theme.NewThemedResource(res.ResPlaylistAddNextSvg)
	ShareIcon       fyne.Resource = theme.NewThemedResource(res.ResShareSvg)
	ShuffleIcon     fyne.Resource = theme.NewThemedResource(res.ResShuffleSvg)
	TracksIcon      fyne.Resource = theme.NewThemedResource(res.ResMusicnotesSvg)
	GenreIcon       fyne.Resource = theme.NewThemedResource(res.ResTheatermasksSvg)
	FilterIcon      fyne.Resource = theme.NewThemedResource(res.ResFilterSvg)
	RepeatIcon      fyne.Resource = theme.NewThemedResource(res.ResRepeatSvg)
	RepeatOneIcon   fyne.Resource = theme.NewThemedResource(res.ResRepeatoneSvg)
	SortIcon        fyne.Resource = theme.NewThemedResource(res.ResUpdownarrowSvg)
)

Functions

func ColorStringToColor added in v0.4.0

func ColorStringToColor(colorStr string) (color.Color, error)

Parses a CSS-style #RRGGBB or #RRGGBBAA string

Types

type AppearanceMode

type AppearanceMode string
const (
	AppearanceLight AppearanceMode = "Light"
	AppearanceDark  AppearanceMode = "Dark"
	AppearanceAuto  AppearanceMode = "Auto"

	DefaultAppearance AppearanceMode = AppearanceDark
)

type MyTheme

type MyTheme struct {
	NormalFont string
	BoldFont   string
	// contains filtered or unexported fields
}

func NewMyTheme

func NewMyTheme(config *backend.ThemeConfig, themeFileDir string) *MyTheme

func (*MyTheme) Color

func (m *MyTheme) Color(name fyne.ThemeColorName, _ fyne.ThemeVariant) color.Color

func (*MyTheme) Font

func (m *MyTheme) Font(style fyne.TextStyle) fyne.Resource

func (*MyTheme) Icon

func (m *MyTheme) Icon(name fyne.ThemeIconName) fyne.Resource

func (*MyTheme) ListThemeFiles added in v0.4.0

func (m *MyTheme) ListThemeFiles() map[string]string

Returns a map [themeFileName] -> displayName

func (*MyTheme) Size

func (m *MyTheme) Size(name fyne.ThemeSizeName) float32

type ThemeColors added in v0.4.0

type ThemeColors struct {

	// Background color of the header row in list views.
	ListHeader string

	// Background color for each page. The main color in the app.
	PageBackground string

	// Color of the background rectangle around the Album, Artist, Playlist page headers.
	//
	// Since: Supersonic theme file version 0.2
	PageHeader string

	Background string

	Button string

	DisabledButton string

	Disabled string

	Error string

	Focus string

	Foreground string

	Hover string

	// since Supersonic theme file version 0.2 (Fyne version 2.4)
	Hyperlink string

	InputBackground string

	InputBorder string

	MenuBackground string

	OverlayBackground string

	Placeholder string

	Pressed string

	Primary string

	ScrollBar string

	Selection string

	Separator string

	Shadow string

	Success string

	Warning string
}

type ThemeFile added in v0.4.0

type ThemeFile struct {
	SupersonicTheme ThemeFileHeader

	DarkColors  ThemeColors
	LightColors ThemeColors
}

func DecodeThemeFile added in v0.4.0

func DecodeThemeFile(reader io.Reader) (*ThemeFile, error)

func ReadThemeFile added in v0.4.0

func ReadThemeFile(filePath string) (*ThemeFile, error)

func (*ThemeFile) SupportsVariant added in v0.4.0

func (t *ThemeFile) SupportsVariant(v fyne.ThemeVariant) bool

type ThemeFileHeader added in v0.4.0

type ThemeFileHeader struct {
	Name          string
	Version       string
	SupportsDark  bool
	SupportsLight bool
}

type ThemedRectangle

type ThemedRectangle struct {
	widget.BaseWidget

	ColorName        fyne.ThemeColorName
	Translucent      bool
	BorderWidth      float32
	BorderColorName  fyne.ThemeColorName
	CornerRadiusName fyne.ThemeSizeName
	// contains filtered or unexported fields
}

func NewThemedRectangle

func NewThemedRectangle(colorName fyne.ThemeColorName) *ThemedRectangle

func (*ThemedRectangle) CreateRenderer

func (t *ThemedRectangle) CreateRenderer() fyne.WidgetRenderer

func (*ThemedRectangle) Refresh

func (t *ThemedRectangle) Refresh()

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL