mirror of
https://github.com/eliasstepanik/imgui-rs.git
synced 2026-01-24 03:48:30 +00:00
Implement ChildWindow::movable
This commit adds the API that allows to set the NO_MOVE flag for a child window. This API was missing: the NO_MOVE flag could only be set for a Window. If the NO_MOVE flag is set to True, (by calling `ChildWindow::movable(false)`), then the window will not move when a child window is dragged on. We can see this behavior in imgui's code: https://github.com/ocornut/imgui/blob/f0f53016/imgui.cpp#L3354
This commit is contained in:
parent
ffff82d5e4
commit
093546df8c
@ -83,6 +83,14 @@ impl<'a> ChildWindow<'a> {
|
|||||||
self.border = border;
|
self.border = border;
|
||||||
self
|
self
|
||||||
}
|
}
|
||||||
|
/// Enables/disables moving the window when child window is dragged.
|
||||||
|
///
|
||||||
|
/// Enabled by default.
|
||||||
|
#[inline]
|
||||||
|
pub fn movable(mut self, value: bool) -> Self {
|
||||||
|
self.flags.set(WindowFlags::NO_MOVE, !value);
|
||||||
|
self
|
||||||
|
}
|
||||||
/// Enables/disables scrollbars (scrolling is still possible with the mouse or
|
/// Enables/disables scrollbars (scrolling is still possible with the mouse or
|
||||||
/// programmatically).
|
/// programmatically).
|
||||||
///
|
///
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user