Skip to content

Commit

Permalink
Implement Widget::operate for PaneGrid
Browse files Browse the repository at this point in the history
  • Loading branch information
rs017991 authored and hecrj committed Nov 13, 2022
1 parent 23299a5 commit 5419180
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,8 +38,8 @@ use crate::mouse;
use crate::overlay;
use crate::renderer;
use crate::touch;
use crate::widget::container;
use crate::widget::tree::{self, Tree};
use crate::widget::{container, Operation};
use crate::{
Clipboard, Color, Element, Layout, Length, Point, Rectangle, Shell, Size,
Vector, Widget,
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 5419180

Please sign in to comment.