class

Opal::UI::DockContainer

Inherits Opal::UI::Control < Opal::UI::InputHookable < Opal::UI::Element < Opal::UI::Themable < Reference < Object

Modern declarative Dock layout container inspired by Python Textual's Docking system. Arranges child elements docked to Top, Bottom, Left, Right, and Center, computing bounds and remaining canvas automatically.

Constructors

new(items : Array(DockItem) = [] of DockItem)
Source

Instance methods

children

Returns child elements for hierarchical tree traversal and DOM querying

Source
compute_layout(x : Int32, y : Int32, width : Int32, height : Int32) : Array(Tuple(DockItem, Int32, Int32, Int32, Int32))

Computes geometry rectangles for each child given total width and height

Source
dock(element : Element, edge : DockEdge | Symbol, size : Int32 | Nil = nil) : self
Source
dock_bottom(element : Element, height : Int32 | Nil = nil) : self
Source
dock_center(element : Element) : self
Source
dock_left(element : Element, width : Int32 | Nil = nil) : self
Source
dock_right(element : Element, width : Int32 | Nil = nil) : self
Source
dock_top(element : Element, height : Int32 | Nil = nil) : self
Source
handle_key(event : Terminal::KeyEvent) : Bool

Default key event handler. Override in subclasses if not using @default_input_proc.

Source
handle_mouse(event : Terminal::MouseEvent) : Bool

Default mouse event handler. Override in subclasses if not using @default_input_proc.

Source
items
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source