Skip to main content

WindowConfig

Struct WindowConfig 

Source
pub struct WindowConfig {
Show 20 fields pub title: String, pub width: u32, pub height: u32, pub min_width: Option<u32>, pub min_height: Option<u32>, pub max_width: Option<u32>, pub max_height: Option<u32>, pub resizable: bool, pub mode: WindowMode, pub decoration: WindowDecoration, pub theme: ThemeMode, pub transparent: bool, pub always_on_top: bool, pub anchor: Option<WindowAnchor>, pub dock_bottom_right: bool, pub single_instance_id: Option<String>, pub vibrancy: VibrancyEffect, pub present_mode: PresentMode, pub tooltip_delay: Duration, pub tooltip_style: HoverTooltipStyle,
}
Expand description

Configuration used when creating or reconfiguring a platform window.

Fields§

§title: String§width: u32§height: u32§min_width: Option<u32>§min_height: Option<u32>§max_width: Option<u32>§max_height: Option<u32>§resizable: bool§mode: WindowMode§decoration: WindowDecoration§theme: ThemeMode§transparent: bool§always_on_top: bool§anchor: Option<WindowAnchor>§dock_bottom_right: bool§single_instance_id: Option<String>§vibrancy: VibrancyEffect§present_mode: PresentMode

Swapchain presentation mode (Immediate / Mailbox for uncapped 3D viewports, Fifo default).

§tooltip_delay: Duration

Pointer dwell delay before native hover tooltips (title / alt) become visible.

§tooltip_style: HoverTooltipStyle

Visual styling and offset configuration for native hover tooltips.

Implementations§

Source§

impl WindowConfig

Source

pub fn with_present_mode(self, present_mode: PresentMode) -> WindowConfig

Sets swapchain present mode (e.g. PresentMode::Immediate for uncapped framerate).

Source

pub fn with_tooltip_delay(self, delay: Duration) -> WindowConfig

Configures the dwell delay before native hover tooltips become visible.

Source

pub fn with_tooltip_delay_ms(self, delay_ms: u64) -> WindowConfig

Configures the dwell delay in milliseconds before native hover tooltips become visible.

Source

pub fn with_tooltip_style(self, style: HoverTooltipStyle) -> WindowConfig

Configures visual styling and offset for native hover tooltips.

Source

pub fn with_single_instance(self, app_id: impl Into<String>) -> WindowConfig

Configures the window to enforce a single-instance mutex and focus existing instance on launch.

Source

pub fn with_vibrancy(self, vibrancy: VibrancyEffect) -> WindowConfig

Configures window backdrop blur and vibrancy (Mica, Acrylic, NSVisualEffectView).

Source

pub fn with_anchor(self, anchor: WindowAnchor) -> WindowConfig

Configures monitor workarea placement or corner docking for this window.

Source

pub fn with_dock_bottom_right(self, dock_bottom_right: bool) -> WindowConfig

Pins the window to the bottom-right corner of the primary monitor’s workarea (“stuck” mode).

Source

pub const fn effective_anchor(&self) -> Option<WindowAnchor>

Resolves the effective window anchor, honoring both anchor and dock_bottom_right.

Source

pub const fn is_docked(&self) -> bool

Returns true when the window is docked (“stuck”) to a monitor workarea corner.

Source

pub const fn compute_anchored_position( &self, workarea_x: i32, workarea_y: i32, workarea_w: i32, workarea_h: i32, ) -> Option<(i32, i32)>

Computes target (x, y) coordinates in the given monitor workarea if an anchor is configured.

Trait Implementations§

Source§

impl Clone for WindowConfig

Source§

fn clone(&self) -> WindowConfig

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for WindowConfig

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl Default for WindowConfig

Source§

fn default() -> WindowConfig

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> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> Downcast<T> for T

Source§

fn downcast(&self) -> &T

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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.

Source§

impl<T> IntoInitialState<T> for T

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.
Source§

impl<T> Upcast<T> for T

Source§

fn upcast(&self) -> Option<&T>

Source§

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

Source§

impl<T> WasmNotSendSync for T

Source§

impl<T> WasmNotSync for T
where T: Sync,