Skip to main content

WindowOptions

Struct WindowOptions 

Source
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: String

Window title.

§clear: Color

Background clear color (writes crate::render_world::Viewport::clear on init). See DEFAULT_CLEAR for the fallback this defaults to.

§maximized: bool

Maximize the window on launch. Useful for full-bleed app demos.

§frameless: bool

Suppress 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.

§menubar: Option<MenuModel>

Optional native menu bar spec. Built by the embedder from the markup <menubar> element. None = no menu bar.

Trait Implementations§

Source§

impl Default for WindowOptions

Source§

fn default() -> Self

Returns the “default value” for a type. Read more

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T> FromWorld for T
where T: Default,

§

fn from_world(_world: &mut World) -> T

Creates Self using default().

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> IntoResult<T> for T

§

fn into_result(self) -> Result<T, RunSystemError>

Converts this type into the system output type.
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<T> ConditionalSend for T
where T: Send,