diff options
author | 2020-11-08 13:31:08 +0100 | |
---|---|---|
committer | 2020-11-08 13:31:08 +0100 | |
commit | da1a3eed1e6e67c2c0507e3b939e4aacdc06c19a (patch) | |
tree | 65eb9b90b1e9fb07912296d36b604caea96b3b15 /native | |
parent | ef76f16900801c764292674280b0150e039d1ca3 (diff) | |
parent | 631c9e4a215d8f044d76ea926117f9a9bdd24d5d (diff) | |
download | iced-da1a3eed1e6e67c2c0507e3b939e4aacdc06c19a.tar.gz iced-da1a3eed1e6e67c2c0507e3b939e4aacdc06c19a.tar.bz2 iced-da1a3eed1e6e67c2c0507e3b939e4aacdc06c19a.zip |
Merge pull request #597 from hecrj/improvement/reuse-view-in-event-loop
Rebuild widget tree only after an application update
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. /// |