pub struct Panel<'a> { /* private fields */ }Expand description
A consistent panel wrapper that applies standardized chrome (borders, titles)
This widget ensures visual consistency across all panels in the UI by providing a unified border and title style based on the active theme.
§Example
ⓘ
let inner = Panel::new(&styles)
.title("Transcript")
.active(true)
.mode(layout_mode)
.render_and_get_inner(area, buf);
// Render child widget into `inner`Implementations§
Source§impl<'a> Panel<'a>
impl<'a> Panel<'a>
Sourcepub fn new(styles: &'a SessionStyles) -> Self
pub fn new(styles: &'a SessionStyles) -> Self
Create a new panel with required style reference
Sourcepub fn mode(self, mode: LayoutMode) -> Self
pub fn mode(self, mode: LayoutMode) -> Self
Set the layout mode (affects border visibility)
Sourcepub fn border_type(self, border_type: BorderType) -> Self
pub fn border_type(self, border_type: BorderType) -> Self
Override the border type
Sourcepub fn render_and_get_inner(self, area: Rect, buf: &mut Buffer) -> Rect
pub fn render_and_get_inner(self, area: Rect, buf: &mut Buffer) -> Rect
Render the panel and return the inner area for child widgets
Auto Trait Implementations§
impl<'a> Freeze for Panel<'a>
impl<'a> RefUnwindSafe for Panel<'a>
impl<'a> Send for Panel<'a>
impl<'a> Sync for Panel<'a>
impl<'a> Unpin for Panel<'a>
impl<'a> UnsafeUnpin for Panel<'a>
impl<'a> UnwindSafe for Panel<'a>
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> 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