Archived
1
0
Fork 0

Add borders

This commit is contained in:
Braiden Vasco 2017-07-26 15:04:03 +00:00
parent 494a21f75f
commit c74532ac54
3 changed files with 29 additions and 10 deletions

View file

@ -538,34 +538,34 @@ private
}.freeze,
chat: {
x: Widgets::Logo::WIDTH,
x: Widgets::Logo::WIDTH + 1,
y: 0,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH - 1,
height: Curses.stdscr.maxy,
focus: :new_message,
focused: false,
info: {
x: Widgets::Logo::WIDTH,
x: Widgets::Logo::WIDTH + 1,
y: 0,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH - 1,
height: 2,
focused: false,
}.freeze,
new_message: {
x: Widgets::Logo::WIDTH,
x: Widgets::Logo::WIDTH + 1,
y: Curses.stdscr.maxy - 1,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH - 1,
height: 1,
focused: false,
}.freeze,
history: {
x: Widgets::Logo::WIDTH,
y: 2,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH,
height: Curses.stdscr.maxy - 3,
x: Widgets::Logo::WIDTH + 1,
y: 3,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH - 1,
height: Curses.stdscr.maxy - 5,
focused: true,
}.freeze,
}.freeze,

View file

@ -48,6 +48,16 @@ module Widgets
private
def draw
super
setpos 0, 2
addstr '-' * props[:width]
setpos 0, props[:height] - 2
addstr '-' * props[:width]
end
def focus
case props[:focus]
when :info then @info

View file

@ -53,6 +53,15 @@ module Widgets
private
def draw
super
(0...props[:height]).each do |y|
setpos props[:sidebar][:width], y
addstr '|'
end
end
def focus
case props[:focus]
when :sidebar then @sidebar