summaryrefslogtreecommitdiffstats
path: root/native/src/widget/row.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-08-05 22:31:26 +0200
committerLibravatar GitHub <noreply@github.com>2022-08-05 22:31:26 +0200
commitf294c2d16249ce8b7989f8af6332678f53d8fb12 (patch)
treebb8d6f00fe25de9187b1d3b90a88ae95225b7428 /native/src/widget/row.rs
parenta003e797e8a1bb5d365c1db5de6af88e61a47329 (diff)
parentad5bd0970d7106a97d455a164a582ab1d0bff18b (diff)
downloadiced-f294c2d16249ce8b7989f8af6332678f53d8fb12.tar.gz
iced-f294c2d16249ce8b7989f8af6332678f53d8fb12.tar.bz2
iced-f294c2d16249ce8b7989f8af6332678f53d8fb12.zip
Merge pull request #1399 from iced-rs/widget-operations
Widget Operations
Diffstat (limited to 'native/src/widget/row.rs')
-rw-r--r--native/src/widget/row.rs19
1 files changed, 18 insertions, 1 deletions
diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs
index c342c277..eda7c2d3 100644
--- a/native/src/widget/row.rs
+++ b/native/src/widget/row.rs
@@ -4,7 +4,7 @@ use crate::layout::{self, Layout};
use crate::mouse;
use crate::overlay;
use crate::renderer;
-use crate::widget::Tree;
+use crate::widget::{Operation, Tree};
use crate::{
Alignment, Clipboard, Element, Length, Padding, Point, Rectangle, Shell,
Widget,
@@ -130,6 +130,23 @@ where
)
}
+ fn operate(
+ &self,
+ tree: &mut Tree,
+ layout: Layout<'_>,
+ operation: &mut dyn Operation<Message>,
+ ) {
+ operation.container(None, &mut |operation| {
+ self.children
+ .iter()
+ .zip(&mut tree.children)
+ .zip(layout.children())
+ .for_each(|((child, state), layout)| {
+ child.as_widget().operate(state, layout, operation);
+ })
+ });
+ }
+
fn on_event(
&mut self,
tree: &mut Tree,