Struct zng::window::WindowRoot
source · pub struct WindowRoot { /* private fields */ }
Expand description
Window root node and values.
The Window!
widget instantiates this type.
This struct contains the window config that does not change, other window config is available in WINDOW.vars()
.
Implementations§
source§impl WindowRoot
impl WindowRoot
sourcepub fn new(
root_id: WidgetId,
start_position: StartPosition,
kiosk: bool,
transparent: bool,
render_mode: Option<RenderMode>,
headless_monitor: HeadlessMonitor,
start_focused: bool,
root: impl UiNode,
) -> WindowRoot
pub fn new( root_id: WidgetId, start_position: StartPosition, kiosk: bool, transparent: bool, render_mode: Option<RenderMode>, headless_monitor: HeadlessMonitor, start_focused: bool, root: impl UiNode, ) -> WindowRoot
New window from a root
node that forms the window root widget.
root_id
- Widget ID ofroot
.start_position
- Position of the window when it first opens.kiosk
- Only allow fullscreen mode. Note this does not configure the windows manager, only blocks the app itself from accidentally exiting fullscreen. Also causes subsequent open windows to be child of this window.transparent
- If the window should be created in a compositor mode that renders semi-transparent pixels as “see-through”.render_mode
- Render mode preference overwrite for this window, note that the actual render mode selected can be different.headless_monitor
- “Monitor” configuration used in headless mode.start_focused
- If the window is forced to be the foreground keyboard focus after opening.root
- The root widget’s outermostCONTEXT
node, the window uses this and theroot_id
to form the root widget.
sourcepub fn new_container(
root_id: WidgetId,
start_position: StartPosition,
kiosk: bool,
transparent: bool,
render_mode: Option<RenderMode>,
headless_monitor: HeadlessMonitor,
start_focused: bool,
child: impl UiNode,
) -> WindowRoot
pub fn new_container( root_id: WidgetId, start_position: StartPosition, kiosk: bool, transparent: bool, render_mode: Option<RenderMode>, headless_monitor: HeadlessMonitor, start_focused: bool, child: impl UiNode, ) -> WindowRoot
New window from a child
node that becomes the child of the window root widget.
The child
parameter is a node that is the window’s content, if it is a full widget the root_id
is the id of
an internal container widget that is the parent of child
, if it is not a widget it will still be placed in the inner
nest group of the root widget.
See new
for other parameters.
sourcepub fn new_test(child: impl UiNode) -> WindowRoot
pub fn new_test(child: impl UiNode) -> WindowRoot
New test window.
Trait Implementations§
source§impl ImageRenderWindowRoot for WindowRoot
impl ImageRenderWindowRoot for WindowRoot
Auto Trait Implementations§
impl Freeze for WindowRoot
impl !RefUnwindSafe for WindowRoot
impl Send for WindowRoot
impl !Sync for WindowRoot
impl Unpin for WindowRoot
impl !UnwindSafe for WindowRoot
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<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§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
.§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
.§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.§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.§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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>
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