pub struct SimpleTheme { /* private fields */ }Expand description
A simple theme
Implementations§
Source§impl SimpleTheme
impl SimpleTheme
Sourcepub fn with_font_size(self, pt_size: f32) -> Self
pub fn with_font_size(self, pt_size: f32) -> Self
Set font size
Units: Points per Em (standard unit of font size)
Sourcepub fn with_colours(self, name: &str) -> Self
pub fn with_colours(self, name: &str) -> Self
Set the colour scheme
If no scheme by this name is found the scheme is left unchanged.
pub fn set_colors(&mut self, cols: ColorsLinear) -> TkAction
Trait Implementations§
Source§impl Clone for SimpleTheme
impl Clone for SimpleTheme
Source§fn clone(&self) -> SimpleTheme
fn clone(&self) -> SimpleTheme
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SimpleTheme
impl Debug for SimpleTheme
Source§impl Default for SimpleTheme
impl Default for SimpleTheme
Source§impl<DS: DrawSharedImpl> Theme<DS> for SimpleThemewhere
DS::Draw: DrawRoundedImpl,
impl<DS: DrawSharedImpl> Theme<DS> for SimpleThemewhere
DS::Draw: DrawRoundedImpl,
Source§fn apply_config(&mut self, config: &Self::Config) -> TkAction
fn apply_config(&mut self, config: &Self::Config) -> TkAction
Apply/set the passed config
Source§fn init(&mut self, _shared: &mut SharedState<DS>)
fn init(&mut self, _shared: &mut SharedState<DS>)
Theme initialisation Read more
Source§fn update_window(&self, w: &mut Self::Window, dpi_factor: f32)
fn update_window(&self, w: &mut Self::Window, dpi_factor: f32)
Update a window created by
Theme::new_window Read moreSource§fn draw<'a>(
&'a self,
draw: DrawIface<'a, DS>,
ev: &'a mut EventState,
w: &'a mut Self::Window,
) -> Self::Draw<'a>
fn draw<'a>( &'a self, draw: DrawIface<'a, DS>, ev: &'a mut EventState, w: &'a mut Self::Window, ) -> Self::Draw<'a>
Prepare to draw and construct a [
ThemeDraw] object Read moreSource§fn clear_color(&self) -> Rgba
fn clear_color(&self) -> Rgba
Background colour
Source§impl ThemeControl for SimpleTheme
impl ThemeControl for SimpleTheme
Source§fn list_schemes(&self) -> Vec<&str>
fn list_schemes(&self) -> Vec<&str>
List available colour schemes
Auto Trait Implementations§
impl Freeze for SimpleTheme
impl RefUnwindSafe for SimpleTheme
impl !Send for SimpleTheme
impl !Sync for SimpleTheme
impl Unpin for SimpleTheme
impl UnwindSafe for SimpleTheme
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
Mutably borrows from an owned value. Read more
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
Cast to integer, truncating Read more
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Cast to the nearest integer Read more
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Cast the floor to an integer Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<DS, T> ThemeDst<DS> for Twhere
DS: DrawSharedImpl,
T: Theme<DS>,
impl<DS, T> ThemeDst<DS> for Twhere
DS: DrawSharedImpl,
T: Theme<DS>,
Source§fn config(&self) -> MaybeBoxed<'_, dyn Any + 'static>
fn config(&self) -> MaybeBoxed<'_, dyn Any + 'static>
Get current configuration
Source§fn apply_config(&mut self, config: &(dyn Any + 'static)) -> TkAction
fn apply_config(&mut self, config: &(dyn Any + 'static)) -> TkAction
Apply/set the passed config
Source§fn init(&mut self, shared: &mut SharedState<DS>)
fn init(&mut self, shared: &mut SharedState<DS>)
Theme initialisation Read more
Source§fn new_window(&self, dpi_factor: f32) -> Box<dyn Window>
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)
fn update_window(&self, window: &mut (dyn Window + 'static), dpi_factor: f32)
Update a window created by
Theme::new_window Read morefn 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
fn clear_color(&self) -> Rgba
Background colour Read more