Class: Plushie::Widget::Container
- Inherits:
-
Object
- Object
- Plushie::Widget::Container
- Defined in:
- lib/plushie/widget/container.rb
Overview
Single-child container widget with alignment and styling.
Instance Method Summary collapse
-
#center_x(width = :fill) ⇒ Object
Return a copy with horizontal centering enabled.
-
#center_y(height = :fill) ⇒ Object
Return a copy with vertical centering enabled.
Instance Method Details
#center_x(width = :fill) ⇒ Object
Return a copy with horizontal centering enabled.
19 20 21 22 23 24 |
# File 'lib/plushie/widget/container.rb', line 19 def center_x(width = :fill) dup.tap do |c| c.instance_variable_set(:@width, width) c.instance_variable_set(:@align_x, :center) end end |
#center_y(height = :fill) ⇒ Object
Return a copy with vertical centering enabled.
27 28 29 30 31 32 |
# File 'lib/plushie/widget/container.rb', line 27 def center_y(height = :fill) dup.tap do |c| c.instance_variable_set(:@height, height) c.instance_variable_set(:@align_y, :center) end end |