pub struct WindowOptions {
pub size: (u32, u32),
pub title: String,
pub clear: Color,
pub maximized: bool,
pub frameless: bool,
pub start_position: Option<(i32, i32)>,
pub on_close_state: Option<Box<dyn FnOnce(WindowGeometry) + Send>>,
pub menubar: Option<MenuModel>,
}Expand description
Everything a window backend needs to open the app’s window.
Fields§
§size: (u32, u32)Initial window inner size in logical pixels.
title: StringWindow title.
clear: ColorBackground clear color (writes crate::render_world::Viewport::clear
on init). See DEFAULT_CLEAR for the fallback this defaults to.
maximized: boolMaximize the window on launch. Useful for full-bleed app demos.
frameless: boolSuppress OS window chrome (title bar, borders, close/min/max
buttons). Custom title bars and per-platform window drag must
be implemented inside the app - see the <title-bar drag>
region (TODO S31).
start_position: Option<(i32, i32)>Initial outer position in physical pixels. None lets the OS
place the window (the default). Wired up so callers can
restore the last-known window position from disk (P1.3).
on_close_state: Option<Box<dyn FnOnce(WindowGeometry) + Send>>Callback invoked once per close with the current window
position, inner size (logical), and maximized flag. None
(the default) disables state persistence. Implementations
typically serialise to disk via
lumenc::window_state::save.
Optional native menu bar spec. Built by the embedder from
the markup <menubar> element. None = no menu bar.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowOptions
impl !RefUnwindSafe for WindowOptions
impl Send for WindowOptions
impl !Sync for WindowOptions
impl Unpin for WindowOptions
impl UnsafeUnpin for WindowOptions
impl !UnwindSafe for WindowOptions
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<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().