-
Notifications
You must be signed in to change notification settings - Fork 1
/
main.go
40 lines (36 loc) · 1.04 KB
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
package main
import (
"fyne.io/fyne/v2"
"fyne.io/fyne/v2/app"
"fyne.io/fyne/v2/container"
"fyne.io/fyne/v2/theme"
"fyne.io/fyne/v2/widget"
)
func main() {
a := app.New()
w := a.NewWindow("Fynematic example")
w.Resize(fyne.NewSize(200, 200))
w.SetContent(container.NewBorder(
nil,
container.NewGridWithColumns(2,
widget.NewButton("Dark", func() {
a.Settings().SetTheme(theme.DarkTheme())
}),
widget.NewButton("Light", func() {
a.Settings().SetTheme(theme.LightTheme())
}),
),
nil,
makeAppTabs(),
))
w.ShowAndRun()
}
func makeAppTabs() *container.AppTabs {
return container.NewAppTabs(
container.NewTabItem("Outlined", widget.NewIcon(SentimentSatisfiedOutlinedIconThemed)),
container.NewTabItem("Filled", widget.NewIcon(SentimentSatisfiedFilledIconThemed)),
container.NewTabItem("Round", widget.NewIcon(SentimentSatisfiedRoundIconThemed)),
container.NewTabItem("Sharp", widget.NewIcon(SentimentSatisfiedSharpIconThemed)),
container.NewTabItem("Twotone", widget.NewIcon(SentimentSatisfiedTwotoneIconThemed)),
)
}