Skip to content

Commit

Permalink
Fixed Operations within PaneGrid
Browse files Browse the repository at this point in the history
  • Loading branch information
rs017991 committed Nov 13, 2022
1 parent 23299a5 commit f53692c
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion native/src/widget/pane_grid.rs
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ use crate::mouse;
use crate::overlay;
use crate::renderer;
use crate::touch;
use crate::widget::container;
use crate::widget::{container, Operation};
use crate::widget::tree::{self, Tree};
use crate::{
Clipboard, Color, Element, Layout, Length, Point, Rectangle, Shell, Size,
Expand Down Expand Up @@ -289,6 +289,23 @@ where
)
}

fn operate(
&self,
tree: &mut Tree,
layout: Layout<'_>,
operation: &mut dyn Operation<Message>,
) {
operation.container(None, &mut |operation| {
self.contents
.iter()
.zip(&mut tree.children)
.zip(layout.children())
.for_each(|(((_pane, content), state), layout)| {
content.operate(state, layout, operation);
})
});
}

fn on_event(
&mut self,
tree: &mut Tree,
Expand Down

0 comments on commit f53692c

Please sign in to comment.