pub struct ChildWindow<'ui> { /* private fields */ }
Expand description
Builder for a child window
Implementations§
Source§impl<'ui> ChildWindow<'ui>
impl<'ui> ChildWindow<'ui>
Sourcepub fn new(ui: &'ui Ui, name: impl AsRef<str>) -> ChildWindow<'ui>
👎Deprecated since 0.9.0: use ui.child_window(…) instead
pub fn new(ui: &'ui Ui, name: impl AsRef<str>) -> ChildWindow<'ui>
Creates a new child window builder with the str.
Sourcepub fn new_id(ui: &'ui Ui, id: Id) -> ChildWindow<'ui>
pub fn new_id(ui: &'ui Ui, id: Id) -> ChildWindow<'ui>
Creates a new child window builder with the given imgui id.
Sourcepub fn flags(self, flags: WindowFlags) -> ChildWindow<'ui>
pub fn flags(self, flags: WindowFlags) -> ChildWindow<'ui>
Replace current window flags with the given value
Sourcepub fn size(self, size: impl Into<Vector2<f32>>) -> ChildWindow<'ui>
pub fn size(self, size: impl Into<Vector2<f32>>) -> ChildWindow<'ui>
Sets the child window size.
For each independent axis of size:
> 0.0
: fixed size= 0.0
: use remaining host window size< 0.0
: use remaining host window size minus abs(size)
Sourcepub fn content_size(self, size: impl Into<Vector2<f32>>) -> ChildWindow<'ui>
pub fn content_size(self, size: impl Into<Vector2<f32>>) -> ChildWindow<'ui>
Sets the window content size, which can be used to enforce scrollbars.
Does not include window decorations (title bar, menu bar, etc.). Set one of the values to 0.0 to leave the size automatic.
Sourcepub fn focused(self, focused: bool) -> ChildWindow<'ui>
pub fn focused(self, focused: bool) -> ChildWindow<'ui>
Sets the window focused state, which can be used to bring the window to front
Sourcepub fn bg_alpha(self, bg_alpha: f32) -> ChildWindow<'ui>
pub fn bg_alpha(self, bg_alpha: f32) -> ChildWindow<'ui>
Sets the background color alpha value.
See also draw_background
Sourcepub fn border(self, border: bool) -> ChildWindow<'ui>
pub fn border(self, border: bool) -> ChildWindow<'ui>
Enables/disables the child window border.
Disabled by default.
Sourcepub fn movable(self, value: bool) -> ChildWindow<'ui>
pub fn movable(self, value: bool) -> ChildWindow<'ui>
Enables/disables moving the window when child window is dragged.
Enabled by default.
Sourcepub fn scroll_bar(self, value: bool) -> ChildWindow<'ui>
pub fn scroll_bar(self, value: bool) -> ChildWindow<'ui>
Enables/disables scrollbars (scrolling is still possible with the mouse or programmatically).
Enabled by default.
Sourcepub fn scrollable(self, value: bool) -> ChildWindow<'ui>
pub fn scrollable(self, value: bool) -> ChildWindow<'ui>
Enables/disables vertical scrolling with the mouse wheel.
Enabled by default.
When enabled, child windows forward the mouse wheel to the parent unless NO_SCROLLBAR
is also set.
Sourcepub fn always_auto_resize(self, value: bool) -> ChildWindow<'ui>
pub fn always_auto_resize(self, value: bool) -> ChildWindow<'ui>
Enables/disables resizing the window to its content on every frame.
Disabled by default.
Sourcepub fn draw_background(self, value: bool) -> ChildWindow<'ui>
pub fn draw_background(self, value: bool) -> ChildWindow<'ui>
Enables/disables drawing of background color and outside border.
Enabled by default.
Sourcepub fn mouse_inputs(self, value: bool) -> ChildWindow<'ui>
pub fn mouse_inputs(self, value: bool) -> ChildWindow<'ui>
Enables/disables catching mouse input.
Enabled by default. Note: Hovering test will pass through when disabled
Enables/disables the menu bar.
Disabled by default.
Sourcepub fn horizontal_scrollbar(self, value: bool) -> ChildWindow<'ui>
pub fn horizontal_scrollbar(self, value: bool) -> ChildWindow<'ui>
Enables/disables the horizontal scrollbar.
Disabled by default.
Sourcepub fn focus_on_appearing(self, value: bool) -> ChildWindow<'ui>
pub fn focus_on_appearing(self, value: bool) -> ChildWindow<'ui>
Enables/disables taking focus when transitioning from hidden to visible state.
Enabled by default.
Sourcepub fn bring_to_front_on_focus(self, value: bool) -> ChildWindow<'ui>
pub fn bring_to_front_on_focus(self, value: bool) -> ChildWindow<'ui>
Enables/disables bringing the window to front when taking focus (e.g. clicking it or programmatically giving it focus).
Enabled by default.
Sourcepub fn always_vertical_scrollbar(self, value: bool) -> ChildWindow<'ui>
pub fn always_vertical_scrollbar(self, value: bool) -> ChildWindow<'ui>
When enabled, forces the vertical scrollbar to render regardless of the content size.
Disabled by default.
Sourcepub fn always_horizontal_scrollbar(self, value: bool) -> ChildWindow<'ui>
pub fn always_horizontal_scrollbar(self, value: bool) -> ChildWindow<'ui>
When enabled, forces the horizontal scrollbar to render regardless of the content size.
Disabled by default.
Sourcepub fn always_use_window_padding(self, value: bool) -> ChildWindow<'ui>
pub fn always_use_window_padding(self, value: bool) -> ChildWindow<'ui>
When enabled, ensures child windows without border use style.window_padding
.
Disabled by default.
Enables/disables gamepad/keyboard navigation within the window.
Enabled by default.
Enables/disables focusing toward this window with gamepad/keyboard navigation (e.g. CTRL+TAB).
Enabled by default.
Disable gamepad/keyboard navigation and focusing.
Shorthand for
.nav_inputs(false)
.nav_focus(false)
Sourcepub fn no_inputs(self) -> ChildWindow<'ui>
pub fn no_inputs(self) -> ChildWindow<'ui>
Don’t handle input.
Shorthand for
.mouse_inputs(false)
.nav_inputs(false)
.nav_focus(false)
Sourcepub fn begin(self) -> Option<ChildWindowToken<'ui>>
pub fn begin(self) -> Option<ChildWindowToken<'ui>>
Creates a child window and starts append to it.
Returns Some(ChildWindowToken)
if the window is visible. After content has been
rendered, the token must be ended by calling .end()
.
Returns None
if the window is not visible and no content should be rendered.
Sourcepub fn build<T, F>(self, f: F) -> Option<T>where
F: FnOnce() -> T,
pub fn build<T, F>(self, f: F) -> Option<T>where
F: FnOnce() -> T,
Creates a child window and runs a closure to construct the contents. Returns the result of the closure, if it is called.
Note: the closure is not called if no window content is visible (e.g. window is collapsed or fully clipped).
Trait Implementations§
Source§impl<'ui> Clone for ChildWindow<'ui>
impl<'ui> Clone for ChildWindow<'ui>
Source§fn clone(&self) -> ChildWindow<'ui>
fn clone(&self) -> ChildWindow<'ui>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreSource§impl<'ui> Debug for ChildWindow<'ui>
impl<'ui> Debug for ChildWindow<'ui>
impl<'ui> Copy for ChildWindow<'ui>
Auto Trait Implementations§
impl<'ui> Freeze for ChildWindow<'ui>
impl<'ui> !RefUnwindSafe for ChildWindow<'ui>
impl<'ui> !Send for ChildWindow<'ui>
impl<'ui> !Sync for ChildWindow<'ui>
impl<'ui> Unpin for ChildWindow<'ui>
impl<'ui> !UnwindSafe for ChildWindow<'ui>
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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 more