Struct EditorStyle
pub struct EditorStyle {
pub bg: Color,
pub fg: Color,
pub caret: Color,
pub selection_bg: Color,
pub caret_blink_ms: i64,
pub font: FontId,
pub px_size: u16,
pub line_height: f32,
pub pad: f32,
}Expand description
Visual metrics and colors used by the editor engine.
Geometry is in logical pixels. caret_blink_ms <= 0 disables blinking and
keeps the caret visible; callers should provide finite non-negative geometry.
§Examples
use ailloli_ui_core::FontId;
use ailloli_ui_editor::EditorStyle;
let style = EditorStyle::default();
assert_eq!(style.font, FontId::Mono);
assert_eq!((style.px_size, style.line_height, style.pad), (13, 18.0, 10.0));Fields§
§bg: ColorEditor background color.
fg: ColorDefault foreground text color.
caret: ColorCaret color.
selection_bg: ColorSelection highlight color.
caret_blink_ms: i64Blink half-period in milliseconds; non-positive means always visible.
font: FontIdFont family identifier passed to text layout.
px_size: u16Font size in logical pixels.
line_height: f32Minimum visual line height in logical pixels.
pad: f32Uniform content inset in logical pixels.
Trait Implementations§
§impl Clone for EditorStyle
impl Clone for EditorStyle
§fn clone(&self) -> EditorStyle
fn clone(&self) -> EditorStyle
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 more§impl Debug for EditorStyle
impl Debug for EditorStyle
§impl Default for EditorStyle
Supplies the dark neutral editor palette and fixed logical metrics.
impl Default for EditorStyle
Supplies the dark neutral editor palette and fixed logical metrics.
§fn default() -> EditorStyle
fn default() -> EditorStyle
Returns 13 px mono text, 18 px lines, 10 px padding, and 500 ms blink.
§impl PartialEq for EditorStyle
impl PartialEq for EditorStyle
impl Copy for EditorStyle
impl StructuralPartialEq for EditorStyle
Auto Trait Implementations§
impl Freeze for EditorStyle
impl RefUnwindSafe for EditorStyle
impl Send for EditorStyle
impl Sync for EditorStyle
impl Unpin for EditorStyle
impl UnwindSafe for EditorStyle
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.