Class: Glimmer::SWT::GridLayoutProxy

Inherits:
LayoutProxy show all
Defined in:
lib/glimmer/swt/grid_layout_proxy.rb

Constant Summary collapse

STYLE =
<<~CSS
  .grid-layout {
    display: grid;
    grid-template-rows: min-content;
    place-content: start;
    align-items: stretch;
  }
CSS

Instance Attribute Summary collapse

Attributes inherited from LayoutProxy

#args, #parent

Instance Method Summary collapse

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) ⇒ GridLayoutProxy

Returns a new instance of GridLayoutProxy.



91
92
93
94
95
96
97
98
99
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 91

def initialize(parent, args)
  super(parent, args)
  self.horizontal_spacing = 10
  self.vertical_spacing = 10
  self.margin_width = 15
  self.margin_height = 15
  self.num_columns = @args[0] || 1
  self.make_columns_equal_width = @args[1] || false
end

Instance Attribute Details

#horizontal_spacingObject

Returns the value of attribute horizontal_spacing.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def horizontal_spacing
  @horizontal_spacing
end

#make_columns_equal_widthObject

Returns the value of attribute make_columns_equal_width.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def make_columns_equal_width
  @make_columns_equal_width
end

#margin_bottomObject

Returns the value of attribute margin_bottom.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def margin_bottom
  @margin_bottom
end

#margin_heightObject

Returns the value of attribute margin_height.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def margin_height
  @margin_height
end

#margin_leftObject

Returns the value of attribute margin_left.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def margin_left
  @margin_left
end

#margin_rightObject

Returns the value of attribute margin_right.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def margin_right
  @margin_right
end

#margin_topObject

Returns the value of attribute margin_top.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def margin_top
  @margin_top
end

#margin_widthObject

Returns the value of attribute margin_width.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def margin_width
  @margin_width
end

#num_columnsObject

Returns the value of attribute num_columns.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def num_columns
  @num_columns
end

#vertical_spacingObject

Returns the value of attribute vertical_spacing.



15
16
17
# File 'lib/glimmer/swt/grid_layout_proxy.rb', line 15

def vertical_spacing
  @vertical_spacing
end