pub struct TerminalSplitLayout {
pub left: Rect,
pub right: Rect,
pub divider_x: f32,
pub divider_width: f32,
pub cell_size: TerminalCellSize,
pub scrollbar: Option<Rect>,
}Expand description
Layout geometry for a side-by-side terminal split. The divider
occupies one cell_width column between the two panes. An optional
scrollbar strip is reserved at the right edge.
Fields§
§left: RectLeft pane region.
right: RectRight pane region.
divider_x: f32X-coordinate of the divider column’s left edge.
divider_width: f32Width of the divider column (one cell_width).
cell_size: TerminalCellSizeCell dimensions used for coordinate-to-cell conversion.
scrollbar: Option<Rect>Scrollbar strip bounds (right edge of area). None when
scrollbar_width was 0.
Implementations§
Source§impl TerminalSplitLayout
impl TerminalSplitLayout
Sourcepub fn new(
area: Rect,
left_cols: usize,
cell_width: f32,
cell_height: f32,
scrollbar_width: f32,
) -> Self
pub fn new( area: Rect, left_cols: usize, cell_width: f32, cell_height: f32, scrollbar_width: f32, ) -> Self
Compute a two-pane split layout from a containing area, left pane column count, cell dimensions, and optional scrollbar width.
TUI callers pass cell_width = 1.0, cell_height = 1.0;
GTK callers pass the font’s advance width and line height.
Pass scrollbar_width = 0.0 to omit the scrollbar zone.
Sourcepub fn hit_test(&self, x: f32, y: f32) -> TerminalSplitHit
pub fn hit_test(&self, x: f32, y: f32) -> TerminalSplitHit
Resolve an absolute point to a split zone with pane-relative cell
coordinates. Converts pixel/cell positions to (col, row) within
the hit pane using the stored cell_size.
Trait Implementations§
Source§impl Clone for TerminalSplitLayout
impl Clone for TerminalSplitLayout
impl Copy for TerminalSplitLayout
Source§impl Debug for TerminalSplitLayout
impl Debug for TerminalSplitLayout
Source§impl PartialEq for TerminalSplitLayout
impl PartialEq for TerminalSplitLayout
impl StructuralPartialEq for TerminalSplitLayout
Auto Trait Implementations§
impl Freeze for TerminalSplitLayout
impl RefUnwindSafe for TerminalSplitLayout
impl Send for TerminalSplitLayout
impl Sync for TerminalSplitLayout
impl Unpin for TerminalSplitLayout
impl UnsafeUnpin for TerminalSplitLayout
impl UnwindSafe for TerminalSplitLayout
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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
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>
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)
&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)
&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> DowncastSync for T
impl<T> DowncastSync for T
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> ⓘ
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> ⓘ
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