Class: Wads::GuiTheme
- Inherits:
-
Object
- Object
- Wads::GuiTheme
- Defined in:
- lib/wads/widgets.rb
Overview
An instance of GuiTheme directs wads widgets as to what colors and fonts should be used. This accomplishes two goals: one, we don’t need to constantly pass around these instances. They can be globally accessed using WadsConfig. It also makes it easy to change the look and feel of your application.
Direct Known Subclasses
WadsAquaTheme, WadsBrightTheme, WadsDarkRedBrownTheme, WadsEarthTonesTheme, WadsNatureTheme, WadsNoIconTheme, WadsPurpleTheme
Instance Attribute Summary collapse
-
#background_color ⇒ Object
Returns the value of attribute background_color.
-
#border_color ⇒ Object
Returns the value of attribute border_color.
-
#font ⇒ Object
Returns the value of attribute font.
-
#font_large ⇒ Object
Returns the value of attribute font_large.
-
#graphic_elements_color ⇒ Object
Returns the value of attribute graphic_elements_color.
-
#selection_color ⇒ Object
Returns the value of attribute selection_color.
-
#text_color ⇒ Object
Returns the value of attribute text_color.
-
#use_icons ⇒ Object
Returns the value of attribute use_icons.
Instance Method Summary collapse
-
#initialize(text, graphics, border, background, selection, use_icons, font, font_large) ⇒ GuiTheme
constructor
A new instance of GuiTheme.
- #pixel_width_for_large_font(str) ⇒ Object
- #pixel_width_for_string(str) ⇒ Object
Constructor Details
#initialize(text, graphics, border, background, selection, use_icons, font, font_large) ⇒ GuiTheme
Returns a new instance of GuiTheme.
151 152 153 154 155 156 157 158 159 160 |
# File 'lib/wads/widgets.rb', line 151 def initialize(text, graphics, border, background, selection, use_icons, font, font_large) @text_color = text @graphic_elements_color = graphics @border_color = border @background_color = background @selection_color = selection @use_icons = use_icons @font = font @font_large = font_large end |
Instance Attribute Details
#background_color ⇒ Object
Returns the value of attribute background_color.
145 146 147 |
# File 'lib/wads/widgets.rb', line 145 def background_color @background_color end |
#border_color ⇒ Object
Returns the value of attribute border_color.
144 145 146 |
# File 'lib/wads/widgets.rb', line 144 def border_color @border_color end |
#font ⇒ Object
Returns the value of attribute font.
148 149 150 |
# File 'lib/wads/widgets.rb', line 148 def font @font end |
#font_large ⇒ Object
Returns the value of attribute font_large.
149 150 151 |
# File 'lib/wads/widgets.rb', line 149 def font_large @font_large end |
#graphic_elements_color ⇒ Object
Returns the value of attribute graphic_elements_color.
143 144 145 |
# File 'lib/wads/widgets.rb', line 143 def graphic_elements_color @graphic_elements_color end |
#selection_color ⇒ Object
Returns the value of attribute selection_color.
146 147 148 |
# File 'lib/wads/widgets.rb', line 146 def selection_color @selection_color end |
#text_color ⇒ Object
Returns the value of attribute text_color.
142 143 144 |
# File 'lib/wads/widgets.rb', line 142 def text_color @text_color end |
#use_icons ⇒ Object
Returns the value of attribute use_icons.
147 148 149 |
# File 'lib/wads/widgets.rb', line 147 def use_icons @use_icons end |
Instance Method Details
#pixel_width_for_large_font(str) ⇒ Object
166 167 168 |
# File 'lib/wads/widgets.rb', line 166 def pixel_width_for_large_font(str) @font_large.text_width(str) end |
#pixel_width_for_string(str) ⇒ Object
162 163 164 |
# File 'lib/wads/widgets.rb', line 162 def pixel_width_for_string(str) @font.text_width(str) end |