pub struct WindowAttributes {
pub resizable: bool,
pub maximized: bool,
pub visible: bool,
pub decorations: bool,
pub title: String,
pub size: Option<Size>,
pub min_size: Option<Size>,
pub max_size: Option<Size>,
pub position: Option<Point>,
pub icon: Option<Resource<PixelImage>>,
}Expand description
Attributes for creating a new window.
Fields§
§resizable: bool§maximized: bool§visible: bool§decorations: bool§title: String§size: Option<Size>§min_size: Option<Size>§max_size: Option<Size>§position: Option<Point>§icon: Option<Resource<PixelImage>>Implementations§
Source§impl WindowAttributes
impl WindowAttributes
Sourcepub fn with_title(&mut self, title: impl Into<String>) -> &mut Self
pub fn with_title(&mut self, title: impl Into<String>) -> &mut Self
Sets the initial title of the window in the title bar.
The default is "Ribir App".
Sourcepub fn with_resizable(&mut self, resizable: bool) -> &mut Self
pub fn with_resizable(&mut self, resizable: bool) -> &mut Self
Sets whether the window should be resizable or not. The default is true.
Sourcepub fn with_size(&mut self, size: Size) -> &mut Self
pub fn with_size(&mut self, size: Size) -> &mut Self
Sets the initial size of the window client area, window excluding the title bar and borders.
Sourcepub fn with_min_size(&mut self, size: Size) -> &mut Self
pub fn with_min_size(&mut self, size: Size) -> &mut Self
Sets the minimum size of the window client area
Sourcepub fn with_max_size(&mut self, size: Size) -> &mut Self
pub fn with_max_size(&mut self, size: Size) -> &mut Self
Sets the maximum size of the window client area
Sourcepub fn with_position(&mut self, position: Point) -> &mut Self
pub fn with_position(&mut self, position: Point) -> &mut Self
Sets the initial position of the window in screen coordinates.
Sourcepub fn with_maximized(&mut self, maximized: bool) -> &mut Self
pub fn with_maximized(&mut self, maximized: bool) -> &mut Self
Sets whether the window should be maximized when it is first shown.
Sourcepub fn with_visible(&mut self, visible: bool) -> &mut Self
pub fn with_visible(&mut self, visible: bool) -> &mut Self
Sets whether the window should be visible when it is first shown.
Sourcepub fn with_decorations(&mut self, decorations: bool) -> &mut Self
pub fn with_decorations(&mut self, decorations: bool) -> &mut Self
Sets whether the window should have a border, a title bar, etc.
Sourcepub fn with_icon(&mut self, icon: Resource<PixelImage>) -> &mut Self
pub fn with_icon(&mut self, icon: Resource<PixelImage>) -> &mut Self
Sets the icon of the window.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for WindowAttributes
impl RefUnwindSafe for WindowAttributes
impl Send for WindowAttributes
impl Sync for WindowAttributes
impl Unpin for WindowAttributes
impl UnsafeUnpin for WindowAttributes
impl UnwindSafe for WindowAttributes
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
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>
Convert
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>
Convert
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)
Convert
&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)
Convert
&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> 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