Class: Glimmer::SWT::RowLayoutProxy
- Inherits:
-
LayoutProxy
- Object
- LayoutProxy
- Glimmer::SWT::RowLayoutProxy
- Includes:
- Glimmer
- Defined in:
- lib/glimmer/swt/row_layout_proxy.rb
Constant Summary collapse
- STYLE =
<<~CSS .row-layout { display: flex; align-items: flex-start; } .row-layout-pack-false { align-items: stretch; } .row-layout-horizontal { flex-direction: row; } .row-layout-horizontal.row-layout-pack-false { flex-direction: unset; } .row-layout-vertical { flex-direction: column; } .row-layout-vertical.row-layout-pack { flex-direction: none; } CSS
Instance Attribute Summary collapse
-
#margin_bottom ⇒ Object
Returns the value of attribute margin_bottom.
-
#margin_height ⇒ Object
Returns the value of attribute margin_height.
-
#margin_left ⇒ Object
Returns the value of attribute margin_left.
-
#margin_right ⇒ Object
Returns the value of attribute margin_right.
-
#margin_top ⇒ Object
Returns the value of attribute margin_top.
-
#margin_width ⇒ Object
Returns the value of attribute margin_width.
-
#pack ⇒ Object
Returns the value of attribute pack.
-
#spacing ⇒ Object
Returns the value of attribute spacing.
-
#type ⇒ Object
readonly
Returns the value of attribute type.
Attributes inherited from LayoutProxy
Instance Method Summary collapse
- #dom(widget_dom) ⇒ Object
- #horizontal? ⇒ Boolean
-
#initialize(parent, args) ⇒ RowLayoutProxy
constructor
A new instance of RowLayoutProxy.
- #vertical? ⇒ Boolean
Methods inherited from LayoutProxy
#css_class, for, layout_class, layout_exists?, #reapply
Methods included from PropertyOwner
#attribute_getter, #attribute_setter, #get_attribute, #set_attribute
Constructor Details
#initialize(parent, args) ⇒ RowLayoutProxy
Returns a new instance of RowLayoutProxy.
37 38 39 40 41 42 43 44 45 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 37 def initialize(parent, args) super(parent, args) @type = @args.first || :horizontal @marign_width = 15 @margin_height = 15 self.pack = true @parent.dom_element.add_class('row-layout') @parent.dom_element.add_class(horizontal? ? 'row-layout-horizontal' : 'row-layout-vertical') end |
Instance Attribute Details
#margin_bottom ⇒ Object
Returns the value of attribute margin_bottom.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def margin_bottom @margin_bottom end |
#margin_height ⇒ Object
Returns the value of attribute margin_height.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def margin_height @margin_height end |
#margin_left ⇒ Object
Returns the value of attribute margin_left.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def margin_left @margin_left end |
#margin_right ⇒ Object
Returns the value of attribute margin_right.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def margin_right @margin_right end |
#margin_top ⇒ Object
Returns the value of attribute margin_top.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def margin_top @margin_top end |
#margin_width ⇒ Object
Returns the value of attribute margin_width.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def margin_width @margin_width end |
#pack ⇒ Object
Returns the value of attribute pack.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def pack @pack end |
#spacing ⇒ Object
Returns the value of attribute spacing.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def spacing @spacing end |
#type ⇒ Object (readonly)
Returns the value of attribute type.
35 36 37 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 35 def type @type end |
Instance Method Details
#dom(widget_dom) ⇒ Object
55 56 57 58 59 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 55 def dom() dom_result = dom_result += '<br />' if vertical? && @pack dom_result end |
#horizontal? ⇒ Boolean
47 48 49 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 47 def horizontal? @type == :horizontal end |
#vertical? ⇒ Boolean
51 52 53 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 51 def vertical? @type == :vertical end |