Trait kas_theme::ThemeDst [−][src]
pub trait ThemeDst<DS: DrawSharedImpl>: ThemeApi { 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) -> StackDst<dyn Window>; fn update_window(&self, window: &mut dyn Window, dpi_factor: f32); unsafe fn draw_handle(
&self,
draw: DrawIface<'_, DS>,
window: &mut dyn Window
) -> StackDst<dyn DrawHandle>; fn clear_color(&self) -> Rgba; }
This is supported on crate feature
stack_dst
only.Expand description
Required methods
fn config(&self) -> MaybeBoxed<'_, dyn Any>
fn config(&self) -> MaybeBoxed<'_, dyn Any>
Get current config
fn apply_config(&mut self, config: &dyn Any) -> TkAction
fn apply_config(&mut self, config: &dyn Any) -> TkAction
Apply/set the passed config
fn init(&mut self, shared: &mut SharedState<DS>)
fn init(&mut self, shared: &mut SharedState<DS>)
Theme initialisation
See also Theme::init
.
fn new_window(&self, dpi_factor: f32) -> StackDst<dyn Window>
fn new_window(&self, dpi_factor: f32) -> StackDst<dyn Window>
Construct per-window storage
Uses a StackDst
to avoid requiring an associated type.
See also Theme::new_window
.
fn update_window(&self, window: &mut dyn Window, dpi_factor: f32)
fn update_window(&self, window: &mut dyn Window, dpi_factor: f32)
Update a window created by Theme::new_window
See also Theme::update_window
.
unsafe fn draw_handle(
&self,
draw: DrawIface<'_, DS>,
window: &mut dyn Window
) -> StackDst<dyn DrawHandle>
unsafe fn draw_handle(
&self,
draw: DrawIface<'_, DS>,
window: &mut dyn Window
) -> StackDst<dyn DrawHandle>
Construct a DrawHandle
object
Uses a StackDst
to avoid requiring an associated type.
See also Theme::draw_handle
.
Safety
All references passed into the method must outlive the returned object.
fn clear_color(&self) -> Rgba
fn clear_color(&self) -> Rgba
Background colour
See also Theme::clear_color
.