theme

package module
v0.0.0-...-6a5f733 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2023 License: Artistic-2.0 Imports: 4 Imported by: 0

README


package main

import (
	"fyne.io/fyne/v2/app"
	"fyne.io/fyne/v2/widget"
	"fyneGUI/theme"
)

func main() {
	a := app.New()                          //创建一个fyne应用
	a.Settings().SetTheme(&theme.MyTheme{}) //引入字体,让程序可以显示中文
	w := a.NewWindow("\\(@^0^@)/")          //创建一个窗口的名称
	w.SetContent(widget.NewLabel("hello"))  //窗口内容
	w.ShowAndRun()                          //显示窗口
}

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//go:embed fonts/simhei.ttf
	NotoSansSC []byte
)

声明静态资源,在打包的时候导入到包里面

Functions

This section is empty.

Types

type MyTheme

type MyTheme struct{}

func (*MyTheme) Color

func (*MyTheme) Color(n fyne.ThemeColorName, v fyne.ThemeVariant) color.Color

func (MyTheme) Font

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

Font StaticName 为 fonts 目录下的 ttf 类型的字体文件名

func (*MyTheme) Icon

func (*MyTheme) Icon(n fyne.ThemeIconName) fyne.Resource

func (*MyTheme) Size

func (*MyTheme) Size(n fyne.ThemeSizeName) float32

Jump to

Keyboard shortcuts

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