summaryrefslogtreecommitdiffstats
path: root/native/src/widget/scrollable.rs
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón <hector0193@gmail.com>2022-11-14 00:47:28 +0100
committerLibravatar GitHub <noreply@github.com>2022-11-14 00:47:28 +0100
commit23364bc4a2adb0c9c3be6449d7226784783c4abc (patch)
tree11df677e27827adb2589dbf409ad9d86bc090efd /native/src/widget/scrollable.rs
parentcf410a5e0b37c7f88ea33874796f0becbe970628 (diff)
parente56c45470c9a00e31d92e4e7d4b1cb1894d4de7d (diff)
downloadiced-23364bc4a2adb0c9c3be6449d7226784783c4abc.tar.gz
iced-23364bc4a2adb0c9c3be6449d7226784783c4abc.tar.bz2
iced-23364bc4a2adb0c9c3be6449d7226784783c4abc.zip
Merge pull request #1526 from mtkennerly/feature/find-focused
Add widget operation to find currently focused widget
Diffstat (limited to 'native/src/widget/scrollable.rs')
-rw-r--r--native/src/widget/scrollable.rs6
1 files changed, 6 insertions, 0 deletions
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<Id> 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<Message: 'static>(id: Id, percentage: f32) -> Command<Message> {