Re-organized module structure
This commit is contained in:
@@ -2,8 +2,8 @@ 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"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/layouts"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/elements"
|
||||
import _ "git.tebibyte.media/sashakoshka/tomo/backends/all"
|
||||
import "git.tebibyte.media/sashakoshka/tomo/elements/containers"
|
||||
|
||||
@@ -15,16 +15,16 @@ func run () {
|
||||
window, _ := tomo.NewWindow(360, 2)
|
||||
window.SetTitle("Icons")
|
||||
|
||||
container := containers.NewContainer(basicLayouts.Vertical { true, true })
|
||||
container := containers.NewContainer(layouts.Vertical { true, true })
|
||||
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(elements.NewLabel("Just some of the wonderful icons we have:", false), false)
|
||||
container.Adopt(elements.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)
|
||||
|
||||
closeButton := basicElements.NewButton("Ok")
|
||||
closeButton := elements.NewButton("Ok")
|
||||
closeButton.SetIcon(theme.IconYes)
|
||||
closeButton.ShowText(false)
|
||||
closeButton.OnClick(tomo.Stop)
|
||||
@@ -35,9 +35,9 @@ func run () {
|
||||
}
|
||||
|
||||
func icons (min, max theme.Icon) (container *containers.Container) {
|
||||
container = containers.NewContainer(basicLayouts.Horizontal { true, false })
|
||||
container = containers.NewContainer(layouts.Horizontal { true, false })
|
||||
for index := min; index <= max; index ++ {
|
||||
container.Adopt(basicElements.NewIcon(index, theme.IconSizeSmall), true)
|
||||
container.Adopt(elements.NewIcon(index, theme.IconSizeSmall), true)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user