pub struct TextInputLayout {
pub bounds: Rect,
pub content_bounds: Rect,
pub visible_lines: Vec<VisibleTextInputLine>,
pub cursor_bounds: Option<Rect>,
pub resolved_scroll_offset: usize,
pub resolved_scroll_col: usize,
pub hit_regions: Vec<(Rect, TextInputHit)>,
pub placeholder_active: bool,
}Expand description
Fully-resolved layout.
Fields§
§bounds: RectOuter bounds (matches the rect argument to layout).
content_bounds: RectContent bounds (inside any border/padding the rasteriser draws).
visible_lines: Vec<VisibleTextInputLine>§cursor_bounds: Option<Rect>Cursor bounds in viewport pixels/cells when the cursor is inside
the visible window, otherwise None. Rasterisers paint a cursor
glyph (TUI) or vertical bar (GTK) at this rect.
resolved_scroll_offset: usizeVertical scroll offset after auto-clamp. The primitive guarantees the cursor is visible by adjusting this.
resolved_scroll_col: usizeHorizontal scroll offset (char columns) after auto-clamp.
Rasterisers slice each line [resolved_scroll_col..] before
painting.
hit_regions: Vec<(Rect, TextInputHit)>Per-region hit map for click routing.
placeholder_active: boolTrue when the placeholder was rendered (lines empty / single empty line). Rasterisers consult this to draw the placeholder in a muted color.
Implementations§
Source§impl TextInputLayout
impl TextInputLayout
Sourcepub fn hit_test(&self, x: f32, y: f32) -> TextInputHit
pub fn hit_test(&self, x: f32, y: f32) -> TextInputHit
Hit-test a click at surface-native coordinates (x, y) against
this layout’s hit_regions.
Coordinate frame: ABSOLUTE — matches TextInputLayout’s own
convention (bounds/content_bounds/hit_regions all carry
rect.x/rect.y, per PRIMITIVE_RULES.md’s coordinate-frame
table). Returns TextInputHit::EmptyArea when (x, y) falls
outside every region.
Trait Implementations§
Source§impl Clone for TextInputLayout
impl Clone for TextInputLayout
Source§impl Debug for TextInputLayout
impl Debug for TextInputLayout
Source§impl PartialEq for TextInputLayout
impl PartialEq for TextInputLayout
impl StructuralPartialEq for TextInputLayout
Auto Trait Implementations§
impl Freeze for TextInputLayout
impl RefUnwindSafe for TextInputLayout
impl Send for TextInputLayout
impl Sync for TextInputLayout
impl Unpin for TextInputLayout
impl UnsafeUnpin for TextInputLayout
impl UnwindSafe for TextInputLayout
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