summaryrefslogtreecommitdiffstats
path: root/native
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2020-11-08 13:31:08 +0100
committerLibravatar GitHub <noreply@github.com>2020-11-08 13:31:08 +0100
commitda1a3eed1e6e67c2c0507e3b939e4aacdc06c19a (patch)
tree65eb9b90b1e9fb07912296d36b604caea96b3b15 /native
parentef76f16900801c764292674280b0150e039d1ca3 (diff)
parent631c9e4a215d8f044d76ea926117f9a9bdd24d5d (diff)
downloadiced-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.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.
///