pub struct LayoutCallbackInfo {
pub window_size: WindowSize,
pub theme: WindowTheme,
pub relayout_reason: RelayoutReason,
/* 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
relayout_reason: RelayoutReasonWhat triggered this layout() call. Read via relayout_reason().
Implementations§
Source§impl LayoutCallbackInfo
impl LayoutCallbackInfo
pub fn new<'a>( ref_data: &'a LayoutCallbackInfoRefData<'a>, window_size: WindowSize, theme: WindowTheme, ) -> Self
pub fn new_with_reason<'a>( ref_data: &'a LayoutCallbackInfoRefData<'a>, window_size: WindowSize, theme: WindowTheme, relayout_reason: RelayoutReason, ) -> Self
Sourcepub fn relayout_reason(&self) -> RelayoutReason
pub fn relayout_reason(&self) -> RelayoutReason
Returns what triggered the current layout() invocation.
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 get_active_route(&self) -> Option<&RouteMatch>
pub fn get_active_route(&self) -> Option<&RouteMatch>
Get the active route match (pattern + extracted parameters).
Returns None if no routes are configured or no route is active.
Sourcepub fn get_route_param(&self, key: &str) -> Option<&AzString>
pub fn get_route_param(&self, key: &str) -> Option<&AzString>
Get a route parameter by key (e.g. get_route_param("id") for /user/:id).
Returns None if no route is active or the parameter doesn’t exist.
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 scale factor (1.0 = 96 DPI, 2.0 = 192 DPI)