pub struct Text { /* private fields */ }Expand description
Text widget for displaying styled text.
Implementations§
Source§impl Text
impl Text
Sourcepub const fn font_weight(self, weight: FontWeight) -> Self
pub const fn font_weight(self, weight: FontWeight) -> Self
Set font weight.
Sourcepub const fn font_style(self, style: FontStyle) -> Self
pub const fn font_style(self, style: FontStyle) -> Self
Set font style.
Sourcepub const fn line_height(self, multiplier: f32) -> Self
pub const fn line_height(self, multiplier: f32) -> Self
Set line height multiplier.
Sourcepub fn with_test_id(self, id: impl Into<String>) -> Self
pub fn with_test_id(self, id: impl Into<String>) -> Self
Set test ID.
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Text
impl<'de> Deserialize<'de> for Text
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl Widget for Text
impl Widget for Text
Source§fn measure(&self, constraints: Constraints) -> Size
fn measure(&self, constraints: Constraints) -> Size
Compute intrinsic size constraints. Read more
Source§fn layout(&mut self, bounds: Rect) -> LayoutResult
fn layout(&mut self, bounds: Rect) -> LayoutResult
Position children within allocated bounds. Read more
Source§fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>
fn event(&mut self, _event: &Event) -> Option<Box<dyn Any + Send>>
Handle input events. Read more
Source§fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
fn children_mut(&mut self) -> &mut [Box<dyn Widget>]
Get mutable child widgets.
Source§fn is_interactive(&self) -> bool
fn is_interactive(&self) -> bool
Check if this widget is interactive (can receive focus/events).
Source§fn is_focusable(&self) -> bool
fn is_focusable(&self) -> bool
Check if this widget can receive keyboard focus.
Source§fn accessible_name(&self) -> Option<&str>
fn accessible_name(&self) -> Option<&str>
Get the accessible name for screen readers.
Source§fn accessible_role(&self) -> AccessibleRole
fn accessible_role(&self) -> AccessibleRole
Get the accessible role.
Auto Trait Implementations§
impl Freeze for Text
impl RefUnwindSafe for Text
impl Send for Text
impl Sync for Text
impl Unpin for Text
impl UnwindSafe for Text
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