From 30e49f1da2cce74afa4e5e39991c5f3bdb9da3e8 Mon Sep 17 00:00:00 2001 From: Timon Date: Mon, 23 Jan 2023 12:37:15 +0100 Subject: [PATCH] Expose area interactable and movable to Window api. (#2610) * Expose area interactable to window. * Add movable function * update dockstring --- crates/egui/src/containers/window.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/egui/src/containers/window.rs b/crates/egui/src/containers/window.rs index 1b5ffc6f..1182e6a7 100644 --- a/crates/egui/src/containers/window.rs +++ b/crates/egui/src/containers/window.rs @@ -79,6 +79,18 @@ impl<'open> Window<'open> { 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))` // TODO(emilk): I'm not sure this is a good interface for this. pub fn mutate(mut self, mutate: impl Fn(&mut Self)) -> Self {