pub struct Style {Show 15 fields
pub background: Color,
pub text_color: Color,
pub gutter_background: Color,
pub gutter_border: Color,
pub line_number_color: Color,
pub scrollbar_background: Color,
pub scroller_color: Color,
pub current_line_highlight: Color,
pub whitespace_color: Color,
pub indent_guide_color: Color,
pub search_match_color: Color,
pub search_match_current_color: Color,
pub selection_color: Color,
pub bracket_match_color: Color,
pub ime_preedit_background_color: Color,
}Expand description
The appearance of a code editor.
Build one with from_iced_theme to follow the application’s Iced theme,
then override individual fields for anything that needs to differ.
§Examples
use iced_code_editor::{CodeEditor, theme};
let mut style = theme::from_iced_theme(&iced::Theme::TokyoNightStorm);
// Tweak one color while keeping the rest of the derived palette.
style.current_line_highlight = iced::Color::from_rgba(1.0, 1.0, 1.0, 0.05);
let mut editor = CodeEditor::new("fn main() {}", "rs");
editor.set_theme(style);Fields§
§background: ColorMain editor background color
text_color: ColorText content color
gutter_background: ColorLine numbers gutter background color
gutter_border: ColorBorder color for the gutter
line_number_color: ColorColor for line numbers text
scrollbar_background: ColorScrollbar background color
scroller_color: ColorScrollbar scroller (thumb) color
current_line_highlight: ColorHighlight color for the current line where cursor is located
whitespace_color: ColorColor for visible whitespace characters (spaces as ·, tabs as →)
indent_guide_color: ColorColor of the vertical indentation guides drawn behind the text
search_match_color: ColorHighlight fill color for non-current search matches
search_match_current_color: ColorHighlight fill color for the currently active search match
selection_color: ColorFill color for text selection ranges
bracket_match_color: ColorFill color used to highlight a matching bracket pair
ime_preedit_background_color: ColorBackground fill color for the IME preedit (composition) region
Trait Implementations§
Auto Trait Implementations§
impl Freeze for Style
impl RefUnwindSafe for Style
impl Send for Style
impl Sync for Style
impl Unpin for Style
impl UnsafeUnpin for Style
impl UnwindSafe for Style
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,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<State, Message> IntoBoot<State, Message> for State
impl<State, Message> IntoBoot<State, Message> for State
Source§fn into_boot(self) -> (State, Task<Message>)
fn into_boot(self) -> (State, Task<Message>)
Application.Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more