Class: Glimmer::SWT::FillLayoutProxy
- Inherits:
-
LayoutProxy
- Object
- LayoutProxy
- Glimmer::SWT::FillLayoutProxy
- Includes:
- Glimmer
- Defined in:
- lib/glimmer/swt/fill_layout_proxy.rb
Constant Summary collapse
- STYLE =
<<~CSS .fill-layout { display: flex; } .fill-layout > * { width: 100% !important; height: 100% !important; } .fill-layout-horizontal { flex-direction: row; } .fill-layout-vertical { flex-direction: column; } CSS
Instance Attribute Summary collapse
-
#margin_height ⇒ Object
Returns the value of attribute margin_height.
-
#margin_width ⇒ Object
Returns the value of attribute margin_width.
-
#spacing ⇒ Object
Returns the value of attribute spacing.
-
#type ⇒ Object
Returns the value of attribute type.
Attributes inherited from LayoutProxy
Instance Method Summary collapse
- #horizontal? ⇒ Boolean
-
#initialize(parent, args) ⇒ FillLayoutProxy
constructor
A new instance of FillLayoutProxy.
- #vertical? ⇒ Boolean
Methods inherited from LayoutProxy
#css_class, #dom, for, layout_class, layout_exists?, #layout​
Methods included from PropertyOwner
#attribute_getter, #attribute_setter, #get_attribute, #set_attribute
Constructor Details
#initialize(parent, args) ⇒ FillLayoutProxy
Returns a new instance of FillLayoutProxy.
29 30 31 32 33 34 35 36 |
# File 'lib/glimmer/swt/fill_layout_proxy.rb', line 29 def initialize(parent, args) super(parent, args) self.type = @args.first || :horizontal self.margin_width = 15 self.margin_height = 15 @parent.css_classes << 'fill-layout' @parent.dom_element.add_class('fill-layout') end |
Instance Attribute Details
#margin_height ⇒ Object
Returns the value of attribute margin_height.
27 28 29 |
# File 'lib/glimmer/swt/fill_layout_proxy.rb', line 27 def margin_height @margin_height end |
#margin_width ⇒ Object
Returns the value of attribute margin_width.
27 28 29 |
# File 'lib/glimmer/swt/fill_layout_proxy.rb', line 27 def margin_width @margin_width end |
#spacing ⇒ Object
Returns the value of attribute spacing.
27 28 29 |
# File 'lib/glimmer/swt/fill_layout_proxy.rb', line 27 def spacing @spacing end |
#type ⇒ Object
Returns the value of attribute type.
27 28 29 |
# File 'lib/glimmer/swt/fill_layout_proxy.rb', line 27 def type @type end |
Instance Method Details
#horizontal? ⇒ Boolean
38 39 40 |
# File 'lib/glimmer/swt/fill_layout_proxy.rb', line 38 def horizontal? @type == :horizontal end |
#vertical? ⇒ Boolean
42 43 44 |
# File 'lib/glimmer/swt/fill_layout_proxy.rb', line 42 def vertical? @type == :vertical end |