14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
|
# File 'lib/timely/ui/panes.rb', line 14
def create_panes
@panes = {}
top_h = 10
bottom_h = (@h * 0.2).to_i
bottom_h = [bottom_h, 5].max
mid_h = @h - 2 - top_h - bottom_h mid_h = [mid_h, 4].max
if 2 + top_h + mid_h + bottom_h > @h
bottom_h = @h - 2 - top_h - mid_h
bottom_h = [bottom_h, 3].max
end
info_bg = @config ? @config.get('colors.info_bg', 235) : 235
status_bg = @config ? @config.get('colors.status_bg', 235) : 235
@panes[:info] = Rcurses::Pane.new(1, 1, @w, 1, 255, info_bg)
@panes[:top] = Rcurses::Pane.new(1, 2, @w, top_h)
@panes[:mid] = Rcurses::Pane.new(1, 2 + top_h, @w, mid_h)
@panes[:bottom] = Rcurses::Pane.new(1, 2 + top_h + mid_h, @w, bottom_h)
@panes[:status] = Rcurses::Pane.new(1, @h, @w, 1, 252, status_bg)
@panes.each_value do |p|
p.border = false
p.scroll = false
end
end
|