pub struct MasterLayout { /* private fields */ }Available on crate feature
master-layout only.Expand description
Master Layout - orchestrates the entire TUI application
§Architecture
┌─────────────────────────────────┐
│ Navigation Bar (1 row + border) │ ← 3 rows total
├─────────────────────────────────┤
│ │
│ Active Tab │ ← Remaining space
│ (panes + footer) │
│ │
└─────────────────────────────────┘§Modes
- Layout Mode: Navigate panes with hjkl, Tab/Shift+Tab, Enter to focus
- Focus Mode: All input goes to focused pane, Ctrl-A to exit
§Key Bindings
Global (always work):
- Ctrl+Q: Quit
- 1-9: Switch tabs
Layout Mode:
- h/j/k/l: Directional navigation
- Tab: Next pane
- Shift+Tab: Previous pane
- Enter: Focus selected pane
Focus Mode:
- Ctrl-A: Exit to Layout Mode
- All other keys: Route to focused pane
- Mouse on same pane: Route to pane
- Mouse on different pane: Change focus
Implementations§
Source§impl MasterLayout
impl MasterLayout
Set the navigation bar left offset (to make room for other components like IconNavBar)
Sourcepub fn active_tab_index(&self) -> usize
pub fn active_tab_index(&self) -> usize
Get active tab index
Sourcepub fn set_active_tab(&mut self, index: usize)
pub fn set_active_tab(&mut self, index: usize)
Set active tab by index
Sourcepub fn active_tab(&self) -> Option<&Tab>
pub fn active_tab(&self) -> Option<&Tab>
Get reference to active tab
Sourcepub fn active_tab_mut(&mut self) -> Option<&mut Tab>
pub fn active_tab_mut(&mut self) -> Option<&mut Tab>
Get mutable reference to active tab
Sourcepub fn mode(&self) -> &InteractionMode
pub fn mode(&self) -> &InteractionMode
Get current interaction mode
Sourcepub fn enter_layout_mode(&mut self)
pub fn enter_layout_mode(&mut self)
Enter Layout Mode
Sourcepub fn enter_focus_mode(&mut self, pane_id: PaneId)
pub fn enter_focus_mode(&mut self, pane_id: PaneId)
Enter Focus Mode with a specific pane
Sourcepub fn exit_focus_mode(&mut self)
pub fn exit_focus_mode(&mut self)
Exit Focus Mode (Ctrl-A) - returns to Layout Mode
Sourcepub fn select_next_pane(&mut self)
pub fn select_next_pane(&mut self)
Select next pane (Tab key in Layout Mode)
Sourcepub fn select_prev_pane(&mut self)
pub fn select_prev_pane(&mut self)
Select previous pane (Shift+Tab key in Layout Mode)
Sourcepub fn select_left(&mut self)
pub fn select_left(&mut self)
Select pane to the left (h key in Layout Mode)
Sourcepub fn select_right(&mut self)
pub fn select_right(&mut self)
Select pane to the right (l key in Layout Mode)
Sourcepub fn select_down(&mut self)
pub fn select_down(&mut self)
Select pane below (j key in Layout Mode)
Sourcepub fn focus_selected(&mut self)
pub fn focus_selected(&mut self)
Focus the currently selected pane (Enter key in Layout Mode)
Sourcepub fn handle_event(&mut self, event: Event) -> EventResult
pub fn handle_event(&mut self, event: Event) -> EventResult
Handle a crossterm event
Trait Implementations§
Auto Trait Implementations§
impl Freeze for MasterLayout
impl !RefUnwindSafe for MasterLayout
impl !Send for MasterLayout
impl !Sync for MasterLayout
impl Unpin for MasterLayout
impl !UnwindSafe for MasterLayout
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more