ThemeDst

Trait ThemeDst 

Source
pub trait ThemeDst<DS: DrawSharedImpl>: ThemeControl {
    // Required methods
    fn config(&self) -> MaybeBoxed<'_, dyn Any>;
    fn apply_config(&mut self, config: &dyn Any) -> TkAction;
    fn init(&mut self, shared: &mut SharedState<DS>);
    fn new_window(&self, dpi_factor: f32) -> Box<dyn Window>;
    fn update_window(&self, window: &mut dyn Window, dpi_factor: f32);
    fn draw<'a>(
        &'a self,
        draw: DrawIface<'a, DS>,
        ev: &'a mut EventState,
        window: &'a mut dyn Window,
    ) -> Box<dyn ThemeDraw + 'a>;
    fn clear_color(&self) -> Rgba;
}
Expand description

As Theme, but without associated types

This trait is implemented automatically for all implementations of Theme. It is intended only for use where a less parameterised trait is required.

Required Methods§

Source

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

Get current configuration

Source

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

Apply/set the passed config

Source

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

Theme initialisation

See also Theme::init.

Source

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

Construct per-window storage

See also Theme::new_window.

Source

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

Update a window created by Theme::new_window

See also Theme::update_window.

Source

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

Source

fn clear_color(&self) -> Rgba

Background colour

See also Theme::clear_color.

Implementors§

Source§

impl<DS: DrawSharedImpl, T: Theme<DS>> ThemeDst<DS> for T