Write missing documentation in iced_native
This commit is contained in:
parent
13dd1ca0a8
commit
66f7d43dc9
8 changed files with 81 additions and 2 deletions
|
|
@ -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,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue