pub struct Pane { /* private fields */ }Available on crate feature
master-layout only.Expand description
A pane within a tab
Implementations§
Source§impl Pane
impl Pane
Sourcepub fn new(id: PaneId, content: Box<dyn PaneContent>) -> Self
pub fn new(id: PaneId, content: Box<dyn PaneContent>) -> Self
Create a new pane with given ID and content
Sourcepub fn with_padding(self, top: u16, right: u16, bottom: u16, left: u16) -> Self
pub fn with_padding(self, top: u16, right: u16, bottom: u16, left: u16) -> Self
Set the padding (top, right, bottom, left)
Sourcepub fn with_uniform_padding(self, padding: u16) -> Self
pub fn with_uniform_padding(self, padding: u16) -> Self
Set uniform padding on all sides
Set a text footer (displayed in the border)
Sourcepub fn with_border_type(self, border_type: BorderType) -> Self
pub fn with_border_type(self, border_type: BorderType) -> Self
Set the border type
Sourcepub fn is_focusable(&self) -> bool
pub fn is_focusable(&self) -> bool
Check if pane is focusable
Sourcepub fn handle_key(&mut self, key: KeyEvent) -> bool
pub fn handle_key(&mut self, key: KeyEvent) -> bool
Handle keyboard input
Sourcepub fn handle_mouse(&mut self, mouse: MouseEvent) -> bool
pub fn handle_mouse(&mut self, mouse: MouseEvent) -> bool
Handle mouse input (coordinates already translated to pane-local)
Sourcepub fn start_selection(&mut self, x: u16, y: u16)
pub fn start_selection(&mut self, x: u16, y: u16)
Start text selection at the given coordinates
Sourcepub fn update_selection(&mut self, x: u16, y: u16)
pub fn update_selection(&mut self, x: u16, y: u16)
Update text selection to the given coordinates
Sourcepub fn end_selection(&mut self)
pub fn end_selection(&mut self)
End text selection
Sourcepub fn get_selected_text(&self) -> Option<String>
pub fn get_selected_text(&self) -> Option<String>
Get the currently selected text
Sourcepub fn clear_selection(&mut self)
pub fn clear_selection(&mut self)
Clear the current selection
Sourcepub fn has_selection(&self) -> bool
pub fn has_selection(&self) -> bool
Check if there is an active selection
Sourcepub fn set_focused(&mut self, focused: bool)
pub fn set_focused(&mut self, focused: bool)
Notify pane content about focus state change
Sourcepub fn translate_mouse(&self, mouse: MouseEvent) -> MouseEvent
pub fn translate_mouse(&self, mouse: MouseEvent) -> MouseEvent
Translate global mouse coordinates to pane-local coordinates
Sourcepub fn contains_point(&self, x: u16, y: u16) -> bool
pub fn contains_point(&self, x: u16, y: u16) -> bool
Check if point is within pane bounds
Auto Trait Implementations§
impl Freeze for Pane
impl !RefUnwindSafe for Pane
impl !Send for Pane
impl !Sync for Pane
impl Unpin for Pane
impl !UnwindSafe for Pane
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