From 44aba47b0e67ce3cf1d5e8a79768e8fe996f5580 Mon Sep 17 00:00:00 2001 From: mtkennerly Date: Fri, 11 Nov 2022 08:44:10 +0800 Subject: Allow converting from widget-specific IDs to generic ID --- native/src/widget/scrollable.rs | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'native/src/widget/scrollable.rs') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index b257cbe5..32ec6eb3 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -334,6 +334,12 @@ impl Id { } } +impl From for widget::Id { + fn from(id: Id) -> Self { + id.0 + } +} + /// Produces a [`Command`] that snaps the [`Scrollable`] with the given [`Id`] /// to the provided `percentage`. pub fn snap_to(id: Id, percentage: f32) -> Command { -- cgit