Write missing documentation in iced_native

This commit is contained in:
Héctor Ramón Jiménez 2022-08-05 05:15:41 +02:00
parent 13dd1ca0a8
commit 66f7d43dc9
No known key found for this signature in database
GPG key ID: 140CC052C94F138E
8 changed files with 81 additions and 2 deletions

View file

@ -1,9 +1,14 @@
//! Operate on widgets that can be scrolled.
use crate::widget::{Id, Operation};
/// The internal state of a widget that can be scrolled.
pub trait Scrollable {
/// Snaps the scroll of the widget to the given `percentage`.
fn snap_to(&mut self, percentage: f32);
}
/// Produces an [`Operation`] that snaps the widget with the given [`Id`] to
/// the provided `percentage`.
pub fn snap_to<T>(target: Id, percentage: f32) -> impl Operation<T> {
struct SnapTo {
target: Id,