Class: Shellfie::Themes::Configured

Inherits:
Object
  • Object
show all
Defined in:
lib/shellfie/themes/configured.rb

Instance Method Summary collapse

Constructor Details

#initialize(base_theme, name:, colors: {}, window_decoration: {}, font: {}) ⇒ Configured

Returns a new instance of Configured.



6
7
8
9
10
11
12
# File 'lib/shellfie/themes/configured.rb', line 6

def initialize(base_theme, name:, colors: {}, window_decoration: {}, font: {})
  @base_theme = base_theme
  @name = name
  @colors = colors || {}
  @window_decoration = window_decoration || {}
  @font = font || {}
end

Instance Method Details

#button_colorsObject



30
31
32
# File 'lib/shellfie/themes/configured.rb', line 30

def button_colors
  @base_theme.button_colors
end

#button_styleObject



34
35
36
# File 'lib/shellfie/themes/configured.rb', line 34

def button_style
  @base_theme.button_style
end

#buttons_positionObject



38
39
40
# File 'lib/shellfie/themes/configured.rb', line 38

def buttons_position
  @base_theme.buttons_position
end

#color_for(name) ⇒ Object



46
47
48
49
50
# File 'lib/shellfie/themes/configured.rb', line 46

def color_for(name)
  return name if name.is_a?(String) && name.start_with?("#")

  colors[name.to_sym] || colors[:foreground]
end

#colorsObject



22
23
24
# File 'lib/shellfie/themes/configured.rb', line 22

def colors
  @base_theme.colors.merge(@colors)
end

#fontObject



26
27
28
# File 'lib/shellfie/themes/configured.rb', line 26

def font
  @base_theme.font.merge(@font)
end

#nameObject



14
15
16
# File 'lib/shellfie/themes/configured.rb', line 14

def name
  @name
end

#title_alignmentObject



42
43
44
# File 'lib/shellfie/themes/configured.rb', line 42

def title_alignment
  @base_theme.title_alignment
end

#window_decorationObject



18
19
20
# File 'lib/shellfie/themes/configured.rb', line 18

def window_decoration
  deep_merge(@base_theme.window_decoration, @window_decoration)
end