Enum EditorPaintItem

Source
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.

Fields

§rect: Rect

Area to fill.

§color: Color

Fill color.

§

GutterBackground

Code gutter fill.

Fields

§rect: Rect

Gutter area.

§color: Color

Fill color.

§

LineNumber

Shaped one-based logical line number.

Fields

§pos: [f32; 2]

Baseline origin [x, y].

§color: Color

Text color.

§layout: TextLayoutHandle

Shaped number layout.

§

DiagnosticGutterMarker

Compact diagnostic mark in the gutter.

Fields

§rect: Rect

Marker area.

§color: Color

Severity color.

§

FoldGutterGuide

Vertical guide extending from a fold marker.

Fields

§rect: Rect

Guide area.

§color: Color

Guide color.

§

FoldGutterMarker

Interactive fold marker in the gutter.

Fields

§rect: Rect

Marker hit/draw area.

§color: Color

Expanded or collapsed marker color.

§region_index: usize

Index into the frame’s fold-region slice.

§collapsed: bool

Whether the represented region is collapsed.

§

ActiveLine

Fill and focus ring for the caret’s visual line.

Fields

§fill_rect: Rect

Line fill area clipped to the text viewport.

§ring_rect: Rect

Ring bounds clipped to the text viewport.

§fill: Color

Line fill color.

§ring: Color

Ring color.

§

Selection

Selection fill for one visual-line segment.

Fields

§rect: Rect

Selected visual segment.

§color: Color

Selection color.

§

SearchHighlight

Search-result fill for one visual-line segment.

Fields

§rect: Rect

Matched visual segment.

§color: Color

Active or inactive match color.

§active: bool

Whether this segment belongs to the active match.

§

DiagnosticUnderline

Two-logical-pixel diagnostic underline.

Fields

§rect: Rect

Underline area.

§color: Color

Severity color.

§active: bool

Whether this diagnostic is active.

§

FoldPlaceholder

Shaped label displayed after a collapsed fold header.

Fields

§pos: [f32; 2]

Baseline origin [x, y].

§color: Color

Label color.

§layout: TextLayoutHandle

Shaped placeholder label.

§

Text

Uniform or syntax-styled text run.

Fields

§pos: [f32; 2]

Baseline origin [x, y].

§color: Color

Base text color for adapters that do not inspect glyph colors.

§layout: TextLayoutHandle

Shaped text layout.

§

Caret

Insertion caret.

Fields

§rect: Rect

Caret rectangle.

§color: Color

Caret color.

§

Scrollbar

Vertical or horizontal scrollbar track and thumb.

Fields

§track_rect: Rect

Complete track bounds.

§thumb_rect: Rect

Scroll-position thumb bounds inside the track.

§track_color: Color

Track fill color.

§thumb_color: Color

Thumb fill color.

§radius: f32

Corner radius in logical pixels.

Trait Implementations§

Source§

impl Clone for EditorPaintItem

Source§

fn clone(&self) -> EditorPaintItem

Returns a copy of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EditorPaintItem

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ErasedDestructor for T
where T: 'static,