diff options
| author | 2021-10-18 16:48:39 +0700 | |
|---|---|---|
| committer | 2021-10-18 16:48:39 +0700 | |
| commit | 14dc750149b6cfaa49ba8fe3533343e0594fc2a3 (patch) | |
| tree | 24659ec87f6fcf3753fc082887e8425b53986b78 /native | |
| parent | 519a0cc233ac915c3a5df2bd81d1375edb05a4ae (diff) | |
| download | iced-14dc750149b6cfaa49ba8fe3533343e0594fc2a3.tar.gz iced-14dc750149b6cfaa49ba8fe3533343e0594fc2a3.tar.bz2 iced-14dc750149b6cfaa49ba8fe3533343e0594fc2a3.zip | |
Implement `Widget::mouse_interaction` for `Row`
Diffstat (limited to '')
| -rw-r--r-- | native/src/widget/row.rs | 21 | 
1 files changed, 21 insertions, 0 deletions
| diff --git a/native/src/widget/row.rs b/native/src/widget/row.rs index af63c7da..af83f106 100644 --- a/native/src/widget/row.rs +++ b/native/src/widget/row.rs @@ -1,6 +1,7 @@  //! Distribute content horizontally.  use crate::event::{self, Event};  use crate::layout; +use crate::mouse;  use crate::overlay;  use crate::renderer;  use crate::{ @@ -162,6 +163,26 @@ where              .fold(event::Status::Ignored, event::Status::merge)      } +    fn mouse_interaction( +        &self, +        layout: Layout<'_>, +        viewport: &Rectangle, +        cursor_position: Point, +    ) -> mouse::Interaction { +        self.children +            .iter() +            .zip(layout.children()) +            .map(|(child, layout)| { +                child.widget.mouse_interaction( +                    layout, +                    viewport, +                    cursor_position, +                ) +            }) +            .max() +            .unwrap_or_default() +    } +      fn draw(          &self,          renderer: &mut Renderer, | 
