From 18fb74f20092b2703a90afdb01f39754445998da Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Wed, 9 Nov 2022 04:05:31 +0100 Subject: Introduce `Custom` variants for every style in the built-in `Theme` --- native/src/widget/scrollable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'native/src/widget/scrollable.rs') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 4ebb07a0..b257cbe5 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -233,7 +233,7 @@ where self.scrollbar_width, self.scrollbar_margin, self.scroller_width, - self.style, + &self.style, |renderer, layout, cursor_position, viewport| { self.content.as_widget().draw( &tree.children[0], @@ -627,7 +627,7 @@ pub fn draw( scrollbar_width: u16, scrollbar_margin: u16, scroller_width: u16, - style: ::Style, + style: &::Style, draw_content: impl FnOnce(&mut Renderer, Layout<'_>, Point, &Rectangle), ) where Renderer: crate::Renderer, -- cgit 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 From f1ada7a803998ac3fb2c1bedc6d6650264f3e603 Mon Sep 17 00:00:00 2001 From: tarkah Date: Sat, 19 Nov 2022 12:25:59 -0800 Subject: Allow &mut self in overlay --- native/src/widget/scrollable.rs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'native/src/widget/scrollable.rs') diff --git a/native/src/widget/scrollable.rs b/native/src/widget/scrollable.rs index 32ec6eb3..495b7af1 100644 --- a/native/src/widget/scrollable.rs +++ b/native/src/widget/scrollable.rs @@ -276,13 +276,13 @@ where } fn overlay<'b>( - &'b self, + &'b mut self, tree: &'b mut Tree, layout: Layout<'_>, renderer: &Renderer, ) -> Option> { self.content - .as_widget() + .as_widget_mut() .overlay( &mut tree.children[0], layout.children().next().unwrap(), -- cgit