Struct fyrox_ui::window::WindowBuilder
source · pub struct WindowBuilder {Show 13 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<Vector2<f32>>,
}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.
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 dependant 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.
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<UiNode>) -> Self
pub fn with_content(self, content: Handle<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.
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 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 !RefUnwindSafe for WindowBuilder
impl !Send for WindowBuilder
impl !Sync for WindowBuilder
impl Unpin for WindowBuilder
impl !UnwindSafe for WindowBuilder
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
source§impl<T> FieldValue for Twhere
T: 'static,
impl<T> FieldValue for Twhere T: 'static,
§impl<T> Pointable for T
impl<T> Pointable for T
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,
§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read more§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).§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.