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: 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.

§close_button: Option<Handle<UiNode>>

Optional custom closing button, if not specified, then a default button will be created.

§minimize_button: Option<Handle<UiNode>>

Optional custom minimization button, if not specified, then a default button will be created.

§maximize_button: Option<Handle<UiNode>>

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<Vector2<f32>>

Optional size of the border around the screen in which the window will be forced to stay.

Implementations§

source§

impl WindowBuilder

source

pub fn new(widget_builder: WidgetBuilder) -> Self

Creates new window builder.

source

pub fn with_content(self, content: Handle<UiNode>) -> Self

Sets a desired window content.

source

pub fn with_title(self, title: WindowTitle) -> Self

Sets a desired window title.

source

pub fn with_minimize_button(self, button: Handle<UiNode>) -> Self

Sets a desired minimization button.

source

pub fn with_maximize_button(self, button: Handle<UiNode>) -> Self

Sets a desired maximization button.

source

pub fn with_close_button(self, button: Handle<UiNode>) -> Self

Sets a desired closing button.

source

pub fn can_close(self, can_close: bool) -> Self

Sets whether the window can be closed or not.

source

pub fn can_minimize(self, can_minimize: bool) -> Self

Sets whether the window can be minimized or not.

source

pub fn can_maximize(self, can_minimize: bool) -> Self

Sets whether the window can be maximized or not.

source

pub fn open(self, open: bool) -> Self

Sets whether the window should be open or not.

source

pub fn modal(self, modal: bool) -> Self

Sets whether the window should be modal or not.

source

pub fn can_resize(self, can_resize: bool) -> Self

Sets whether the window can be resized or not.

source

pub fn with_safe_border_size(self, size: Option<Vector2<f32>>) -> Self

Sets a desired safe border size.

source

pub fn build_window(self, ctx: &mut BuildContext<'_>) -> Window

Finishes window building and returns its instance.

source

pub fn build(self, ctx: &mut BuildContext<'_>) -> Handle<UiNode>

Finishes window building and returns its handle.

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> FieldValue for Twhere T: 'static,

source§

fn as_any(&self) -> &(dyn Any + 'static)

Casts self to a &dyn Any
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

§

impl<T> Pointable for T

§

const ALIGN: usize = mem::align_of::<T>()

The alignment of pointer.
§

type Init = T

The type for initializers.
§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
§

impl<SS, SP> SupersetOf<SS> for SPwhere SS: SubsetOf<SP>,

§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
§

fn is_in_subset(&self) -> bool

Checks if self is actually part of its subset T (and can be converted to it).
§

fn to_subset_unchecked(&self) -> SS

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
§

impl<V, T> VZip<V> for Twhere V: MultiLane<T>,

§

fn vzip(self) -> V