pub struct TerminalPanel {
pub tab_id: u32,
input_text: String,
history: Vec<Vec<TextFragment>>,
command_history: Vec<String>,
history_length: usize,
position_in_history: usize,
settings_open: bool,
settings_text: String,
pub(crate) is_active: bool,
}Expand description
UI Panel managing the interactive terminal tab state and rendering.
Fields§
§tab_id: u32Unique tab identifier hosting this terminal panel instance.
input_text: StringCurrent input text entered in the terminal command line.
history: Vec<Vec<TextFragment>>History of output lines, where each line consists of multiple TextFragments.
command_history: Vec<String>Record of previously executed commands for arrow key navigation.
history_length: usizeMaximum number of output lines retained in history.
position_in_history: usizePointer index for navigating through command_history.
settings_open: boolVisibility state of the terminal panel settings window.
settings_text: StringTemporary text edit buffer for settings inputs.
is_active: boolIndicates whether the terminal is active and accepting user input (e.g. when authenticated).
Implementations§
Source§impl TerminalPanel
impl TerminalPanel
Sourcepub fn new(tab_id: u32, is_active: bool) -> Self
pub fn new(tab_id: u32, is_active: bool) -> Self
Creates a new TerminalPanel instance for the specified tab ID.
§Arguments
tab_id- Unique identifier of the host tab.
Sourcepub fn add_fragments(&mut self, fragments: Vec<TextFragment>)
pub fn add_fragments(&mut self, fragments: Vec<TextFragment>)
Appends a multi-colored line composed of TextFragments to the terminal output history.
§Arguments
fragments- A vector of colored text fragments representing one line of log output.
Sourcefn enforce_history_length(&mut self)
fn enforce_history_length(&mut self)
Truncates the terminal output history if it exceeds history_length.
Sourcefn draw_top_bar(&mut self, ui: &mut Ui)
fn draw_top_bar(&mut self, ui: &mut Ui)
Renders the top bar of the terminal panel, including the settings gear button.
§Arguments
ui- Mutable reference to theegui::Uicontext.
Sourcefn draw_settings_window(&mut self, ui: &mut Ui)
fn draw_settings_window(&mut self, ui: &mut Ui)
Renders the modal settings window for configuring maximum history length.
§Arguments
ui- Mutable reference to theegui::Uicontext.
Sourcefn draw_central_panel(&mut self, ui: &mut Ui)
fn draw_central_panel(&mut self, ui: &mut Ui)
Renders the central scrollable area containing formatted log history lines.
Automatically scrolls and sticks to the bottom when new output lines arrive.
§Arguments
ui- Mutable reference to theegui::Uicontext.
Sourcefn draw_input_panel(&mut self, ui: &mut Ui)
fn draw_input_panel(&mut self, ui: &mut Ui)
Renders the bottom command prompt input field.
Dispatches UiEvent::SendTerminalCommand on Enter press and handles Up/Down arrow key history navigation.
§Arguments
ui- Mutable reference to theegui::Uicontext.
Trait Implementations§
Source§impl Clone for TerminalPanel
impl Clone for TerminalPanel
Source§fn clone(&self) -> TerminalPanel
fn clone(&self) -> TerminalPanel
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreAuto Trait Implementations§
impl Freeze for TerminalPanel
impl RefUnwindSafe for TerminalPanel
impl Send for TerminalPanel
impl Sync for TerminalPanel
impl Unpin for TerminalPanel
impl UnsafeUnpin for TerminalPanel
impl UnwindSafe for TerminalPanel
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
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.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.