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§
Source§impl Clone for EditorStyle
impl Clone for EditorStyle
Source§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 moreSource§impl Debug for EditorStyle
impl Debug for EditorStyle
Source§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.
Source§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