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-center.row-layout-horizontal > * { margin-top: auto; margin-bottom: auto; } .row-layout-center.row-layout-vertical > * { margin-left: auto; margin-right: auto; } .row-layout-wrap { flex-wrap: wrap; } .row-layout-justify { justify-content: space-around; } .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
-
#center ⇒ Object
Returns the value of attribute center.
-
#justify ⇒ Object
Returns the value of attribute justify.
-
#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.
-
#wrap ⇒ Object
Returns the value of attribute wrap.
Attributes inherited from LayoutProxy
Instance Method Summary collapse
- #dom(widget_dom) ⇒ Object
- #fill ⇒ Object
- #fill=(value) ⇒ 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.
55 56 57 58 59 60 61 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 55 def initialize(parent, args) super(parent, args) @parent.dom_element.add_class('row-layout') self.type = args.first || :horizontal self.pack = true self.wrap = true end |
Instance Attribute Details
#center ⇒ Object
Returns the value of attribute center.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def center @center end |
#justify ⇒ Object
Returns the value of attribute justify.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def justify @justify end |
#margin_bottom ⇒ Object
Returns the value of attribute margin_bottom.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def margin_bottom @margin_bottom end |
#margin_height ⇒ Object
Returns the value of attribute margin_height.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def margin_height @margin_height end |
#margin_left ⇒ Object
Returns the value of attribute margin_left.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def margin_left @margin_left end |
#margin_right ⇒ Object
Returns the value of attribute margin_right.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def margin_right @margin_right end |
#margin_top ⇒ Object
Returns the value of attribute margin_top.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def margin_top @margin_top end |
#margin_width ⇒ Object
Returns the value of attribute margin_width.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def margin_width @margin_width end |
#pack ⇒ Object
Returns the value of attribute pack.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def pack @pack end |
#spacing ⇒ Object
Returns the value of attribute spacing.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def spacing @spacing end |
#type ⇒ Object
Returns the value of attribute type.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def type @type end |
#wrap ⇒ Object
Returns the value of attribute wrap.
53 54 55 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 53 def wrap @wrap end |
Instance Method Details
#dom(widget_dom) ⇒ Object
76 77 78 79 80 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 76 def dom() dom_result = dom_result += '<br />' if vertical? && @pack dom_result end |
#fill ⇒ Object
91 92 93 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 91 def fill !pack end |
#fill=(value) ⇒ Object
95 96 97 98 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 95 def fill=(value) # TODO verify this is a correct implementation and interpretation of RowLayout in SWT self.pack = !value end |
#horizontal? ⇒ Boolean
68 69 70 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 68 def horizontal? @type == :horizontal end |
#vertical? ⇒ Boolean
72 73 74 |
# File 'lib/glimmer/swt/row_layout_proxy.rb', line 72 def vertical? @type == :vertical end |