diff options
author | 2023-06-08 20:11:59 +0200 | |
---|---|---|
committer | 2023-06-08 20:11:59 +0200 | |
commit | 34451bff185d8875f55747ee97ed746828e30f40 (patch) | |
tree | 4cec93d3893aa6b744468af67e672383c6770afd /widget/src/row.rs | |
parent | c15f1b5f6575792cc89bb5fba2e613428397e46a (diff) | |
download | iced-34451bff185d8875f55747ee97ed746828e30f40.tar.gz iced-34451bff185d8875f55747ee97ed746828e30f40.tar.bz2 iced-34451bff185d8875f55747ee97ed746828e30f40.zip |
Implement basic cursor availability
Diffstat (limited to 'widget/src/row.rs')
-rw-r--r-- | widget/src/row.rs | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/widget/src/row.rs b/widget/src/row.rs index 3ce363f8..1db22416 100644 --- a/widget/src/row.rs +++ b/widget/src/row.rs @@ -6,8 +6,8 @@ use crate::core::overlay; use crate::core::renderer; use crate::core::widget::{Operation, Tree}; use crate::core::{ - Alignment, Clipboard, Element, Length, Padding, Pixels, Point, Rectangle, - Shell, Widget, + Alignment, Clipboard, Element, Length, Padding, Pixels, Rectangle, Shell, + Widget, }; /// A container that distributes its contents horizontally. @@ -155,7 +155,7 @@ where tree: &mut Tree, event: Event, layout: Layout<'_>, - cursor_position: Point, + cursor: mouse::Cursor, renderer: &Renderer, clipboard: &mut dyn Clipboard, shell: &mut Shell<'_, Message>, @@ -169,7 +169,7 @@ where state, event.clone(), layout, - cursor_position, + cursor, renderer, clipboard, shell, @@ -182,7 +182,7 @@ where &self, tree: &Tree, layout: Layout<'_>, - cursor_position: Point, + cursor: mouse::Cursor, viewport: &Rectangle, renderer: &Renderer, ) -> mouse::Interaction { @@ -192,11 +192,7 @@ where .zip(layout.children()) .map(|((child, state), layout)| { child.as_widget().mouse_interaction( - state, - layout, - cursor_position, - viewport, - renderer, + state, layout, cursor, viewport, renderer, ) }) .max() @@ -210,7 +206,7 @@ where theme: &Renderer::Theme, style: &renderer::Style, layout: Layout<'_>, - cursor_position: Point, + cursor: mouse::Cursor, viewport: &Rectangle, ) { for ((child, state), layout) in self @@ -219,15 +215,9 @@ where .zip(&tree.children) .zip(layout.children()) { - child.as_widget().draw( - state, - renderer, - theme, - style, - layout, - cursor_position, - viewport, - ); + child + .as_widget() + .draw(state, renderer, theme, style, layout, cursor, viewport); } } |