diff options
author | 2022-02-22 15:02:47 +0700 | |
---|---|---|
committer | 2022-02-22 23:38:32 +0700 | |
commit | a12a92c266ee0127456ae3711b246f9148e65f72 (patch) | |
tree | 0fadb296a8f49f7407884f9065a8948a9d1875ca /lazy/src/responsive.rs | |
parent | adce9e04213803bd775538efddf6e7908d1c605e (diff) | |
download | iced-a12a92c266ee0127456ae3711b246f9148e65f72.tar.gz iced-a12a92c266ee0127456ae3711b246f9148e65f72.tar.bz2 iced-a12a92c266ee0127456ae3711b246f9148e65f72.zip |
fix: overlay layout for `Responsive`
Diffstat (limited to '')
-rw-r--r-- | lazy/src/responsive.rs | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/lazy/src/responsive.rs b/lazy/src/responsive.rs index 35ad6974..d01cfd68 100644 --- a/lazy/src/responsive.rs +++ b/lazy/src/responsive.rs @@ -178,7 +178,7 @@ where let content_layout = state.layout(layout); match content { - Content::Pending(_) => false, + Content::Pending(_) => None, Content::Ready(cache) => { *cache = Some( CacheBuilder { @@ -190,14 +190,19 @@ where .build(), ); - cache.as_ref().unwrap().borrow_overlay().is_some() + cache + .as_ref() + .unwrap() + .borrow_overlay() + .as_ref() + .map(|overlay| overlay.position()) } } }; - has_overlay.then(|| { + has_overlay.map(|position| { overlay::Element::new( - layout.position(), + position, Box::new(Overlay { instance: self }), ) }) |