pub struct WindowBuilder {Show 15 fields
pub widget_builder: WidgetBuilder,
pub content: Handle<UiNode>,
pub title: Option<WindowTitle>,
pub can_close: bool,
pub can_minimize: bool,
pub can_maximize: bool,
pub open: bool,
pub close_button: Option<Handle<UiNode>>,
pub minimize_button: Option<Handle<UiNode>>,
pub maximize_button: Option<Handle<UiNode>>,
pub modal: bool,
pub can_resize: bool,
pub safe_border_size: Option<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>>,
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: WidgetBuilder
Base widget builder.
content: Handle<UiNode>
Content of the window.
title: Option<WindowTitle>
Optional title of the window.
can_close: bool
Whether the window can be closed or not.
can_minimize: bool
Whether the window can be minimized or not.
can_maximize: bool
Whether the window can be maximized or not.
open: bool
Whether 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: bool
Whether the window should be created as modal or not. Warning: Any dependant builders must take this into account!
can_resize: bool
Whether the window should be resizable or not.
safe_border_size: Option<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>>
Optional size of the border around the screen in which the window will be forced to stay.
close_by_esc: bool
If true
, then the window can be closed using Esc
key. Default is true
. Works only if
can_close
is also true
.
remove_on_close: bool
If true
, then the window will be deleted after closing.
Implementations§
Source§impl WindowBuilder
impl WindowBuilder
Sourcepub fn new(widget_builder: WidgetBuilder) -> WindowBuilder
pub fn new(widget_builder: WidgetBuilder) -> WindowBuilder
Creates new window builder.
Sourcepub fn with_content(self, content: Handle<UiNode>) -> WindowBuilder
pub fn with_content(self, content: Handle<UiNode>) -> WindowBuilder
Sets a desired window content.
Sourcepub fn with_title(self, title: WindowTitle) -> WindowBuilder
pub fn with_title(self, title: WindowTitle) -> WindowBuilder
Sets a desired window title.
Sets a desired minimization button.
Sets a desired maximization button.
Sets a desired closing button.
Sourcepub fn can_close(self, can_close: bool) -> WindowBuilder
pub fn can_close(self, can_close: bool) -> WindowBuilder
Sets whether the window can be closed or not.
Sourcepub fn can_minimize(self, can_minimize: bool) -> WindowBuilder
pub fn can_minimize(self, can_minimize: bool) -> WindowBuilder
Sets whether the window can be minimized or not.
Sourcepub fn can_maximize(self, can_minimize: bool) -> WindowBuilder
pub fn can_maximize(self, can_minimize: bool) -> WindowBuilder
Sets whether the window can be maximized or not.
Sourcepub fn open(self, open: bool) -> WindowBuilder
pub fn open(self, open: bool) -> WindowBuilder
Sets whether the window should be open or not.
Sourcepub fn modal(self, modal: bool) -> WindowBuilder
pub fn modal(self, modal: bool) -> WindowBuilder
Sets whether the window should be modal or not.
Sourcepub fn can_resize(self, can_resize: bool) -> WindowBuilder
pub fn can_resize(self, can_resize: bool) -> WindowBuilder
Sets whether the window can be resized or not.
Sourcepub fn with_safe_border_size(
self,
size: Option<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>>,
) -> WindowBuilder
pub fn with_safe_border_size( self, size: Option<Matrix<f32, Const<2>, Const<1>, ArrayStorage<f32, 2, 1>>>, ) -> WindowBuilder
Sets a desired safe border size.
Sourcepub fn with_close_by_esc(self, close: bool) -> WindowBuilder
pub fn with_close_by_esc(self, close: bool) -> WindowBuilder
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) -> WindowBuilder
pub fn with_remove_on_close(self, close: bool) -> WindowBuilder
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<UiNode>
pub fn build(self, ctx: &mut BuildContext<'_>) -> Handle<UiNode>
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 !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> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Any
. Could be used to downcast a trait object
to a particular type.fn into_any(self: Box<T>) -> Box<dyn Any>
Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere
T: 'static,
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 moreSource§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.