pub struct WindowConfig {Show 18 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,
}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: PresentModeSwapchain presentation mode (Immediate / Mailbox for uncapped 3D viewports, Fifo default).
Implementations§
Source§impl WindowConfig
impl WindowConfig
Sourcepub fn with_present_mode(self, present_mode: PresentMode) -> Self
pub fn with_present_mode(self, present_mode: PresentMode) -> Self
Sets swapchain present mode (e.g. PresentMode::Immediate for uncapped framerate).
Sourcepub fn with_single_instance(self, app_id: impl Into<String>) -> Self
pub fn with_single_instance(self, app_id: impl Into<String>) -> Self
Configures the window to enforce a single-instance mutex and focus existing instance on launch.
Sourcepub fn with_vibrancy(self, vibrancy: VibrancyEffect) -> Self
pub fn with_vibrancy(self, vibrancy: VibrancyEffect) -> Self
Configures window backdrop blur and vibrancy (Mica, Acrylic, NSVisualEffectView).
Sourcepub fn with_anchor(self, anchor: WindowAnchor) -> Self
pub fn with_anchor(self, anchor: WindowAnchor) -> Self
Configures monitor workarea placement or corner docking for this window.
Sourcepub fn with_dock_bottom_right(self, dock_bottom_right: bool) -> Self
pub fn with_dock_bottom_right(self, dock_bottom_right: bool) -> Self
Pins the window to the bottom-right corner of the primary monitor’s workarea (“stuck” mode).
Sourcepub const fn effective_anchor(&self) -> Option<WindowAnchor>
pub const fn effective_anchor(&self) -> Option<WindowAnchor>
Resolves the effective window anchor, honoring both anchor and dock_bottom_right.
Trait Implementations§
Source§impl Clone for WindowConfig
impl Clone for WindowConfig
Source§impl Debug for WindowConfig
impl Debug for WindowConfig
Auto Trait Implementations§
impl Forget for WindowConfig
impl Freeze for WindowConfig
impl Move for WindowConfig
impl RefUnwindSafe for WindowConfig
impl Send for WindowConfig
impl Sync for WindowConfig
impl Unpin for WindowConfig
impl UnsafeUnpin for WindowConfig
impl UnwindSafe for WindowConfig
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
Mutably borrows from an owned value. Read more