pub struct WindowOptions {Show 22 fields
pub id: WindowId,
pub owner: Option<WindowId>,
pub title: String,
pub visible: bool,
pub size: Size,
pub minimum_size: Option<Size>,
pub maximum_size: Option<Size>,
pub resizable: bool,
pub native_titlebar: bool,
pub position: WindowPosition,
pub transparent: bool,
pub corner_radius: i32,
pub topmost: bool,
pub hide_on_deactivate: bool,
pub background_memory_optimization: bool,
pub titlebar_drag_height: Option<f32>,
pub drag_exclusion: Option<WindowDragExclusion>,
pub scale_reference_size: Option<Size>,
pub scale_preference: ScalePreference,
pub mode: WindowMode,
pub close_policy: ClosePolicy,
pub close_handler: Option<WindowCloseHandler>,
/* private fields */
}Fields§
§id: WindowId§owner: Option<WindowId>§title: String§visible: bool§size: Size§minimum_size: Option<Size>§maximum_size: Option<Size>§resizable: bool§native_titlebar: bool§position: WindowPosition§transparent: bool§corner_radius: i32§topmost: bool§hide_on_deactivate: bool§background_memory_optimization: bool§titlebar_drag_height: Option<f32>COMPATIBILITY: remove after consumers migrate to Element::window_drag_region.
drag_exclusion: Option<WindowDragExclusion>COMPATIBILITY: remove after consumers migrate to Element::window_drag_region.
scale_reference_size: Option<Size>§scale_preference: ScalePreference§mode: WindowMode§close_policy: ClosePolicy§close_handler: Option<WindowCloseHandler>Implementations§
Source§impl WindowOptions
impl WindowOptions
pub fn new(id: impl Into<WindowId>) -> Self
pub fn title(self, title: impl Into<String>) -> Self
pub fn visible(self, visible: bool) -> Self
pub fn owner(self, owner: impl Into<WindowId>) -> Self
pub fn size(self, size: Size) -> Self
pub fn minimum_size(self, size: Size) -> Self
pub fn maximum_size(self, size: Size) -> Self
pub fn resizable(self, resizable: bool) -> Self
pub fn native_titlebar(self, enabled: bool) -> Self
pub fn position(self, position: WindowPosition) -> Self
pub fn transparent(self, transparent: bool) -> Self
pub fn corner_radius(self, radius: i32) -> Self
pub fn topmost(self, topmost: bool) -> Self
pub fn hide_on_deactivate(self, hide: bool) -> Self
Sourcepub fn background_memory_optimization(self, enabled: bool) -> Self
pub fn background_memory_optimization(self, enabled: bool) -> Self
Releases reconstructible render state while hidden. When all top-level windows are hidden, shared caches and the process working set are also trimmed. Component state, effects and background tasks remain alive.
pub fn titlebar_drag( self, height: f32, exclusion: Option<WindowDragExclusion>, ) -> Self
👎Deprecated:
geometry-based titlebar drag is a compatibility path; migrate immediately to Element::window_drag_region
pub fn scale_reference_size(self, size: Size) -> Self
pub fn scale_preference(self, preference: ScalePreference) -> Self
pub fn mode(self, mode: WindowMode) -> Self
pub fn close_policy(self, policy: ClosePolicy) -> Self
pub fn on_close_requested(self, handler: WindowCloseHandler) -> Self
pub fn with_platform_options<T>(self, options: T) -> Self
pub fn platform_options<T>(&self) -> Option<&T>
Trait Implementations§
Source§impl Clone for WindowOptions
impl Clone for WindowOptions
Source§fn clone(&self) -> WindowOptions
fn clone(&self) -> WindowOptions
Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WindowOptions
impl Debug for WindowOptions
Auto Trait Implementations§
impl !RefUnwindSafe for WindowOptions
impl !UnwindSafe for WindowOptions
impl Freeze for WindowOptions
impl Send for WindowOptions
impl Sync for WindowOptions
impl Unpin for WindowOptions
impl UnsafeUnpin 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
Mutably borrows from an owned value. Read more