pub struct WindowOptions {
pub attributes: WindowAttributes,
/* private fields */
}Expand description
Configuration of one secondary native window.
Sizes and positions are logical pixels. A window’s parent must already be open; the
child closes with it, and on Windows stays above it in the Z-order (the owner relation).
Other platforms keep the close-with-parent rule but leave the Z-order to the system.
use zaxis::{WindowKey, WindowOptions};
let palette = WindowOptions::new("Tools")
.with_inner_size(260.0, 420.0)
.with_always_on_top(true)
.with_resizable(false)
.with_parent(WindowKey::main());
assert_eq!(palette.parent(), Some(&WindowKey::main()));Fields§
§attributes: WindowAttributesImplementations§
Source§impl WindowOptions
impl WindowOptions
Sourcepub fn new(title: impl Into<String>) -> Self
pub fn new(title: impl Into<String>) -> Self
A decorated, resizable window of 640 × 480 logical pixels.
Sourcepub fn from_attributes(attributes: WindowAttributes) -> Self
pub fn from_attributes(attributes: WindowAttributes) -> Self
Start from complete winit attributes for options this builder does not cover.
pub fn with_title(self, title: impl Into<String>) -> Self
pub fn with_inner_size(self, width: f64, height: f64) -> Self
pub fn with_position(self, x: f64, y: f64) -> Self
pub fn with_min_inner_size(self, width: f64, height: f64) -> Self
pub fn with_max_inner_size(self, width: f64, height: f64) -> Self
Sourcepub fn with_decorations(self, decorations: bool) -> Self
pub fn with_decorations(self, decorations: bool) -> Self
System title bar and borders. Turn off to draw a TitleBar.
macOS always keeps system decorations.
pub fn with_resizable(self, resizable: bool) -> Self
pub fn with_always_on_top(self, on_top: bool) -> Self
Sourcepub fn with_transparent(self, transparent: bool) -> Self
pub fn with_transparent(self, transparent: bool) -> Self
A surface that composites with the desktop where the platform supports it. The style background’s alpha then decides how much of the desktop shows through.
pub fn with_icon(self, icon: Icon) -> Self
Sourcepub fn with_visible(self, visible: bool) -> Self
pub fn with_visible(self, visible: bool) -> Self
A window created hidden is not rendered and requests no frames until shown with
Windows::set_visible.
pub fn with_maximized(self, maximized: bool) -> Self
Sourcepub fn with_parent(self, parent: impl Into<WindowKey>) -> Self
pub fn with_parent(self, parent: impl Into<WindowKey>) -> Self
Close this window with parent, which must be open when this window is requested.
Sourcepub fn with_presentation_mode(self, mode: PresentationMode) -> Self
pub fn with_presentation_mode(self, mode: PresentationMode) -> Self
Present with mode instead of the RunOptions default.
Sourcepub fn with_rounded_corners(self, rounded: bool) -> Self
pub fn with_rounded_corners(self, rounded: bool) -> Self
Native rounded corners and shadow on Windows 11; see RunOptions::with_rounded_corners.
Sourcepub fn with_accessibility(self, accessibility: bool) -> Self
pub fn with_accessibility(self, accessibility: bool) -> Self
Whether this window serves an accessibility tree to screen readers and other
assistive technology. On by default; a window without one is invisible to them.
RunOptions::with_accessibility turns it
off for every window.
pub fn parent(&self) -> Option<&WindowKey>
Trait Implementations§
Source§impl Clone for WindowOptions
impl Clone 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
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.