Module: PrimeAwesome::LabelDrawElement

Defined in:
lib/prime_awesome/draw_label.rb

Class Method Summary collapse

Class Method Details

.included(base) ⇒ Object



4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
# File 'lib/prime_awesome/draw_label.rb', line 4

def self.included(base)
  base.class_eval do
    alias_method :draw_options!, :draw_options
    def draw_options
      if icon = computed_options[:fa_icon]
        draw_options!.merge(
          text: MotionAwesome.hex_for_icon(icon.to_s.gsub('_', '-')), 
          force_attributed: true, 
          font: 'FontAwesome'.uifont(computed_options[:fa_size] || 14)
        )
      else 
        draw_options!
      end
    end
  end
end