Archived
1
0
Fork 0
This repository has been archived on 2023-03-27. You can view files and clone it, but cannot push or open issues or pull requests.
cli-old/lib/widgets/peers.rb
2017-07-22 08:40:12 +00:00

31 lines
588 B
Ruby

# frozen_string_literal: true
module Widgets
class Peers < VPanel
def initialize(x, y, width, height)
super
@list = List.new x, y + 1, width, height - 1
@search = Search.new x, y, width, 1
end
def children
[@list, @search]
end
def trigger(event)
case event
when Events::Panel::Base
@list.trigger event
when Events::Text::Base
@search.trigger event
end
end
def focused=(value)
@focused = !!value
@list.focused = focused
@search.focused = focused
end
end
end