Struct CodeTheme

Source
pub struct CodeTheme {
Show 26 fields pub background: Color, pub foreground: Color, pub gutter_bg: Color, pub line_number: Color, pub active_line_number: Color, pub active_line_bg: Color, pub active_line_ring: Color, pub search_match_bg: Color, pub search_active_match_bg: Color, pub diagnostic_error: Color, pub diagnostic_warning: Color, pub diagnostic_info: Color, pub diagnostic_hint: Color, pub diagnostic_active_bg: Color, pub fold_marker: Color, pub fold_marker_active: Color, pub fold_guide: Color, pub syntax_keyword: Color, pub syntax_type: Color, pub syntax_function: Color, pub syntax_string: Color, pub syntax_number: Color, pub syntax_comment: Color, pub syntax_operator: Color, pub syntax_punctuation: Color, pub syntax_identifier: Color,
}
Expand description

Minimal visual theme for the CodeEditor.

Colors are semantic paint inputs and do not affect shaping/cache geometry.

§Examples

use ailloli_ui_editor::CodeTheme;
assert_eq!(CodeTheme::dark(), CodeTheme::default());

Fields§

§background: Color

Main code surface.

§foreground: Color

Default source text.

§gutter_bg: Color

Gutter surface.

§line_number: Color

Inactive line numbers.

§active_line_number: Color

Active line number.

§active_line_bg: Color

Active line fill.

§active_line_ring: Color

Active line focus ring.

§search_match_bg: Color

Inactive search match fill.

§search_active_match_bg: Color

Active search match fill.

§diagnostic_error: Color

Error diagnostic marker/underline.

§diagnostic_warning: Color

Warning diagnostic marker/underline.

§diagnostic_info: Color

Information diagnostic marker/underline.

§diagnostic_hint: Color

Hint diagnostic marker/underline.

§diagnostic_active_bg: Color

Active diagnostic line fill.

§fold_marker: Color

Inactive fold marker.

§fold_marker_active: Color

Active fold marker.

§fold_guide: Color

Fold guide line.

§syntax_keyword: Color

Syntax keyword.

§syntax_type: Color

Syntax type.

§syntax_function: Color

Syntax function.

§syntax_string: Color

Syntax string.

§syntax_number: Color

Syntax numeric literal.

§syntax_comment: Color

Syntax comment.

§syntax_operator: Color

Syntax operator.

§syntax_punctuation: Color

Syntax punctuation.

§syntax_identifier: Color

Syntax identifier/default token.

Implementations§

Source§

impl CodeTheme

Code-theme constructors.

Source

pub fn dark() -> Self

Returns the framework default dark-derived theme.

§Examples
use ailloli_ui_editor::CodeTheme;
assert_eq!(CodeTheme::dark(), CodeTheme::default());
Source

pub fn from_theme(theme: Theme) -> Self

Maps framework palette roles plus fixed syntax accents into code colors.

§Examples
use ailloli_ui_core::Theme;
use ailloli_ui_editor::CodeTheme;
let base = Theme::default();
let code = CodeTheme::from_theme(base);
assert_eq!(code.background, base.palette().background);
assert_eq!(code.foreground, base.palette().text);

Trait Implementations§

Source§

impl Clone for CodeTheme

Source§

fn clone(&self) -> CodeTheme

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 CodeTheme

Source§

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

Formats the value using the given formatter. Read more
Source§

impl Default for CodeTheme

Derives the code palette from [Theme::default].

Source§

fn default() -> Self

Returns the framework-default themed palette.

Source§

impl PartialEq for CodeTheme

Source§

fn eq(&self, other: &CodeTheme) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Copy for CodeTheme

Source§

impl StructuralPartialEq for CodeTheme

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> Brush for T
where T: Clone + PartialEq + Default + Debug,

§

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