diff --git a/elements/basic/container.go b/elements/containers/container.go similarity index 98% rename from elements/basic/container.go rename to elements/containers/container.go index 8875fa9..2df7bea 100644 --- a/elements/basic/container.go +++ b/elements/containers/container.go @@ -1,4 +1,4 @@ -package basicElements +package containers import "image" import "git.tebibyte.media/sashakoshka/tomo/input" @@ -31,7 +31,7 @@ type Container struct { // NewContainer creates a new container. func NewContainer (layout layouts.Layout) (element *Container) { element = &Container { } - element.theme.Case = theme.C("basic", "container") + element.theme.Case = theme.C("containers", "container") element.Core, element.core = core.NewCore(element, element.redoAll) element.Propagator = core.NewPropagator(element, element.core) element.SetLayout(layout) diff --git a/elements/basic/documentContainer.go b/elements/containers/document.go similarity index 99% rename from elements/basic/documentContainer.go rename to elements/containers/document.go index d82eaf5..b515c1c 100644 --- a/elements/basic/documentContainer.go +++ b/elements/containers/document.go @@ -1,4 +1,4 @@ -package basicElements +package containers import "image" import "git.tebibyte.media/sashakoshka/tomo/theme" @@ -28,7 +28,7 @@ type DocumentContainer struct { // NewDocumentContainer creates a new document container. func NewDocumentContainer () (element *DocumentContainer) { element = &DocumentContainer { } - element.theme.Case = theme.C("basic", "documentContainer") + element.theme.Case = theme.C("containers", "documentContainer") element.Core, element.core = core.NewCore(element, element.redoAll) element.Propagator = core.NewPropagator(element, element.core) return diff --git a/elements/basic/scrollcontainer.go b/elements/containers/scroll.go similarity index 96% rename from elements/basic/scrollcontainer.go rename to elements/containers/scroll.go index df02fde..5f29b26 100644 --- a/elements/basic/scrollcontainer.go +++ b/elements/containers/scroll.go @@ -1,4 +1,4 @@ -package basicElements +package containers import "image" import "git.tebibyte.media/sashakoshka/tomo/input" @@ -7,6 +7,7 @@ import "git.tebibyte.media/sashakoshka/tomo/config" import "git.tebibyte.media/sashakoshka/tomo/canvas" import "git.tebibyte.media/sashakoshka/tomo/elements" import "git.tebibyte.media/sashakoshka/tomo/elements/core" +import "git.tebibyte.media/sashakoshka/tomo/elements/basic" // ScrollContainer is a container that is capable of holding a scrollable // element. @@ -16,8 +17,8 @@ type ScrollContainer struct { core core.CoreControl child elements.Scrollable - horizontal *ScrollBar - vertical *ScrollBar + horizontal *basicElements.ScrollBar + vertical *basicElements.ScrollBar config config.Wrapped theme theme.Wrapped @@ -30,12 +31,12 @@ type ScrollContainer struct { // bars. func NewScrollContainer (horizontal, vertical bool) (element *ScrollContainer) { element = &ScrollContainer { } - element.theme.Case = theme.C("basic", "scrollContainer") + element.theme.Case = theme.C("containers", "scrollContainer") element.Core, element.core = core.NewCore(element, element.redoAll) element.Propagator = core.NewPropagator(element, element.core) if horizontal { - element.horizontal = NewScrollBar(false) + element.horizontal = basicElements.NewScrollBar(false) element.setUpChild(element.horizontal) element.horizontal.OnScroll (func (viewport image.Point) { if element.child != nil { @@ -49,7 +50,7 @@ func NewScrollContainer (horizontal, vertical bool) (element *ScrollContainer) { }) } if vertical { - element.vertical = NewScrollBar(true) + element.vertical = basicElements.NewScrollBar(true) element.setUpChild(element.vertical) element.vertical.OnScroll (func (viewport image.Point) { if element.child != nil { diff --git a/examples/checkbox/main.go b/examples/checkbox/main.go index b3736be..cf46691 100644 --- a/examples/checkbox/main.go +++ b/examples/checkbox/main.go @@ -4,6 +4,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/popups" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" func main () { @@ -14,7 +15,7 @@ func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("Checkboxes") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) container.Adopt (basicElements.NewLabel ( diff --git a/examples/dialogLayout/main.go b/examples/dialogLayout/main.go index 6140f76..5a9eaf2 100644 --- a/examples/dialogLayout/main.go +++ b/examples/dialogLayout/main.go @@ -4,6 +4,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -13,7 +14,7 @@ func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("dialog") - container := basicElements.NewContainer(basicLayouts.Dialog { true, true }) + container := containers.NewContainer(basicLayouts.Dialog { true, true }) window.Adopt(container) container.Adopt(basicElements.NewLabel("you will explode", true), true) diff --git a/examples/documentContainer/main.go b/examples/documentContainer/main.go index 18a29e8..ceab113 100644 --- a/examples/documentContainer/main.go +++ b/examples/documentContainer/main.go @@ -7,6 +7,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -22,8 +23,8 @@ func run () { file.Close() if err != nil { panic(err.Error()); return } - scrollContainer := basicElements.NewScrollContainer(false, true) - document := basicElements.NewDocumentContainer() + scrollContainer := containers.NewScrollContainer(false, true) + document := containers.NewDocumentContainer() document.Adopt (basicElements.NewLabel ( "A document container is a vertically stacked container " + @@ -48,7 +49,7 @@ func run () { document.Adopt (basicElements.NewLabel ( "Oh, you're a switch? Then name all of these switches:", true)) for i := 0; i < 3; i ++ { - switchContainer := basicElements.NewContainer (basicLayouts.Horizontal { + switchContainer := containers.NewContainer (basicLayouts.Horizontal { Gap: true, }) for i := 0; i < 10; i ++ { diff --git a/examples/flow/main.go b/examples/flow/main.go index 0691ce0..82bf8ed 100644 --- a/examples/flow/main.go +++ b/examples/flow/main.go @@ -5,6 +5,7 @@ import "git.tebibyte.media/sashakoshka/tomo/flow" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -13,7 +14,7 @@ func main () { func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("adventure") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) var world flow.Flow diff --git a/examples/goroutines/main.go b/examples/goroutines/main.go index 0384c7e..5210635 100644 --- a/examples/goroutines/main.go +++ b/examples/goroutines/main.go @@ -3,10 +3,11 @@ package main import "os" import "time" import "git.tebibyte.media/sashakoshka/tomo" -import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/fun" +import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -16,7 +17,7 @@ func main () { func run () { window, _ := tomo.NewWindow(200, 216) window.SetTitle("Clock") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) clock := fun.NewAnalogClock(time.Now()) diff --git a/examples/horizontalLayout/main.go b/examples/horizontalLayout/main.go index 61b28fa..b9d097a 100644 --- a/examples/horizontalLayout/main.go +++ b/examples/horizontalLayout/main.go @@ -4,6 +4,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -13,7 +14,7 @@ func run () { window, _ := tomo.NewWindow(360, 2) window.SetTitle("horizontal stack") - container := basicElements.NewContainer(basicLayouts.Horizontal { true, true }) + container := containers.NewContainer(basicLayouts.Horizontal { true, true }) window.Adopt(container) container.Adopt(basicElements.NewLabel("this is sample text", true), true) diff --git a/examples/icons/main.go b/examples/icons/main.go index e9c6c78..7d4fb77 100644 --- a/examples/icons/main.go +++ b/examples/icons/main.go @@ -5,6 +5,7 @@ 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/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -14,7 +15,7 @@ func run () { window, _ := tomo.NewWindow(360, 2) window.SetTitle("Icons") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) container.Adopt(basicElements.NewLabel("Just some of the wonderful icons we have:", false), false) @@ -33,8 +34,8 @@ func run () { window.Show() } -func icons (min, max theme.Icon) (container *basicElements.Container) { - container = basicElements.NewContainer(basicLayouts.Horizontal { true, false }) +func icons (min, max theme.Icon) (container *containers.Container) { + container = containers.NewContainer(basicLayouts.Horizontal { true, false }) for index := min; index <= max; index ++ { container.Adopt(basicElements.NewIcon(index, theme.IconSizeSmall), true) } diff --git a/examples/image/image.go b/examples/image/image.go index 29dda72..6d5a071 100644 --- a/examples/image/image.go +++ b/examples/image/image.go @@ -10,6 +10,7 @@ import "git.tebibyte.media/sashakoshka/tomo/popups" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -25,7 +26,7 @@ func run () { file.Close() if err != nil { fatalError(err); return } - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) logoImage := basicElements.NewImage(logo) button := basicElements.NewButton("Show me a gopher instead") button.OnClick (func () { container.Warp (func () { diff --git a/examples/input/main.go b/examples/input/main.go index 02bfdc3..010530d 100644 --- a/examples/input/main.go +++ b/examples/input/main.go @@ -5,6 +5,7 @@ import "git.tebibyte.media/sashakoshka/tomo/popups" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -13,7 +14,7 @@ func main () { func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("Enter Details") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) // create inputs diff --git a/examples/list/main.go b/examples/list/main.go index 2a5cdff..2af7455 100644 --- a/examples/list/main.go +++ b/examples/list/main.go @@ -6,6 +6,7 @@ import "git.tebibyte.media/sashakoshka/tomo/elements" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/testing" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" func main () { @@ -16,7 +17,7 @@ func run () { window, _ := tomo.NewWindow(300, 2) window.SetTitle("List Sidebar") - container := basicElements.NewContainer(basicLayouts.Horizontal { true, true }) + container := containers.NewContainer(basicLayouts.Horizontal { true, true }) window.Adopt(container) var currentPage elements.Element @@ -39,7 +40,7 @@ func run () { }) mouse := testing.NewMouse() input := basicElements.NewTextBox("Write some text", "") - form := basicElements.NewContainer(basicLayouts.Vertical { true, false}) + form := containers.NewContainer(basicLayouts.Vertical { true, false}) form.Adopt(basicElements.NewLabel("I have:", false), false) form.Adopt(basicElements.NewSpacer(true), false) form.Adopt(basicElements.NewCheckbox("Skin", true), false) diff --git a/examples/piano/main.go b/examples/piano/main.go index 2762f03..de63788 100644 --- a/examples/piano/main.go +++ b/examples/piano/main.go @@ -10,6 +10,7 @@ import "git.tebibyte.media/sashakoshka/tomo/elements/fun" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/fun/music" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" const sampleRate = 44100 @@ -33,10 +34,10 @@ func main () { func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("Piano") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) - controlBar := basicElements.NewContainer(basicLayouts.Horizontal { true, false }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) + controlBar := containers.NewContainer(basicLayouts.Horizontal { true, false }) - waveformColumn := basicElements.NewContainer(basicLayouts.Vertical { true, false }) + waveformColumn := containers.NewContainer(basicLayouts.Vertical { true, false }) waveformList := basicElements.NewList ( basicElements.NewListEntry("Sine", func(){ waveform = 0 }), basicElements.NewListEntry("Triangle", func(){ waveform = 3 }), @@ -47,8 +48,8 @@ func run () { waveformList.OnNoEntrySelected (func(){waveformList.Select(0)}) waveformList.Select(0) - adsrColumn := basicElements.NewContainer(basicLayouts.Vertical { true, false }) - adsrGroup := basicElements.NewContainer(basicLayouts.Horizontal { true, false }) + adsrColumn := containers.NewContainer(basicLayouts.Vertical { true, false }) + adsrGroup := containers.NewContainer(basicLayouts.Horizontal { true, false }) attackSlider := basicElements.NewLerpSlider(0, 3 * time.Second, adsr.Attack, true) decaySlider := basicElements.NewLerpSlider(0, 3 * time.Second, adsr.Decay, true) sustainSlider := basicElements.NewSlider(adsr.Sustain, true) @@ -71,7 +72,7 @@ func run () { gain = math.Pow(gainSlider.Value(), 2) }) - patchColumn := basicElements.NewContainer(basicLayouts.Vertical { true, false }) + patchColumn := containers.NewContainer(basicLayouts.Vertical { true, false }) patch := func (w int, a, d time.Duration, s float64, r time.Duration) func () { return func () { waveform = w @@ -107,7 +108,7 @@ func run () { 2, 3000, 60, 0, 0)), ) patchList.Collapse(0, 32) - patchScrollBox := basicElements.NewScrollContainer(false, true) + patchScrollBox := containers.NewScrollContainer(false, true) piano := fun.NewPiano(2, 5) piano.OnPress(playNote) diff --git a/examples/popups/main.go b/examples/popups/main.go index dfc69bf..8c002b1 100644 --- a/examples/popups/main.go +++ b/examples/popups/main.go @@ -5,6 +5,7 @@ import "git.tebibyte.media/sashakoshka/tomo/popups" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -14,7 +15,7 @@ func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("Dialog Boxes") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) container.Adopt(basicElements.NewLabel("Try out different dialogs:", false), true) diff --git a/examples/progress/main.go b/examples/progress/main.go index 522bdc2..efabea2 100644 --- a/examples/progress/main.go +++ b/examples/progress/main.go @@ -5,6 +5,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/popups" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" func main () { @@ -14,7 +15,7 @@ func main () { func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("Approaching") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) container.Adopt (basicElements.NewLabel ( diff --git a/examples/raycaster/main.go b/examples/raycaster/main.go index 801bbcd..b627680 100644 --- a/examples/raycaster/main.go +++ b/examples/raycaster/main.go @@ -8,6 +8,7 @@ import "git.tebibyte.media/sashakoshka/tomo/popups" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" //go:embed wall.png var wallTextureBytes []uint8 @@ -20,7 +21,7 @@ func run () { window, _ := tomo.NewWindow(640, 480) window.SetTitle("Raycaster") - container := basicElements.NewContainer(basicLayouts.Vertical { false, false }) + container := containers.NewContainer(basicLayouts.Vertical { false, false }) window.Adopt(container) wallTexture, _ := TextureFrom(bytes.NewReader(wallTextureBytes)) @@ -47,7 +48,7 @@ func run () { wallTexture, }) - topBar := basicElements.NewContainer(basicLayouts.Horizontal { true, true }) + topBar := containers.NewContainer(basicLayouts.Horizontal { true, true }) staminaBar := basicElements.NewProgressBar(game.Stamina()) healthBar := basicElements.NewProgressBar(game.Health()) diff --git a/examples/scroll/main.go b/examples/scroll/main.go index 0e45b55..47c942a 100644 --- a/examples/scroll/main.go +++ b/examples/scroll/main.go @@ -5,6 +5,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -13,13 +14,13 @@ func main () { func run () { window, _ := tomo.NewWindow(480, 360) window.SetTitle("Scroll") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) textBox := basicElements.NewTextBox("", copypasta) - scrollContainer := basicElements.NewScrollContainer(true, false) + scrollContainer := containers.NewScrollContainer(true, false) - disconnectedContainer := basicElements.NewContainer (basicLayouts.Horizontal { + disconnectedContainer := containers.NewContainer (basicLayouts.Horizontal { Gap: true, }) list := basicElements.NewList ( diff --git a/examples/spacer/main.go b/examples/spacer/main.go index 3d79122..15efe14 100644 --- a/examples/spacer/main.go +++ b/examples/spacer/main.go @@ -4,6 +4,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -13,7 +14,7 @@ func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("Spaced Out") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) container.Adopt (basicElements.NewLabel("This is at the top", false), false) diff --git a/examples/switch/main.go b/examples/switch/main.go index a13066f..a630f36 100644 --- a/examples/switch/main.go +++ b/examples/switch/main.go @@ -4,6 +4,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" func main () { tomo.Run(run) @@ -13,7 +14,7 @@ func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("Switches") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) container.Adopt(basicElements.NewSwitch("hahahah", false), false) diff --git a/examples/verticalLayout/main.go b/examples/verticalLayout/main.go index f64ea76..5e000b9 100644 --- a/examples/verticalLayout/main.go +++ b/examples/verticalLayout/main.go @@ -4,6 +4,7 @@ import "git.tebibyte.media/sashakoshka/tomo" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/testing" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" import _ "git.tebibyte.media/sashakoshka/tomo/backends/all" func main () { @@ -14,7 +15,7 @@ func run () { window, _ := tomo.NewWindow(2, 2) window.SetTitle("vertical stack") - container := basicElements.NewContainer(basicLayouts.Vertical { true, true }) + container := containers.NewContainer(basicLayouts.Vertical { true, true }) window.Adopt(container) label := basicElements.NewLabel("it is a label hehe", true) diff --git a/popups/dialog.go b/popups/dialog.go index 4b8af60..1df7ad0 100644 --- a/popups/dialog.go +++ b/popups/dialog.go @@ -5,6 +5,7 @@ import "git.tebibyte.media/sashakoshka/tomo/theme" import "git.tebibyte.media/sashakoshka/tomo/elements" import "git.tebibyte.media/sashakoshka/tomo/layouts/basic" import "git.tebibyte.media/sashakoshka/tomo/elements/basic" +import "git.tebibyte.media/sashakoshka/tomo/elements/containers" // DialogKind defines the semantic role of a dialog window. type DialogKind int @@ -37,10 +38,10 @@ func NewDialog ( window, _ = tomo.NewWindow(2, 2) window.SetTitle(title) - container := basicElements.NewContainer(basicLayouts.Dialog { true, true }) + container := containers.NewContainer(basicLayouts.Dialog { true, true }) window.Adopt(container) - messageContainer := basicElements.NewContainer(basicLayouts.Horizontal { true, false }) + messageContainer := containers.NewContainer(basicLayouts.Horizontal { true, false }) iconId := theme.IconInformation switch kind { case DialogKindInfo: iconId = theme.IconInformation