Vertical layout stub
This commit is contained in:
parent
c34e3cd91e
commit
31fb42ab58
@ -87,6 +87,12 @@ func (window *Window) Adopt (child tomo.Element) {
|
|||||||
MinimumSizeChange: window.childMinimumSizeChangeCallback,
|
MinimumSizeChange: window.childMinimumSizeChangeCallback,
|
||||||
SelectionRequest: window.childSelectionRequestCallback,
|
SelectionRequest: window.childSelectionRequestCallback,
|
||||||
})
|
})
|
||||||
|
// TODO: it is possible for an element to start out as
|
||||||
|
// selectable, and then become unselectable. it should be
|
||||||
|
// standard behavior for containers (including windows) to, if
|
||||||
|
// no children are selected, select the first child on ctrl-tab
|
||||||
|
// press. we should therefore be able to ask any element if it
|
||||||
|
// is selected.
|
||||||
if child.Selectable() { child.Handle(tomo.EventSelect { }) }
|
if child.Selectable() { child.Handle(tomo.EventSelect { }) }
|
||||||
window.resizeChildToFit()
|
window.resizeChildToFit()
|
||||||
}
|
}
|
||||||
|
13
elements/layouts/vertical.go
Normal file
13
elements/layouts/vertical.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package layouts
|
||||||
|
|
||||||
|
import "git.tebibyte.media/sashakoshka/tomo"
|
||||||
|
import "git.tebibyte.media/sashakoshka/tomo/artist"
|
||||||
|
|
||||||
|
// Vertical lays its children out vertically. It can contain any number of
|
||||||
|
// children. When an child is added to the layout, it can either be set to
|
||||||
|
// contract to its minimum height or expand to fill the remaining space (space
|
||||||
|
// that is not taken up by other children or padding is divided equally among
|
||||||
|
// these). Child elements will all have the same width.
|
||||||
|
type Vertical struct {
|
||||||
|
|
||||||
|
}
|
Reference in New Issue
Block a user