Struct CodeTheme
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: ColorMain code surface.
foreground: ColorDefault source text.
gutter_bg: ColorGutter surface.
line_number: ColorInactive line numbers.
active_line_number: ColorActive line number.
active_line_bg: ColorActive line fill.
active_line_ring: ColorActive line focus ring.
search_match_bg: ColorInactive search match fill.
search_active_match_bg: ColorActive search match fill.
diagnostic_error: ColorError diagnostic marker/underline.
diagnostic_warning: ColorWarning diagnostic marker/underline.
diagnostic_info: ColorInformation diagnostic marker/underline.
diagnostic_hint: ColorHint diagnostic marker/underline.
diagnostic_active_bg: ColorActive diagnostic line fill.
fold_marker: ColorInactive fold marker.
fold_marker_active: ColorActive fold marker.
fold_guide: ColorFold guide line.
syntax_keyword: ColorSyntax keyword.
syntax_type: ColorSyntax type.
syntax_function: ColorSyntax function.
syntax_string: ColorSyntax string.
syntax_number: ColorSyntax numeric literal.
syntax_comment: ColorSyntax comment.
syntax_operator: ColorSyntax operator.
syntax_punctuation: ColorSyntax punctuation.
syntax_identifier: ColorSyntax identifier/default token.
Implementations§
§impl CodeTheme
Code-theme constructors.
impl CodeTheme
Code-theme constructors.
pub fn dark() -> CodeTheme
pub fn dark() -> CodeTheme
Returns the framework default dark-derived theme.
§Examples
use ailloli_ui_editor::CodeTheme;
assert_eq!(CodeTheme::dark(), CodeTheme::default());pub fn from_theme(theme: Theme) -> CodeTheme
pub fn from_theme(theme: Theme) -> CodeTheme
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§
impl Copy for CodeTheme
impl StructuralPartialEq for CodeTheme
Auto Trait Implementations§
impl Freeze for CodeTheme
impl RefUnwindSafe for CodeTheme
impl Send for CodeTheme
impl Sync for CodeTheme
impl Unpin for CodeTheme
impl UnwindSafe for CodeTheme
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
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.