This document is a collection of ideas and may not always be accurate/up to date.
Current state of things is very messy, because I tried to just make it compatible to packs.
- Each window has its own drawing context (
Renderer
) - Widgets may be bound to the drawing context they first drew to
- Widgets are implemented by overriding common methods
- Widgets should not have to know what their parents are
- we have one problem with tooltips and a dirty work-around
addChild
transfers ownership to containerremoveChild
transfers ownership to callersetSize()
should auto-size all children. Value given may be modified if too small.- a layout step should generate all
MinSize
s, update actual size and emitSignal
s when modifing any portion of the tree - this is incomplete
createWindow
: creates a window and adds it to the list of event receiversrender
: receives/handles/propagates events and callsrender
on all windows
Window
inheritsContainer
HBox
inheritsContainer
: Horizontally oriented childrenVBox
inheritsContainer
: Vertically oriented childrenTable
orGrid
inheritsContainer
: X x Y (equally sized) childrenSimpleContainer
inheritsContainer
: 1 full-size child (or managed by parent)Tooltip
inheritsSimpleContanier
: styled background and borderGroup
inheritsVBox
: 1 child + titleDock
inserhitsContainer
: children can be docked left, right, top bottom or be floating in the remaining spaceContainer
inheritsWidget
Label
inheritsWidget
LineEdit
inheritsWidget
orTextEdit
?TextEdit
inheritsWidget
StagedImageButton
? inheritsWidget
: scrolls through states with left/right mous, e.g. value or enable/disableDoubleStagedImageButton
? inheritsWidget
: scrolls through one state with left, other with right mouse, e.g. value + enable/disableCountImageButton
?
This needs a lot of work still.
- Original: not really clear, we try to implement widgets in a compatible manner
- Future: auto-size in both directions, see Concepts and TODO.md
- Hints/Values:
size
: always, actual size that was decided on- manual
minSize
: future - autom.
minSize
: always (required for docks/hboxes) - manual
maxSize
: always (selectively implemented with hacks at the moment) - autom.
maxSize
: future (required to transfer manual maxSize to parents) autoSize
: always, what size (or aspect ratio) the actual content haspreferredSize
: future (lets child tell the size it wants)hGrow
: future; original has"h_alignment": "stretch"
thoughvGrow
: future; original has"v_alignment": "stretch"
thoughhGravity
: future; original has"h_alignment"
thoughvGravity
: future; original has"v_alignment"
though
- tooltip: any widget/container
- background: image or color (or none/transparent)
- keepAspect: in relation to autoSize; TODO: in relation to preferredSize?
Using class Signal
, we can "subscribe" lambdas to:
onMouseEnter (sender, position, Button, Modifiers)
onMouseLeave (sender, position, Button, Modifiers)
onClick (sender, position, Button, Modifiers)
onBeforeChange (sender)
onAfterChange (sender)
Fixed member functions, only propagating from window to widgets:
ParentResized
(for future layout system)
Currently we have a generic UI::Item, which requires conversion of eveything to stages (individual images).