pub struct EditableTextStyle {
pub text: TextStyle,
pub caret: Color,
pub caret_w: f32,
pub caret_blink_ms: i64,
pub selection_bg: Option<Color>,
}Expand description
Colors, metrics, and blink cadence for draw_editable_mono_line.
Widths are logical pixels and caret_blink_ms is milliseconds per visible
or hidden half-period. A non-positive blink value suppresses the caret.
§Examples
use ailloli_ui_widgets::text::EditableTextStyle;
let style = EditableTextStyle::default();
assert_eq!(style.caret_w, 1.0);
assert_eq!(style.caret_blink_ms, 500);
assert!(style.selection_bg.is_some());Fields§
§text: TextStyleGlyph font, size in integer logical pixels, color, and decoration.
caret: ColorCaret fill color.
caret_w: f32Caret width in logical pixels; not clamped by the draw helper.
caret_blink_ms: i64Milliseconds per blink half-period; non-positive disables the caret.
selection_bg: Option<Color>Optional selection fill; None suppresses selection painting.
Trait Implementations§
Source§impl Clone for EditableTextStyle
impl Clone for EditableTextStyle
Source§fn clone(&self) -> EditableTextStyle
fn clone(&self) -> EditableTextStyle
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for EditableTextStyle
impl Debug for EditableTextStyle
Source§impl Default for EditableTextStyle
Supplies a 15-pixel mono style, one-pixel caret, and 500 ms blink cadence.
impl Default for EditableTextStyle
Supplies a 15-pixel mono style, one-pixel caret, and 500 ms blink cadence.
impl Copy for EditableTextStyle
Auto Trait Implementations§
impl Freeze for EditableTextStyle
impl RefUnwindSafe for EditableTextStyle
impl Send for EditableTextStyle
impl Sync for EditableTextStyle
impl Unpin for EditableTextStyle
impl UnwindSafe for EditableTextStyle
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
impl<A> IntoClickAction<A> for Awhere
A: Clone + 'static,
§fn into_click_action(self) -> ClickAction<A>
fn into_click_action(self) -> ClickAction<A>
Implements the into_click_action helper used by this module.