class

Opal::UI::Collapsible

Inherits Opal::UI::Control < Opal::UI::InputHookable < Opal::UI::Element < Opal::UI::Themable < Reference < Object

Accordion collapsible container inspired by Python Textual's Collapsible. Features a clickable header with expandable chevron (▶ / ▼), nested child container, keyboard and mouse toggle, and border styling.

Constructors

new(title : String, child : Element | Nil = nil, collapsed : Bool = true, disabled : Bool = false, on_toggle : Proc(Bool, Nil) | Nil = nil)
Source
new(title : String, collapsed : Bool = true, disabled : Bool = false, &block : Collapsible -> Nil) : Collapsible
Source

Instance methods

border_fg
Source
border_fg=(border_fg : Color | Nil)
Source
chevron_fg
Source
chevron_fg=(chevron_fg : Color | Nil)
Source
child
Source
child=(child : Element | Nil)
Source
children

Returns child elements for hierarchical tree traversal and DOM querying

Source
closed_chevron
Source
closed_chevron=(closed_chevron : String | Nil)
Source
collapse
Source
collapsed=(collapsed : Bool)
Source
collapsed?
Source
disabled=(disabled : Bool)
Source
disabled?
Source
expand
Source
handle_key(event : Terminal::KeyEvent) : Bool

Default key event handler. Override in subclasses if not using @default_input_proc.

Source
handle_mouse(event : Terminal::MouseEvent) : Bool

Default mouse event handler. Override in subclasses if not using @default_input_proc.

Source
header_bg
Source
header_bg=(header_bg : Color | Nil)
Source
header_fg

Manipulable styling

Source
header_fg=(header_fg : Color | Nil)

Manipulable styling

Source
on_toggle
Source
on_toggle
Source
on_toggle=(on_toggle : Proc(Bool, Nil) | Nil)
Source
open_chevron
Source
open_chevron=(open_chevron : String | Nil)
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
title
Source
title=(title : String)
Source
toggle
Source