pub struct WindowBuilder {Show 16 fields
pub widget_builder: WidgetBuilder,
pub content: Handle<UiNode>,
pub title: Option<WindowTitle>,
pub tab_label: String,
pub can_close: bool,
pub can_minimize: bool,
pub can_maximize: bool,
pub open: bool,
pub close_button: Option<Handle<Button>>,
pub minimize_button: Option<Handle<Button>>,
pub maximize_button: Option<Handle<Button>>,
pub modal: bool,
pub can_resize: bool,
pub safe_border_size: Option<Vector2<f32>>,
pub close_by_esc: bool,
pub remove_on_close: bool,
}Expand description
Window builder creates Window instances and adds them to the user interface.
Fields§
§widget_builder: WidgetBuilderBase widget builder.
content: Handle<UiNode>Content of the window.
title: Option<WindowTitle>Optional title of the window.
tab_label: StringLabel for the window’s tab.
can_close: boolWhether the window can be closed or not.
can_minimize: boolWhether the window can be minimized or not.
can_maximize: boolWhether the window can be maximized or not.
open: boolWhether the window should be created open or not.
Optional custom closing button, if not specified, then a default button will be created.
Optional custom minimization button, if not specified, then a default button will be created.
Optional custom maximization button, if not specified, then a default button will be created.
modal: boolWhether the window should be created as modal or not. Warning: Any independent builders must take this into account!
can_resize: boolWhether the window should be resizable or not.
safe_border_size: Option<Vector2<f32>>Optional size of the border around the screen in which the window will be forced to stay.
close_by_esc: boolIf true, then the window can be closed using Esc key. Default is true. Works only if
can_close is also true.
remove_on_close: boolIf true, then the window will be deleted after closing.
Implementations§
Source§impl WindowBuilder
impl WindowBuilder
Sourcepub fn new(widget_builder: WidgetBuilder) -> Self
pub fn new(widget_builder: WidgetBuilder) -> Self
Creates new window builder.
Sourcepub fn with_content(self, content: Handle<impl ObjectOrVariant<UiNode>>) -> Self
pub fn with_content(self, content: Handle<impl ObjectOrVariant<UiNode>>) -> Self
Sets a desired window content.
Sourcepub fn with_title(self, title: WindowTitle) -> Self
pub fn with_title(self, title: WindowTitle) -> Self
Sets a desired window title.
pub fn with_tab_label<S: Into<String>>(self, label: S) -> Self
Sets a desired minimization button.
Sets a desired maximization button.
Sets a desired closing button.
Sourcepub fn can_minimize(self, can_minimize: bool) -> Self
pub fn can_minimize(self, can_minimize: bool) -> Self
Sets whether the window can be minimized or not.
Sourcepub fn can_maximize(self, can_minimize: bool) -> Self
pub fn can_maximize(self, can_minimize: bool) -> Self
Sets whether the window can be maximized or not.
Sourcepub fn can_resize(self, can_resize: bool) -> Self
pub fn can_resize(self, can_resize: bool) -> Self
Sets whether the window can be resized or not.
Sourcepub fn with_safe_border_size(self, size: Option<Vector2<f32>>) -> Self
pub fn with_safe_border_size(self, size: Option<Vector2<f32>>) -> Self
Sets a desired safe border size.
Sourcepub fn with_close_by_esc(self, close: bool) -> Self
pub fn with_close_by_esc(self, close: bool) -> Self
Defines, whether the window can be closed using Esc key or not. Works only if can_close
is also true.
Sourcepub fn with_remove_on_close(self, close: bool) -> Self
pub fn with_remove_on_close(self, close: bool) -> Self
Defines, whether the window should be deleted after closing or not. Default is false.
Sourcepub fn build_window(self, ctx: &mut BuildContext<'_>) -> Window
pub fn build_window(self, ctx: &mut BuildContext<'_>) -> Window
Finishes window building and returns its instance.
Sourcepub fn build(self, ctx: &mut BuildContext<'_>) -> Handle<Window>
pub fn build(self, ctx: &mut BuildContext<'_>) -> Handle<Window>
Finishes window building and returns its handle.
Auto Trait Implementations§
impl Freeze for WindowBuilder
impl !RefUnwindSafe for WindowBuilder
impl Send for WindowBuilder
impl Sync for WindowBuilder
impl Unpin for WindowBuilder
impl UnsafeUnpin for WindowBuilder
impl !UnwindSafe for WindowBuilder
Blanket Implementations§
Source§impl<T> AsyncTaskResult for T
impl<T> AsyncTaskResult for T
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
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> 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 moreSource§impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
impl<T, U> ObjectOrVariant<T> for Uwhere
PhantomData<U>: ObjectOrVariantHelper<T, U>,
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.