Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions native/src/widget/scrollable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -392,6 +392,15 @@ pub fn snap_to<Message: 'static>(
Command::widget(operation::scrollable::snap_to(id.0, offset))
}

/// Produces a [`Command`] that scrolls the [`Scrollable`] with the given [`Id`]
/// to the provided [`AbsoluteOffset`] along the x & y axis.
pub fn scroll_to<Message: 'static>(
id: Id,
offset: AbsoluteOffset,
) -> Command<Message> {
Command::widget(operation::scrollable::scroll_to(id.0, offset))
}

/// Computes the layout of a [`Scrollable`].
pub fn layout<Renderer>(
renderer: &Renderer,
Expand Down
4 changes: 2 additions & 2 deletions src/widget.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,8 +109,8 @@ pub mod radio {
pub mod scrollable {
//! Navigate an endless amount of content with a scrollbar.
pub use iced_native::widget::scrollable::{
snap_to, style::Scrollbar, style::Scroller, AbsoluteOffset, Id,
Properties, RelativeOffset, StyleSheet, Viewport,
scroll_to, snap_to, style::Scrollbar, style::Scroller, AbsoluteOffset,
Id, Properties, RelativeOffset, StyleSheet, Viewport,
};

/// A widget that can vertically display an infinite amount of content
Expand Down