Class: Dedalus::PatternLibrary::LibrarySectionTab
- Defined in:
- lib/dedalus/pattern_library/molecules/library_section_tab.rb
Instance Attribute Summary collapse
-
#description ⇒ Object
Returns the value of attribute description.
-
#highlight ⇒ Object
Returns the value of attribute highlight.
-
#icon ⇒ Object
Returns the value of attribute icon.
-
#name ⇒ Object
Returns the value of attribute name.
-
#scale ⇒ Object
Returns the value of attribute scale.
-
#section_color ⇒ Object
Returns the value of attribute section_color.
Attributes inherited from Element
#color, #height_percent, #margin, #offset, #padding, #position, #width, #width_percent
Class Method Summary collapse
Instance Method Summary collapse
- #background_color ⇒ Object
- #click ⇒ Object
- #description_element ⇒ Object
- #height ⇒ Object
- #hover ⇒ Object
- #icon_element ⇒ Object
- #show ⇒ Object
- #title_element ⇒ Object
Methods inherited from Element
#big_font, #code_font, #draw_bounding_box, #font, #huge_font, #initialize, #record?, #tiny_font, #view, #window
Constructor Details
This class inherits a constructor from Dedalus::Element
Instance Attribute Details
#description ⇒ Object
Returns the value of attribute description.
4 5 6 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 4 def description @description end |
#highlight ⇒ Object
Returns the value of attribute highlight.
4 5 6 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 4 def highlight @highlight end |
#icon ⇒ Object
Returns the value of attribute icon.
4 5 6 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 4 def icon @icon end |
#name ⇒ Object
Returns the value of attribute name.
4 5 6 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 4 def name @name end |
#scale ⇒ Object
Returns the value of attribute scale.
4 5 6 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 4 def scale @scale end |
#section_color ⇒ Object
Returns the value of attribute section_color.
4 5 6 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 4 def section_color @section_color end |
Class Method Details
.description ⇒ Object
43 44 45 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 43 def self.description "navigational tab" end |
.example_data ⇒ Object
47 48 49 50 51 52 53 54 55 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 47 def self.example_data { icon: :house, name: "Welcome", description: "Hello world (links to Welcome)", highlight: false, section_color: 'gray' } end |
Instance Method Details
#background_color ⇒ Object
14 15 16 17 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 14 def background_color bg = Palette.decode_color(section_color) self.highlight ? bg.lighten : bg end |
#click ⇒ Object
19 20 21 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 19 def click view.route_to(name) end |
#description_element ⇒ Object
39 40 41 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 39 def description_element TinyText.new(text: description) end |
#height ⇒ Object
27 28 29 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 27 def height @height ||= 80 end |
#hover ⇒ Object
10 11 12 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 10 def hover @scale = 0.2 end |
#icon_element ⇒ Object
31 32 33 |
# File 'lib/dedalus/pattern_library/molecules/library_section_tab.rb', line 31 def icon_element Elements::Icon.for(icon, padding: 10) end |