2023-03-04 20:56:44 -07:00
|
|
|
package main
|
|
|
|
|
|
|
|
import "git.tebibyte.media/sashakoshka/tomo"
|
|
|
|
import "git.tebibyte.media/sashakoshka/tomo/theme"
|
|
|
|
import "git.tebibyte.media/sashakoshka/tomo/layouts/basic"
|
|
|
|
import "git.tebibyte.media/sashakoshka/tomo/elements/basic"
|
2023-03-15 23:14:39 -06:00
|
|
|
import _ "git.tebibyte.media/sashakoshka/tomo/backends/all"
|
2023-03-16 12:22:56 -06:00
|
|
|
import "git.tebibyte.media/sashakoshka/tomo/elements/containers"
|
2023-03-04 20:56:44 -07:00
|
|
|
|
|
|
|
func main () {
|
|
|
|
tomo.Run(run)
|
|
|
|
}
|
|
|
|
|
|
|
|
func run () {
|
|
|
|
window, _ := tomo.NewWindow(360, 2)
|
|
|
|
window.SetTitle("Icons")
|
|
|
|
|
2023-03-16 12:22:56 -06:00
|
|
|
container := containers.NewContainer(basicLayouts.Vertical { true, true })
|
2023-03-04 20:56:44 -07:00
|
|
|
window.Adopt(container)
|
|
|
|
|
|
|
|
container.Adopt(basicElements.NewLabel("Just some of the wonderful icons we have:", false), false)
|
|
|
|
container.Adopt(basicElements.NewSpacer(true), false)
|
|
|
|
container.Adopt(icons(theme.IconHome, theme.IconRepositories), true)
|
|
|
|
container.Adopt(icons(theme.IconFile, theme.IconCD), true)
|
|
|
|
container.Adopt(icons(theme.IconOpen, theme.IconRemoveBookmark), true)
|
2023-03-04 22:31:41 -07:00
|
|
|
|
|
|
|
closeButton := basicElements.NewButton("Ok")
|
|
|
|
closeButton.SetIcon(theme.IconYes)
|
|
|
|
closeButton.ShowText(false)
|
|
|
|
closeButton.OnClick(tomo.Stop)
|
|
|
|
container.Adopt(closeButton, false)
|
2023-03-04 20:56:44 -07:00
|
|
|
|
|
|
|
window.OnClose(tomo.Stop)
|
|
|
|
window.Show()
|
|
|
|
}
|
|
|
|
|
2023-03-16 12:22:56 -06:00
|
|
|
func icons (min, max theme.Icon) (container *containers.Container) {
|
|
|
|
container = containers.NewContainer(basicLayouts.Horizontal { true, false })
|
2023-03-04 20:56:44 -07:00
|
|
|
for index := min; index <= max; index ++ {
|
|
|
|
container.Adopt(basicElements.NewIcon(index, theme.IconSizeSmall), true)
|
|
|
|
}
|
|
|
|
return
|
|
|
|
}
|