pub struct WindowConfig { /* private fields */ }
Expand description
Configuration, adapted for the application and window scale
Implementations§
Source§impl WindowConfig
impl WindowConfig
Sourcepub fn update_base<F: FnOnce(&mut Config)>(&self, f: F) -> Action
pub fn update_base<F: FnOnce(&mut Config)>(&self, f: F) -> Action
Update the base config
Since it is not known which parts of the configuration are updated, all
configuration-update Action
s must be performed.
NOTE: adjusting font settings from a running app is not currently supported, excepting font size.
NOTE: it is assumed that widget state is not affected by config except
(a) state affected by a widget update (e.g. the EventConfig
widget)
and (b) widget size may be affected by font size.
Sourcepub fn event(&self) -> EventWindowConfig<'_>
pub fn event(&self) -> EventWindowConfig<'_>
Access event config
Sourcepub fn update_event<F: FnOnce(&mut EventConfig) -> Action>(
&self,
f: F,
) -> Action
pub fn update_event<F: FnOnce(&mut EventConfig) -> Action>( &self, f: F, ) -> Action
Update event configuration
Sourcepub fn font(&self) -> Ref<'_, FontConfig>
pub fn font(&self) -> Ref<'_, FontConfig>
Access font config
Sourcepub fn set_font_size(&self, pt_size: f32) -> Action
pub fn set_font_size(&self, pt_size: f32) -> Action
Set standard font size
Units: logical (unscaled) pixels per Em.
To convert to Points, multiply by three quarters.
NOTE: this is currently the only supported run-time update to font configuration.
Sourcepub fn theme(&self) -> Ref<'_, ThemeConfig>
pub fn theme(&self) -> Ref<'_, ThemeConfig>
Access theme config
Sourcepub fn update_theme<F: FnOnce(&mut ThemeConfig) -> Action>(
&self,
f: F,
) -> Action
pub fn update_theme<F: FnOnce(&mut ThemeConfig) -> Action>( &self, f: F, ) -> Action
Update theme configuration
Sourcepub fn update_shortcuts<F: FnOnce(&mut Shortcuts)>(&self, f: F) -> Action
pub fn update_shortcuts<F: FnOnce(&mut Shortcuts)>(&self, f: F) -> Action
Adjust shortcuts
Sourcepub fn scale_factor(&self) -> f32
pub fn scale_factor(&self) -> f32
Scale factor
Sourcepub fn change_config(&self, msg: ConfigMsg) -> Action
pub fn change_config(&self, msg: ConfigMsg) -> Action
Update event configuration via a ConfigMsg
Trait Implementations§
Source§impl Clone for WindowConfig
impl Clone for WindowConfig
Source§fn clone(&self) -> WindowConfig
fn clone(&self) -> WindowConfig
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl Freeze for WindowConfig
impl !RefUnwindSafe for WindowConfig
impl !Send for WindowConfig
impl !Sync for WindowConfig
impl Unpin for WindowConfig
impl !UnwindSafe for WindowConfig
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
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
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
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.Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more