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 =
".row-layout {\n display: flex;\n align-items: flex-start;\n}\n \n.row-layout-pack-false {\n align-items: stretch;\n}\n \n.row-layout-center.row-layout-horizontal > * {\n margin-top: auto;\n margin-bottom: auto;\n}\n \n.row-layout-center.row-layout-vertical > * {\n margin-left: auto;\n margin-right: auto;\n}\n \n.row-layout-horizontal {\n flex-direction: row;\n}\n \n.row-layout-horizontal.row-layout-pack-false {\n flex-direction: unset;\n}\n \n.row-layout-vertical {\n flex-direction: column;\n}\n \n.row-layout-vertical.row-layout-pack {\n flex-direction: none;\n}\n"
Instance Attribute Summary collapse
-
#center ⇒ Object
Returns the value of attribute center.
-
#fill ⇒ Object
Returns the value of attribute fill.
-
#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
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?, #layout
Methods included from PropertyOwner
#attribute_getter, #attribute_setter, #get_attribute, #set_attribute
Constructor Details
#initialize(parent, args) ⇒ RowLayoutProxy
Returns a new instance of RowLayoutProxy.
47 48 49 50 51 52 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 47 def initialize(parent, args) super(parent, args) @parent.dom_element.add_class('row-layout') self.type = args.first || :horizontal self.pack = true end |
Instance Attribute Details
#center ⇒ Object
Returns the value of attribute center.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def center @center end |
#fill ⇒ Object
Returns the value of attribute fill.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def fill @fill end |
#margin_bottom ⇒ Object
Returns the value of attribute margin_bottom.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def margin_bottom @margin_bottom end |
#margin_height ⇒ Object
Returns the value of attribute margin_height.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def margin_height @margin_height end |
#margin_left ⇒ Object
Returns the value of attribute margin_left.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def margin_left @margin_left end |
#margin_right ⇒ Object
Returns the value of attribute margin_right.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def margin_right @margin_right end |
#margin_top ⇒ Object
Returns the value of attribute margin_top.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def margin_top @margin_top end |
#margin_width ⇒ Object
Returns the value of attribute margin_width.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def margin_width @margin_width end |
#pack ⇒ Object
Returns the value of attribute pack.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def pack @pack end |
#spacing ⇒ Object
Returns the value of attribute spacing.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def spacing @spacing end |
#type ⇒ Object
Returns the value of attribute type.
45 46 47 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 45 def type @type end |
Instance Method Details
#dom(widget_dom) ⇒ Object
67 68 69 70 71 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 67 def dom() dom_result = dom_result += '<br />' if vertical? && @pack dom_result end |
#horizontal? ⇒ Boolean
59 60 61 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 59 def horizontal? @type == :horizontal end |
#vertical? ⇒ Boolean
63 64 65 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 63 def vertical? @type == :vertical end |