Expose area interactable and movable to Window api. (#2610)

* Expose area interactable to window.

* Add movable function

* update dockstring
This commit is contained in:
Timon 2023-01-23 12:37:15 +01:00 committed by GitHub
parent 01bbda4544
commit 30e49f1da2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -79,6 +79,18 @@ impl<'open> Window<'open> {
self self
} }
/// If `false` the window will be non-interactive.
pub fn interactable(mut self, interactable: bool) -> Self {
self.area = self.area.interactable(interactable);
self
}
/// If `false` the window will be immovable.
pub fn movable(mut self, movable: bool) -> Self {
self.area = self.area.movable(movable);
self
}
/// Usage: `Window::new(…).mutate(|w| w.resize = w.resize.auto_expand_width(true))` /// Usage: `Window::new(…).mutate(|w| w.resize = w.resize.auto_expand_width(true))`
// TODO(emilk): I'm not sure this is a good interface for this. // TODO(emilk): I'm not sure this is a good interface for this.
pub fn mutate(mut self, mutate: impl Fn(&mut Self)) -> Self { pub fn mutate(mut self, mutate: impl Fn(&mut Self)) -> Self {