pub struct WindowCreationOptions { /* private fields */ }Expand description
Options used during the creation of a window.
Implementations§
Source§impl WindowCreationOptions
impl WindowCreationOptions
Sourcepub fn new_windowed(size: WindowSize, position: Option<WindowPosition>) -> Self
pub fn new_windowed(size: WindowSize, position: Option<WindowPosition>) -> Self
Instantiates a new WindowCreationOptions structure with the default
options, in non-fullscreen mode.
Sourcepub fn new_fullscreen_borderless() -> Self
pub fn new_fullscreen_borderless() -> Self
Instantiates a new WindowCreationOptions structure with the default
options, in borderless fullscreen mode.
Sourcepub fn with_multisampling(self, multisampling: u16) -> Self
pub fn with_multisampling(self, multisampling: u16) -> Self
Sets the maximum level of multisampling which will be applied. By
default this is set to 16.
Note that this depends on platform support, and setting this may have no effect.
Sourcepub fn with_vsync(self, vsync: bool) -> Self
pub fn with_vsync(self, vsync: bool) -> Self
Sets whether or not vsync should be enabled. This can increase latency,
but should eliminate tearing. By default this is set to true.
Note that this depends on platform support, and setting this may have no effect.
Sourcepub fn with_resizable(self, resizable: bool) -> Self
pub fn with_resizable(self, resizable: bool) -> Self
Sets whether or not the window can be resized by the user. The default
is true.
Sourcepub fn with_minimizable(self, minimizable: bool) -> Self
pub fn with_minimizable(self, minimizable: bool) -> Self
Sets whether the window shows an enabled minimize button. The default is
true.
Note that this depends on platform support, and setting this may have no effect.
Sourcepub fn with_maximizable(self, maximizable: bool) -> Self
pub fn with_maximizable(self, maximizable: bool) -> Self
Sets whether the window shows an enabled maximize button. The default is
true. Note that a non-resizable window also can’t be maximized on most
platforms.
Note that this depends on platform support, and setting this may have no effect.
Sourcepub fn with_always_on_top(self, always_on_top: bool) -> Self
pub fn with_always_on_top(self, always_on_top: bool) -> Self
If set to true, the window will be placed above other windows. The
default is false.
Sourcepub fn with_maximized(self, maximized: bool) -> Self
pub fn with_maximized(self, maximized: bool) -> Self
If set to true, the window will be initially maximized. The default is
false.
Sourcepub fn with_decorations(self, decorations: bool) -> Self
pub fn with_decorations(self, decorations: bool) -> Self
If set to false, the window will have no border. The default is
true.
Sourcepub fn with_transparent(self, transparent: bool) -> Self
pub fn with_transparent(self, transparent: bool) -> Self
Sets whether the background of the window should be transparent. The
default is false.
Note that this depends on platform support, and setting this may have no effect.
Sourcepub fn with_visible(self, visible: bool) -> Self
pub fn with_visible(self, visible: bool) -> Self
If set to false, the window will not be shown when it is created. It
can be shown later using WindowHelper::set_visible. This is useful for
applications that live in the system tray and only show a window on
demand. The default is true.
For WebCanvas, this option has no effect.
Sourcepub fn with_hide_on_close(self, hide_on_close: bool) -> Self
pub fn with_hide_on_close(self, hide_on_close: bool) -> Self
If set to true, clicking the window’s close button will hide the
window instead of closing it and terminating the application. The window
can be shown again using WindowHelper::set_visible. This is useful for
applications that should keep running in the system tray after the
window is closed. The default is false.
This applies to every window created with these options, including the main window. Note that with this enabled, closing the main window no longer exits the app; use WindowHelper::terminate_loop for that.
For WebCanvas, this option has no effect.
Trait Implementations§
Source§impl Clone for WindowCreationOptions
impl Clone for WindowCreationOptions
Source§fn clone(&self) -> WindowCreationOptions
fn clone(&self) -> WindowCreationOptions
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for WindowCreationOptions
impl Debug for WindowCreationOptions
Source§impl PartialEq for WindowCreationOptions
impl PartialEq for WindowCreationOptions
impl StructuralPartialEq for WindowCreationOptions
Auto Trait Implementations§
impl Freeze for WindowCreationOptions
impl RefUnwindSafe for WindowCreationOptions
impl Send for WindowCreationOptions
impl Sync for WindowCreationOptions
impl Unpin for WindowCreationOptions
impl UnsafeUnpin for WindowCreationOptions
impl UnwindSafe for WindowCreationOptions
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<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more