diff options
author | 2020-11-05 02:11:11 +0100 | |
---|---|---|
committer | 2020-11-05 04:09:40 +0100 | |
commit | 88993fb092fb0391ea42ffd725f680d1c98c95d7 (patch) | |
tree | b6315b1b3e3078c35a7a69e1631804cbe8f3e0cb /native | |
parent | 86b26f65d6e28698d9e6b2d8356105847b0d64c5 (diff) | |
download | iced-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.rs | 17 |
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. /// |