1 Star 0 Fork 21

eddylapis / Fyne

forked from Gitee 极速下载 / Fyne 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
advanced.go 756 Bytes
一键复制 编辑 原始数据 按行查看 历史
Andy Williams 提交于 2019-02-15 22:24 . Tidying up fyne_demo UI a little
package main
import (
"fmt"
"fyne.io/fyne"
"fyne.io/fyne/widget"
)
func scaleString(c fyne.Canvas) string {
return fmt.Sprintf("%0.2f", c.Scale())
}
// Advanced loads a window that shows details and settings that are a bit
// more detailed than normally needed.
func Advanced(app fyne.App) {
win := app.NewWindow("Advanced")
scale := widget.NewLabel("")
screen := widget.NewGroup("Screen", widget.NewForm(
&widget.FormItem{Text: "Scale", Widget: scale},
))
win.SetContent(widget.NewVBox(screen,
widget.NewButton("Custom Theme", func() {
app.Settings().SetTheme(newCustomTheme())
}),
widget.NewButton("Fullscreen", func() {
win.SetFullScreen(!win.FullScreen())
}),
))
win.Show()
scale.SetText(scaleString(win.Canvas()))
}
Go
1
https://gitee.com/eddylapis/Fyne.git
git@gitee.com:eddylapis/Fyne.git
eddylapis
Fyne
Fyne
v1.0.0

搜索帮助