pub struct WindowConfig {
pub title: String,
pub width: f32,
pub height: f32,
pub resizable: bool,
pub decorations: bool,
pub transparent: bool,
pub always_on_top: bool,
}Expand description
Configuration for creating a new window.
Fields§
§title: StringWindow title string.
width: f32Logical width in pixels.
height: f32Logical height in pixels.
resizable: boolWhether the window may be resized by the user.
decorations: boolWhether to show the OS window decorations (title bar, borders).
transparent: boolWhether the window background is transparent.
always_on_top: boolWhether the window floats above all other windows.
Implementations§
Source§impl WindowConfig
impl WindowConfig
Sourcepub fn new(title: impl Into<String>) -> Self
pub fn new(title: impl Into<String>) -> Self
Create a config with the given title and default dimensions.
Sourcepub fn decorations(self, d: bool) -> Self
pub fn decorations(self, d: bool) -> Self
Set whether window decorations are shown.
Sourcepub fn transparent(self, t: bool) -> Self
pub fn transparent(self, t: bool) -> Self
Set whether the window background is transparent.
Sourcepub fn always_on_top(self, a: bool) -> Self
pub fn always_on_top(self, a: bool) -> Self
Set whether the window is always on top.
Trait Implementations§
Source§impl Clone for WindowConfig
impl Clone for WindowConfig
Source§fn clone(&self) -> WindowConfig
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)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WindowConfig
impl Debug for WindowConfig
Auto Trait Implementations§
impl Freeze 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
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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>
Converts
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>
Converts
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