fix: menu bar and flex row event handling
This commit is contained in:
parent
7554540b78
commit
89ee66f251
2 changed files with 28 additions and 27 deletions
|
|
@ -160,22 +160,23 @@ impl<Message: 'static + Clone> Widget<Message, crate::Theme, Renderer> for FlexR
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
viewport: &Rectangle,
|
viewport: &Rectangle,
|
||||||
) {
|
) {
|
||||||
self.children
|
for ((child, state), c_layout) in self
|
||||||
|
.children
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.zip(&mut tree.children)
|
.zip(&mut tree.children)
|
||||||
.zip(layout.children())
|
.zip(layout.children())
|
||||||
.map(|((child, state), c_layout)| {
|
{
|
||||||
child.as_widget_mut().update(
|
child.as_widget_mut().update(
|
||||||
state,
|
state,
|
||||||
event,
|
event,
|
||||||
c_layout.with_virtual_offset(layout.virtual_offset()),
|
c_layout.with_virtual_offset(layout.virtual_offset()),
|
||||||
cursor,
|
cursor,
|
||||||
renderer,
|
renderer,
|
||||||
clipboard,
|
clipboard,
|
||||||
shell,
|
shell,
|
||||||
viewport,
|
viewport,
|
||||||
)
|
);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mouse_interaction(
|
fn mouse_interaction(
|
||||||
|
|
|
||||||
|
|
@ -810,21 +810,21 @@ fn process_root_events<Message>(
|
||||||
shell: &mut Shell<'_, Message>,
|
shell: &mut Shell<'_, Message>,
|
||||||
viewport: &Rectangle,
|
viewport: &Rectangle,
|
||||||
) {
|
) {
|
||||||
menu_roots
|
for ((root, t), lo) in menu_roots
|
||||||
.iter_mut()
|
.iter_mut()
|
||||||
.zip(&mut tree.children)
|
.zip(&mut tree.children)
|
||||||
.zip(layout.children())
|
.zip(layout.children())
|
||||||
.map(|((root, t), lo)| {
|
{
|
||||||
// assert!(t.tag == tree::Tag::stateless());
|
// assert!(t.tag == tree::Tag::stateless());
|
||||||
root.item.update(
|
root.item.update(
|
||||||
&mut t.children[root.index],
|
&mut t.children[root.index],
|
||||||
event,
|
event,
|
||||||
lo,
|
lo,
|
||||||
view_cursor,
|
view_cursor,
|
||||||
renderer,
|
renderer,
|
||||||
clipboard,
|
clipboard,
|
||||||
shell,
|
shell,
|
||||||
viewport,
|
viewport,
|
||||||
)
|
);
|
||||||
});
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue