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/sidebar.rb
2017-07-24 22:34:50 +00:00

28 lines
545 B
Ruby

# frozen_string_literal: true
module Widgets
class Sidebar < Container
def initialize(parent, x, y, _width, height)
super parent, x, y, Logo::WIDTH, height
@logo = Logo.new self, x, y, nil, nil
@menu = Menu.new self, x, @logo.height, @logo.width, height - @logo.height
end
def focus
case props[:focus]
when :menu
@menu
end
end
def props=(_value)
super
@menu.props = props[:menu]
end
def children
[@logo, @menu]
end
end
end