summaryrefslogtreecommitdiffstats
path: root/widget/src/scrollable.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-07-12 09:26:13 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-07-12 09:26:13 +0200
commit44460f7b8b9e90c85bd94c19dd15d418e641f8cd (patch)
treeb66c1d31aab754b8fa4c4f8ccb66a1561f397dd8 /widget/src/scrollable.rs
parentd79cedd8da99345947f5b9fcb1ebc3a145cc4112 (diff)
downloadiced-44460f7b8b9e90c85bd94c19dd15d418e641f8cd.tar.gz
iced-44460f7b8b9e90c85bd94c19dd15d418e641f8cd.tar.bz2
iced-44460f7b8b9e90c85bd94c19dd15d418e641f8cd.zip
Remove public fields from `Viewport`
Let's tackle use cases directly instead!
Diffstat (limited to 'widget/src/scrollable.rs')
-rw-r--r--widget/src/scrollable.rs34
1 files changed, 3 insertions, 31 deletions
diff --git a/widget/src/scrollable.rs b/widget/src/scrollable.rs
index 3912f445..b6111975 100644
--- a/widget/src/scrollable.rs
+++ b/widget/src/scrollable.rs
@@ -577,15 +577,7 @@ pub fn update<Message>(
content_bounds,
);
- notify_on_scroll(
- state,
- on_scroll,
- bounds,
- content_bounds,
- horizontal_alignment,
- vertical_alignment,
- shell,
- );
+ notify_on_scroll(state, on_scroll, bounds, content_bounds, shell);
return event::Status::Captured;
}
@@ -631,8 +623,6 @@ pub fn update<Message>(
on_scroll,
bounds,
content_bounds,
- horizontal_alignment,
- vertical_alignment,
shell,
);
}
@@ -679,8 +669,6 @@ pub fn update<Message>(
on_scroll,
bounds,
content_bounds,
- horizontal_alignment,
- vertical_alignment,
shell,
);
@@ -717,8 +705,6 @@ pub fn update<Message>(
on_scroll,
bounds,
content_bounds,
- horizontal_alignment,
- vertical_alignment,
shell,
);
}
@@ -760,8 +746,6 @@ pub fn update<Message>(
on_scroll,
bounds,
content_bounds,
- horizontal_alignment,
- vertical_alignment,
shell,
);
}
@@ -798,8 +782,6 @@ pub fn update<Message>(
on_scroll,
bounds,
content_bounds,
- horizontal_alignment,
- vertical_alignment,
shell,
);
@@ -1015,8 +997,6 @@ fn notify_on_scroll<Message>(
on_scroll: &Option<Box<dyn Fn(Viewport) -> Message + '_>>,
bounds: Rectangle,
content_bounds: Rectangle,
- horizontal_alignment: Alignment,
- vertical_alignment: Alignment,
shell: &mut Shell<'_, Message>,
) {
if let Some(on_scroll) = on_scroll {
@@ -1031,8 +1011,6 @@ fn notify_on_scroll<Message>(
offset_y: state.offset_y,
bounds,
content_bounds,
- horizontal_alignment,
- vertical_alignment,
};
// Don't publish redundant viewports to shell
@@ -1121,14 +1099,8 @@ impl Offset {
pub struct Viewport {
offset_x: Offset,
offset_y: Offset,
- /// The viewport bounds of the [`Scrollable`].
- pub bounds: Rectangle,
- /// The content bounds of the [`Scrollable`].
- pub content_bounds: Rectangle,
- /// The horizontal [`Alignment`] of the [`Scrollable`].
- pub horizontal_alignment: Alignment,
- /// The vertical [`Alignment`] of the [`Scrollable`].
- pub vertical_alignment: Alignment,
+ bounds: Rectangle,
+ content_bounds: Rectangle,
}
impl Viewport {