class

Opal::UI::Tabs

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

Tabbed navigation header component for multi-view interfaces.

Constructors

from_labels(labels : Array(String), active : Int32 = 0) : Tabs
Source
new(items : Array(TabItem) = [] of TabItem, active_index : Int32 = 0, active_fg : Color | Symbol | String | Nil = nil, active_bg : Color | Symbol | String | Nil = nil, inactive_fg : Color | Symbol | String | Nil = nil, inactive_bg : Color | Symbol | String | Nil = nil, spacing : Int32 = 2, pill_style : Bool = false, on_change : Proc(Int32, TabItem, Nil) | Nil = nil)
Source
new(labels : Array(String), active_index : Int32 = 0, active_fg : Color | Symbol | String | Nil = nil, active_bg : Color | Symbol | String | Nil = nil, inactive_fg : Color | Symbol | String | Nil = nil, inactive_bg : Color | Symbol | String | Nil = nil, spacing : Int32 = 2, pill_style : Bool = false) : Tabs
Source

Instance methods

active_bg
Source
active_bg=(active_bg : Color | Nil)
Source
active_fg
Source
active_fg=(active_fg : Color | Nil)
Source
active_index
Source
active_index=(active_index : Int32)
Source
active_tab
Source
handle_key(key : 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
inactive_bg
Source
inactive_bg=(inactive_bg : Color | Nil)
Source
inactive_fg
Source
inactive_fg=(inactive_fg : Color | Nil)
Source
items
Source
items=(items : Array(TabItem))
Source
next_tab
Source
on_change
Source
on_change=(on_change : Proc(Int32, TabItem, Nil) | Nil)
Source
pill_style=(pill_style : Bool)
Source
pill_style?
Source
preferred_size(available_w : Int32, available_h : Int32) : Tuple(Int32, Int32)
Source
prev_tab
Source
render(buffer : Buffer, x : Int32, y : Int32, width : Int32, height : Int32) : Nil
Source
select(index : Int32) : self
Source
select_id(id : String) : self
Source
spacing
Source
spacing=(spacing : Int32)
Source