pub enum EditorPaintItem {
Show 14 variants
Background {
rect: Rect,
color: Color,
},
GutterBackground {
rect: Rect,
color: Color,
},
LineNumber {
pos: [f32; 2],
color: Color,
layout: TextLayoutHandle,
},
DiagnosticGutterMarker {
rect: Rect,
color: Color,
},
FoldGutterGuide {
rect: Rect,
color: Color,
},
FoldGutterMarker {
rect: Rect,
color: Color,
region_index: usize,
collapsed: bool,
},
ActiveLine {
fill_rect: Rect,
ring_rect: Rect,
fill: Color,
ring: Color,
},
Selection {
rect: Rect,
color: Color,
},
SearchHighlight {
rect: Rect,
color: Color,
active: bool,
},
DiagnosticUnderline {
rect: Rect,
color: Color,
active: bool,
},
FoldPlaceholder {
pos: [f32; 2],
color: Color,
layout: TextLayoutHandle,
},
Text {
pos: [f32; 2],
color: Color,
layout: TextLayoutHandle,
},
Caret {
rect: Rect,
color: Color,
},
Scrollbar {
track_rect: Rect,
thumb_rect: Rect,
track_color: Color,
thumb_color: Color,
radius: f32,
},
}Expand description
Neutral editor paint item. UI adapters convert this into draw commands.
All positions, rectangles, radii, and widths are logical pixels. Text layout handles are shared references and cheap to clone.
§Examples
use ailloli_ui_core::{Color, Rect};
use ailloli_ui_editor::EditorPaintItem;
let item = EditorPaintItem::Background { rect: Rect::new(0.0, 0.0, 20.0, 10.0), color: Color::BLACK };
assert!(matches!(item, EditorPaintItem::Background { .. }));Variants§
Background
Editor-surface fill.
GutterBackground
Code gutter fill.
LineNumber
Shaped one-based logical line number.
DiagnosticGutterMarker
Compact diagnostic mark in the gutter.
FoldGutterGuide
Vertical guide extending from a fold marker.
FoldGutterMarker
Interactive fold marker in the gutter.
ActiveLine
Fill and focus ring for the caret’s visual line.
Fields
fill_rect: RectLine fill area clipped to the text viewport.
ring_rect: RectRing bounds clipped to the text viewport.
fill: ColorLine fill color.
ring: ColorRing color.
Selection
Selection fill for one visual-line segment.
SearchHighlight
Search-result fill for one visual-line segment.
DiagnosticUnderline
Two-logical-pixel diagnostic underline.
FoldPlaceholder
Shaped label displayed after a collapsed fold header.
Text
Uniform or syntax-styled text run.
Fields
color: ColorBase text color for adapters that do not inspect glyph colors.
layout: TextLayoutHandleShaped text layout.
Caret
Insertion caret.
Scrollbar
Vertical or horizontal scrollbar track and thumb.
Trait Implementations§
Source§impl Clone for EditorPaintItem
impl Clone for EditorPaintItem
Source§fn clone(&self) -> EditorPaintItem
fn clone(&self) -> EditorPaintItem
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more