class UiHelpers::Icon

Constants

ICONS

Attributes

h_offset[RW]
height[RW]
name[RW]
v_offset[RW]
width[RW]

Public Instance Methods

background_style() click to toggle source
# File lib/ui_helpers/elements/icon.rb, line 198
def background_style
  offsets = [h_offset, v_offset]
  ICONS[name.to_s].gsub(/-?\d+(?=px)/) do |s|
    s.to_i + (offsets.delete_at(0)||0)
  end
end
height_style() click to toggle source
# File lib/ui_helpers/elements/icon.rb, line 194
def height_style
  "height: #{height||16 + ((v_offset||0)*1.5).round}px;"
end
width_style() click to toggle source
# File lib/ui_helpers/elements/icon.rb, line 190
def width_style
  "width: #{width||16 + ((h_offset||0)*1.5).round}px;"
end