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, }.freeze,
chat: { chat: {
x: Widgets::Logo::WIDTH, x: Widgets::Logo::WIDTH + 1,
y: 0, y: 0,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH, width: Curses.stdscr.maxx - Widgets::Logo::WIDTH - 1,
height: Curses.stdscr.maxy, height: Curses.stdscr.maxy,
focus: :new_message, focus: :new_message,
focused: false, focused: false,
info: { info: {
x: Widgets::Logo::WIDTH, x: Widgets::Logo::WIDTH + 1,
y: 0, y: 0,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH, width: Curses.stdscr.maxx - Widgets::Logo::WIDTH - 1,
height: 2, height: 2,
focused: false, focused: false,
}.freeze, }.freeze,
new_message: { new_message: {
x: Widgets::Logo::WIDTH, x: Widgets::Logo::WIDTH + 1,
y: Curses.stdscr.maxy - 1, y: Curses.stdscr.maxy - 1,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH, width: Curses.stdscr.maxx - Widgets::Logo::WIDTH - 1,
height: 1, height: 1,
focused: false, focused: false,
}.freeze, }.freeze,
history: { history: {
x: Widgets::Logo::WIDTH, x: Widgets::Logo::WIDTH + 1,
y: 2, y: 3,
width: Curses.stdscr.maxx - Widgets::Logo::WIDTH, width: Curses.stdscr.maxx - Widgets::Logo::WIDTH - 1,
height: Curses.stdscr.maxy - 3, height: Curses.stdscr.maxy - 5,
focused: true, focused: true,
}.freeze, }.freeze,
}.freeze, }.freeze,

View file

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

View file

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