summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-05 02:11:11 +0100
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2020-11-05 04:09:40 +0100
commit88993fb092fb0391ea42ffd725f680d1c98c95d7 (patch)
treeb6315b1b3e3078c35a7a69e1631804cbe8f3e0cb /native
parent86b26f65d6e28698d9e6b2d8356105847b0d64c5 (diff)
downloadiced-88993fb092fb0391ea42ffd725f680d1c98c95d7.tar.gz
iced-88993fb092fb0391ea42ffd725f680d1c98c95d7.tar.bz2
iced-88993fb092fb0391ea42ffd725f680d1c98c95d7.zip
Relayout `UserInterface` on resize in `iced_winit`
Diffstat (limited to 'native')
-rw-r--r--native/src/user_interface.rs17
1 files changed, 17 insertions, 0 deletions
diff --git a/native/src/user_interface.rs b/native/src/user_interface.rs
index 59d91f42..504dbe0f 100644
--- a/native/src/user_interface.rs
+++ b/native/src/user_interface.rs
@@ -388,6 +388,23 @@ where
}
}
+ /// Relayouts and returns a new [`UserInterface`] using the provided
+ /// bounds.
+ ///
+ /// [`UserInterface`]: struct.UserInterface.html
+ pub fn relayout(self, bounds: Size, renderer: &mut Renderer) -> Self {
+ Self::build(
+ self.root,
+ bounds,
+ Cache {
+ base: self.base,
+ overlay: self.overlay,
+ bounds: self.bounds,
+ },
+ renderer,
+ )
+ }
+
/// Extract the [`Cache`] of the [`UserInterface`], consuming it in the
/// process.
///