pub struct ThemeConfig {
pub active_theme: String,
pub active_scheme: String,
pub color_schemes: BTreeMap<String, ColorsSrgb>,
pub cursor_blink_rate_ms: u32,
pub transition_fade_ms: u32,
}
Expand description
Event handling configuration
Fields§
§active_theme: String
The theme to use (used by MultiTheme
)
active_scheme: String
The colour scheme to use
color_schemes: BTreeMap<String, ColorsSrgb>
All colour schemes
TODO: possibly we should not save default schemes and merge when
loading (perhaps via a PartialConfig
type).
cursor_blink_rate_ms: u32
Text cursor blink rate: delay between switching states
transition_fade_ms: u32
Transition duration used in animations
Implementations§
Source§impl ThemeConfig
impl ThemeConfig
Sourcepub fn set_active_theme(&mut self, theme: impl ToString) -> Action
pub fn set_active_theme(&mut self, theme: impl ToString) -> Action
Set the active theme (by name)
Only does anything if MultiTheme
(or another multiplexer) is in use
and knows this theme.
Sourcepub fn active_scheme(&self) -> &str
pub fn active_scheme(&self) -> &str
Active colour scheme (name)
An empty string will resolve the default colour scheme.
Sourcepub fn set_active_scheme(&mut self, scheme: impl ToString) -> Action
pub fn set_active_scheme(&mut self, scheme: impl ToString) -> Action
Set the active colour scheme (by name)
Does nothing if the named scheme is not found.
Sourcepub fn color_schemes(&self) -> impl Iterator<Item = (&str, &ColorsSrgb)>
pub fn color_schemes(&self) -> impl Iterator<Item = (&str, &ColorsSrgb)>
Iterate over all colour schemes
Sourcepub fn get_color_scheme(&self, name: &str) -> Option<&ColorsSrgb>
pub fn get_color_scheme(&self, name: &str) -> Option<&ColorsSrgb>
Get a colour scheme by name
Sourcepub fn get_active_scheme(&self) -> &ColorsSrgb
pub fn get_active_scheme(&self) -> &ColorsSrgb
Get the active colour scheme
Sourcepub fn add_scheme(
&mut self,
scheme: impl ToString,
colors: ColorsSrgb,
) -> Action
pub fn add_scheme( &mut self, scheme: impl ToString, colors: ColorsSrgb, ) -> Action
Add or update a colour scheme
Sourcepub fn remove_scheme(&mut self, scheme: &str) -> Action
pub fn remove_scheme(&mut self, scheme: &str) -> Action
Remove a colour scheme
Sourcepub fn cursor_blink_rate(&self) -> Duration
pub fn cursor_blink_rate(&self) -> Duration
Get the cursor blink rate (delay)
Sourcepub fn transition_fade_duration(&self) -> Duration
pub fn transition_fade_duration(&self) -> Duration
Get the fade duration used in transition animations
Trait Implementations§
Source§impl Clone for ThemeConfig
impl Clone for ThemeConfig
Source§fn clone(&self) -> ThemeConfig
fn clone(&self) -> ThemeConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl Debug for ThemeConfig
impl Debug for ThemeConfig
Source§impl Default for ThemeConfig
impl Default for ThemeConfig
Source§impl<'de> Deserialize<'de> for ThemeConfig
impl<'de> Deserialize<'de> for ThemeConfig
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ThemeConfig
impl PartialEq for ThemeConfig
Source§impl Serialize for ThemeConfig
impl Serialize for ThemeConfig
impl StructuralPartialEq for ThemeConfig
Auto Trait Implementations§
impl Freeze for ThemeConfig
impl RefUnwindSafe for ThemeConfig
impl Send for ThemeConfig
impl Sync for ThemeConfig
impl Unpin for ThemeConfig
impl UnwindSafe for ThemeConfig
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<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> 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<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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
ReadEndian::read_from_little_endian()
.