Skip to main content

Module dock

Module dock 

Source
Expand description

Dock model — the tree of splits and tab groups behind the editor workbench.

Pure data and geometry: no backend, no painting, no interaction. The shell asks for a DockLayout and paints it; the widget layer turns pointer events into calls back into DockTree. Keeping the model here means the rules that are easy to get wrong — where a drop lands, what happens to a split when its last tab closes, how ratios clamp — are testable without a window.

Chrome (title bar, spine, status bar) deliberately lives outside the dock: those are the frame the workbench sits in, not panels the user rearranges.

Structs§

DockLayout
Everything the shell needs to paint one frame of the dock.
DockTree
A tree of splits and tab groups covering one workbench area.
SplitId
Stable handle for a split, so a resize drag can name the divider it grabbed without depending on the tree’s shape surviving the gesture.
SplitterLayout
One draggable divider placed on screen.
TabGroupLayout
One tab group placed on screen.

Enums§

DockNode
A node of the dock tree.
DropZone
Where a dragged panel would land relative to the group under the pointer.
SplitAxis
Which way a split divides its area.

Constants§

MIN_PANE
Smallest area a tab group may be squeezed to. Ratios clamp so a drag can never collapse a panel to nothing — a panel you cannot see is a panel you cannot get back without knowing the layout can be reset.
SPLITTER_THICKNESS
Thickness of a splitter’s grab band, in points. Wide enough to hit without aiming, narrow enough not to steal clicks from the panels either side.

Functions§

ratio_from_pointer
Turns a pointer position on a splitter into the ratio it implies.
zone_at
Classifies a pointer position inside rect into a drop zone.

Type Aliases§

DockRect
A rectangle as [x, y, width, height], matching the convention used by UiBuilder throughout the UI layer.