pub struct LayoutCallbackInfo {
pub window_size: WindowSize,
pub theme: WindowTheme,
/* private fields */
}Fields§
§window_size: WindowSizeWindow size (so that apps can return a different UI depending on the window size - mobile / desktop view). Should be later removed in favor of “resize” handlers and @media queries.
theme: WindowThemeRegisters whether the UI is dependent on the window theme
Implementations§
Source§impl LayoutCallbackInfo
impl LayoutCallbackInfo
pub fn new<'a>( ref_data: &'a LayoutCallbackInfoRefData<'a>, window_size: WindowSize, theme: WindowTheme, ) -> Self
Sourcepub fn set_callable_ptr(&mut self, callable: &OptionRefAny)
pub fn set_callable_ptr(&mut self, callable: &OptionRefAny)
Set the callable pointer for FFI language bindings
Sourcepub fn get_ctx(&self) -> OptionRefAny
pub fn get_ctx(&self) -> OptionRefAny
Get the callable for FFI language bindings (Python, etc.)
Sourcepub fn get_system_style(&self) -> Arc<SystemStyle>
pub fn get_system_style(&self) -> Arc<SystemStyle>
Get a clone of the system style Arc
pub fn get_gl_context(&self) -> OptionGlContextPtr
pub fn get_system_fonts(&self) -> Vec<AzStringPair>
pub fn get_image(&self, image_id: &AzString) -> Option<ImageRef>
Sourcepub fn window_width_less_than(&self, px: f32) -> bool
pub fn window_width_less_than(&self, px: f32) -> bool
Returns true if the window width is less than the given pixel value
Sourcepub fn window_width_greater_than(&self, px: f32) -> bool
pub fn window_width_greater_than(&self, px: f32) -> bool
Returns true if the window width is greater than the given pixel value
Sourcepub fn window_width_between(&self, min_px: f32, max_px: f32) -> bool
pub fn window_width_between(&self, min_px: f32, max_px: f32) -> bool
Returns true if the window width is between min and max (inclusive)
Sourcepub fn window_height_less_than(&self, px: f32) -> bool
pub fn window_height_less_than(&self, px: f32) -> bool
Returns true if the window height is less than the given pixel value
Sourcepub fn window_height_greater_than(&self, px: f32) -> bool
pub fn window_height_greater_than(&self, px: f32) -> bool
Returns true if the window height is greater than the given pixel value
Sourcepub fn window_height_between(&self, min_px: f32, max_px: f32) -> bool
pub fn window_height_between(&self, min_px: f32, max_px: f32) -> bool
Returns true if the window height is between min and max (inclusive)
Sourcepub fn get_window_width(&self) -> f32
pub fn get_window_width(&self) -> f32
Returns the current window width in pixels
Sourcepub fn get_window_height(&self) -> f32
pub fn get_window_height(&self) -> f32
Returns the current window height in pixels
Sourcepub fn get_dpi_factor(&self) -> f32
pub fn get_dpi_factor(&self) -> f32
Returns the current window DPI factor
Trait Implementations§
Source§impl Clone for LayoutCallbackInfo
impl Clone for LayoutCallbackInfo
Auto Trait Implementations§
impl Freeze for LayoutCallbackInfo
impl RefUnwindSafe for LayoutCallbackInfo
impl !Send for LayoutCallbackInfo
impl !Sync for LayoutCallbackInfo
impl Unpin for LayoutCallbackInfo
impl UnwindSafe for LayoutCallbackInfo
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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