summaryrefslogtreecommitdiffstats
path: root/lazy
diff options
context:
space:
mode:
authorLibravatar Bingus <shankern@protonmail.com>2023-02-15 14:55:02 -0800
committerLibravatar Bingus <shankern@protonmail.com>2023-02-15 14:55:02 -0800
commit63fb608d8bea8a653bf011f5f9cffc88525576e0 (patch)
tree938c15b85fd9d27ee3a82806cf83bc211e7b94dd /lazy
parent64e0e817c27d720dc954ee94de58ded35b3f9f9a (diff)
parent0cb72f69716adc82ad85a0ee7120edb6e653b0c0 (diff)
downloadiced-63fb608d8bea8a653bf011f5f9cffc88525576e0.tar.gz
iced-63fb608d8bea8a653bf011f5f9cffc88525576e0.tar.bz2
iced-63fb608d8bea8a653bf011f5f9cffc88525576e0.zip
Merge remote-tracking branch 'origin/master' into feat/multi-window-support
# Conflicts: # native/src/command/action.rs # native/src/window/action.rs # winit/src/window.rs
Diffstat (limited to '')
-rw-r--r--lazy/src/component.rs17
-rw-r--r--lazy/src/lazy.rs11
-rw-r--r--lazy/src/responsive.rs11
3 files changed, 33 insertions, 6 deletions
diff --git a/lazy/src/component.rs b/lazy/src/component.rs
index d8f21f8a..b23da9f7 100644
--- a/lazy/src/component.rs
+++ b/lazy/src/component.rs
@@ -227,6 +227,10 @@ where
local_shell.revalidate_layout(|| shell.invalidate_layout());
+ if let Some(redraw_request) = local_shell.redraw_request() {
+ shell.request_redraw(redraw_request);
+ }
+
if !local_messages.is_empty() {
let mut heads = self.state.take().unwrap().into_heads();
@@ -307,6 +311,8 @@ where
}
self.with_element(|element| {
+ tree.diff_children(std::slice::from_ref(&element));
+
element.as_widget().operate(
&mut tree.children[0],
layout,
@@ -451,9 +457,9 @@ where
position: Point,
) -> layout::Node {
self.with_overlay_maybe(|overlay| {
- let vector = position - overlay.position();
+ let translation = position - overlay.position();
- overlay.layout(renderer, bounds).translate(vector)
+ overlay.layout(renderer, bounds, translation)
})
.unwrap_or_default()
}
@@ -559,4 +565,11 @@ where
event_status
}
+
+ fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
+ self.with_overlay_maybe(|overlay| {
+ overlay.is_over(layout, cursor_position)
+ })
+ .unwrap_or_default()
+ }
}
diff --git a/lazy/src/lazy.rs b/lazy/src/lazy.rs
index 933def96..5e909a49 100644
--- a/lazy/src/lazy.rs
+++ b/lazy/src/lazy.rs
@@ -313,9 +313,9 @@ where
position: Point,
) -> layout::Node {
self.with_overlay_maybe(|overlay| {
- let vector = position - overlay.position();
+ let translation = position - overlay.position();
- overlay.layout(renderer, bounds).translate(vector)
+ overlay.layout(renderer, bounds, translation)
})
.unwrap_or_default()
}
@@ -372,6 +372,13 @@ where
})
.unwrap_or(iced_native::event::Status::Ignored)
}
+
+ fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
+ self.with_overlay_maybe(|overlay| {
+ overlay.is_over(layout, cursor_position)
+ })
+ .unwrap_or_default()
+ }
}
impl<'a, Message, Renderer, Dependency, View>
diff --git a/lazy/src/responsive.rs b/lazy/src/responsive.rs
index 52badda2..93069493 100644
--- a/lazy/src/responsive.rs
+++ b/lazy/src/responsive.rs
@@ -356,9 +356,9 @@ where
position: Point,
) -> layout::Node {
self.with_overlay_maybe(|overlay| {
- let vector = position - overlay.position();
+ let translation = position - overlay.position();
- overlay.layout(renderer, bounds).translate(vector)
+ overlay.layout(renderer, bounds, translation)
})
.unwrap_or_default()
}
@@ -415,4 +415,11 @@ where
})
.unwrap_or(iced_native::event::Status::Ignored)
}
+
+ fn is_over(&self, layout: Layout<'_>, cursor_position: Point) -> bool {
+ self.with_overlay_maybe(|overlay| {
+ overlay.is_over(layout, cursor_position)
+ })
+ .unwrap_or_default()
+ }
}