Add examples
This commit is contained in:
@@ -8,6 +8,8 @@ import "git.tebibyte.media/tomo/objects"
|
||||
import "git.tebibyte.media/tomo/tomo/theme"
|
||||
import "git.tebibyte.media/tomo/objects/layouts"
|
||||
|
||||
const scrollIcons = false
|
||||
|
||||
type Application struct {
|
||||
size theme.IconSize
|
||||
grid tomo.ContainerBox
|
||||
@@ -50,9 +52,16 @@ func (this *Application) Init () error {
|
||||
|
||||
container := objects.NewOuterContainer (
|
||||
layouts.NewGrid([]bool { true }, []bool { false, true, false }),
|
||||
objects.NewLabel("A smorgasbord of icons:"),
|
||||
this.grid,
|
||||
iconButtons)
|
||||
objects.NewLabel("A smorgasbord of icons:"))
|
||||
if scrollIcons {
|
||||
iconScroller := objects.NewScrollContainer(objects.ScrollVertical)
|
||||
this.grid.SetOverflow(false, true)
|
||||
iconScroller.SetRoot(this.grid)
|
||||
container.Add(iconScroller)
|
||||
} else {
|
||||
container.Add(this.grid)
|
||||
}
|
||||
container.Add(iconButtons)
|
||||
window.SetRoot(container)
|
||||
|
||||
window.OnClose(tomo.Stop)
|
||||
|
||||
Reference in New Issue
Block a user