Organize code
This commit is contained in:
parent
12891aa464
commit
0da9548e2f
2 changed files with 5 additions and 12 deletions
|
@ -2,20 +2,13 @@
|
|||
|
||||
module Widgets
|
||||
class Chat
|
||||
attr_reader :x, :y, :width, :height
|
||||
attr_reader :focused
|
||||
|
||||
def initialize(x, y, width, height)
|
||||
@x = x
|
||||
@y = y
|
||||
|
||||
@width = width
|
||||
@height = height
|
||||
|
||||
@message = NewMessage.new x, y + height - 1, width, 1
|
||||
@history = History.new x, y, width, height - 1
|
||||
|
||||
@focused = false
|
||||
|
||||
@history = History.new x, y, width, height - 1
|
||||
@message = NewMessage.new x, y + height - 1, width, 1
|
||||
end
|
||||
|
||||
def render
|
||||
|
|
|
@ -7,13 +7,13 @@ module Widgets
|
|||
def initialize(x, y, width, height)
|
||||
@focused = false
|
||||
|
||||
@search = Search.new x, y, width, 1
|
||||
@list = List.new x, y + 1, width, height - 1
|
||||
@search = Search.new x, y, width, 1
|
||||
end
|
||||
|
||||
def render
|
||||
@search.render
|
||||
@list.render
|
||||
@search.render
|
||||
end
|
||||
|
||||
def trigger(event)
|
||||
|
|
Reference in a new issue