MultiTheme

Struct MultiTheme 

Source
pub struct MultiTheme<DS> { /* private fields */ }
Expand description

Wrapper around mutliple themes, supporting run-time switching

Implementations§

Source§

impl<DS> MultiTheme<DS>

Source

pub fn builder() -> MultiThemeBuilder<DS>

Construct with builder pattern

Trait Implementations§

Source§

impl<DS: DrawSharedImpl> Theme<DS> for MultiTheme<DS>

Source§

type Config = Config

The associated config type
Source§

type Window = Box<dyn Window>

The associated Window implementation.
Source§

type Draw<'a> = Box<dyn ThemeDraw + 'a>

The associated [ThemeDraw] implementation.
Source§

fn config(&self) -> Cow<'_, Self::Config>

Get current configuration
Source§

fn apply_config(&mut self, config: &Self::Config) -> TkAction

Apply/set the passed config
Source§

fn init(&mut self, shared: &mut SharedState<DS>)

Theme initialisation Read more
Source§

fn new_window(&self, dpi_factor: f32) -> Self::Window

Construct per-window storage Read more
Source§

fn update_window(&self, window: &mut Self::Window, dpi_factor: f32)

Update a window created by Theme::new_window Read more
Source§

fn draw<'a>( &'a self, draw: DrawIface<'a, DS>, ev: &'a mut EventState, window: &'a mut Self::Window, ) -> Box<dyn ThemeDraw + 'a>

Prepare to draw and construct a [ThemeDraw] object Read more
Source§

fn clear_color(&self) -> Rgba

Background colour
Source§

impl<DS> ThemeControl for MultiTheme<DS>

Source§

fn set_font_size(&mut self, size: f32) -> TkAction

Set font size Read more
Source§

fn set_scheme(&mut self, scheme: &str) -> TkAction

Change the colour scheme Read more
Source§

fn list_schemes(&self) -> Vec<&str>

List available colour schemes
Source§

fn set_theme(&mut self, theme: &str) -> TkAction

Switch the theme Read more

Auto Trait Implementations§

§

impl<DS> Freeze for MultiTheme<DS>

§

impl<DS> !RefUnwindSafe for MultiTheme<DS>

§

impl<DS> !Send for MultiTheme<DS>

§

impl<DS> !Sync for MultiTheme<DS>

§

impl<DS> Unpin for MultiTheme<DS>

§

impl<DS> !UnwindSafe for MultiTheme<DS>

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<S, T> Cast<T> for S
where T: Conv<S>,

Source§

fn cast(self) -> T

Cast from Self to T Read more
Source§

fn try_cast(self) -> Result<T, Error>

Try converting from Self to T Read more
Source§

impl<S, T> CastApprox<T> for S
where T: ConvApprox<S>,

Source§

fn try_cast_approx(self) -> Result<T, Error>

Try approximate conversion from Self to T Read more
Source§

fn cast_approx(self) -> T

Cast approximately from Self to T Read more
Source§

impl<S, T> CastFloat<T> for S
where T: ConvFloat<S>,

Source§

fn cast_trunc(self) -> T

Cast to integer, truncating Read more
Source§

fn cast_nearest(self) -> T

Cast to the nearest integer Read more
Source§

fn cast_floor(self) -> T

Cast the floor to an integer Read more
Source§

fn cast_ceil(self) -> T

Cast the ceiling to an integer Read more
Source§

fn try_cast_trunc(self) -> Result<T, Error>

Try converting to integer with truncation Read more
Source§

fn try_cast_nearest(self) -> Result<T, Error>

Try converting to the nearest integer Read more
Source§

fn try_cast_floor(self) -> Result<T, Error>

Try converting the floor to an integer Read more
Source§

fn try_cast_ceil(self) -> Result<T, Error>

Try convert the ceiling to an integer 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<DS, T> ThemeDst<DS> for T
where DS: DrawSharedImpl, T: Theme<DS>,

Source§

fn config(&self) -> MaybeBoxed<'_, dyn Any + 'static>

Get current configuration
Source§

fn apply_config(&mut self, config: &(dyn Any + 'static)) -> TkAction

Apply/set the passed config
Source§

fn init(&mut self, shared: &mut SharedState<DS>)

Theme initialisation Read more
Source§

fn new_window(&self, dpi_factor: f32) -> Box<dyn Window>

Construct per-window storage Read more
Source§

fn update_window(&self, window: &mut (dyn Window + 'static), dpi_factor: f32)

Update a window created by Theme::new_window Read more
Source§

fn draw<'b>( &'b self, draw: DrawIface<'b, DS>, ev: &'b mut EventState, window: &'b mut (dyn Window + 'static), ) -> Box<dyn ThemeDraw + 'b>

Source§

fn clear_color(&self) -> Rgba

Background colour 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.