Class: SolidQueueTui::Components::HelpBar
- Inherits:
-
Object
- Object
- SolidQueueTui::Components::HelpBar
- Defined in:
- lib/solid_queue_tui/components/help_bar.rb
Constant Summary collapse
- DEFAULT_BINDINGS =
[ { key: "q", action: "Quit" }, { key: "r", action: "Refresh" }, { key: "Tab", action: "Next View" }, { key: "j/k", action: "Navigate" }, { key: "/", action: "Filter" }, { key: "Esc", action: "Clear" } ].freeze
Instance Method Summary collapse
-
#initialize(tui, breadcrumb:, bindings: nil, status: nil) ⇒ HelpBar
constructor
A new instance of HelpBar.
- #render(frame, area) ⇒ Object
Constructor Details
#initialize(tui, breadcrumb:, bindings: nil, status: nil) ⇒ HelpBar
Returns a new instance of HelpBar.
15 16 17 18 19 20 |
# File 'lib/solid_queue_tui/components/help_bar.rb', line 15 def initialize(tui, breadcrumb:, bindings: nil, status: nil) @tui = tui @breadcrumb = @bindings = bindings || DEFAULT_BINDINGS @status = status end |
Instance Method Details
#render(frame, area) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 |
# File 'lib/solid_queue_tui/components/help_bar.rb', line 22 def render(frame, area) left, right = @tui.layout_split( area, direction: :horizontal, constraints: [ @tui.constraint_percentage(30), @tui.constraint_percentage(70) ] ) (frame, left) render_bindings(frame, right) end |