class UnderOs::UI::Collection::Styles

This thing catches styles from the collection element and adjusts the layout settings for them

Public Class Methods

build(collection, stylesheet) click to toggle source
# File lib/under_os/ui/collection/styles.rb, line 6
def self.build(collection, stylesheet)
  item = UnderOs::UI::Collection::Item.for(collection, stylesheet)

  collection.layout.item_size     = item.size
  collection.layout.items_spacing = item.style.marginLeft + item.style.marginRight
  collection.layout.rows_spacing  = item.style.marginTop  + item.style.marginBottom

  # TODO header/footer
end