pub struct Theme {Show 18 fields
pub dark: bool,
pub accent: Color,
pub glass_tint: f32,
pub adaptive: bool,
pub reduce_transparency: bool,
pub reduce_motion: bool,
pub increase_contrast: bool,
pub regular: Material,
pub clear: Material,
pub thick: Material,
pub lens: Material,
pub blob: Material,
pub blob_labels: Material,
pub control_height: f32,
pub spacing: f32,
pub body_size: f32,
pub caption_size: f32,
pub title_size: f32,
}Expand description
Appearance and accessibility settings. Change them through
Context::theme at any time.
Fields§
§dark: boolDark appearance for content. Small glass elements still switch between light and dark on their own, depending on what is behind them.
accent: ColorColor of prominent buttons, selections and focus rings.
glass_tint: f32How tinted glass is, from 0 (clearest) to 1 (fully tinted). This is
the system wide transparency setting of iOS 27. The material presets
are tuned for Theme::DEFAULT_GLASS_TINT.
adaptive: boolLets small glass elements switch between light and dark with what is behind them.
reduce_transparency: boolMakes glass nearly opaque.
reduce_motion: boolReplaces bouncy springs with short, calm ones and turns off stretching.
increase_contrast: boolStrengthens outlines and edges.
regular: MaterialMaterial of controls and bars.
clear: MaterialMaterial of clear buttons over media.
thick: MaterialMaterial of menus, sheets, windows and panels.
lens: MaterialMaterial of a lifted slider, switch or segment thumb.
blob: MaterialMaterial of the lifted tab bar selection.
blob_labels: MaterialMaterial that bends the tab labels under the lifted selection.
control_height: f32Height of buttons and fields, in points.
spacing: f32Default gap between widgets, in points.
body_size: f32Font size of body text.
caption_size: f32Font size of captions.
title_size: f32Font size of headings.
Implementations§
Source§impl Theme
impl Theme
Sourcepub const DEFAULT_GLASS_TINT: f32 = 0.35
pub const DEFAULT_GLASS_TINT: f32 = 0.35
The default of Theme::glass_tint, between clear and tinted.
Sourcepub fn text_color(&self) -> Color
pub fn text_color(&self) -> Color
Returns the color of text on the window background.
Sourcepub fn background_color(&self) -> Color
pub fn background_color(&self) -> Color
Returns the window background color.
Trait Implementations§
impl StructuralPartialEq for Theme
Auto Trait Implementations§
impl Forget for Theme
impl Freeze for Theme
impl Move for Theme
impl RefUnwindSafe for Theme
impl Send for Theme
impl Sync for Theme
impl Unpin for Theme
impl UnsafeUnpin for Theme
impl UnwindSafe for Theme
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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.