Class: Potty::Layout
- Inherits:
-
Object
- Object
- Potty::Layout
- Defined in:
- lib/potty/layout.rb
Overview
Layout engine for positioning and sizing widgets
Defined Under Namespace
Classes: Rect
Class Method Summary collapse
-
.stack(container_rect, widgets, spacing: 0) ⇒ Object
Vertical stack layout.
Class Method Details
.stack(container_rect, widgets, spacing: 0) ⇒ Object
Vertical stack layout
14 15 16 17 18 19 20 21 22 |
# File 'lib/potty/layout.rb', line 14 def self.stack(container_rect, , spacing: 0) y = container_rect.y .map do || height = .preferred_height(container_rect.width) rect = Rect.new(container_rect.x, y, container_rect.width, height) y += height + spacing rect end end |