From fa04f40524ab7a4ee23bcbc09bc4960c05b192db Mon Sep 17 00:00:00 2001 From: "Austin M. Reppert" Date: Fri, 26 May 2023 20:27:17 -0400 Subject: Make vertical scroll properties optional Co-Authored-By: Austin M. Reppert --- examples/scrollable/src/main.rs | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'examples') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index 3038661e..1ba81609 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -1,4 +1,6 @@ -use iced::widget::scrollable::{Properties, Scrollbar, Scroller}; +use iced::widget::scrollable::{ + Properties, ScrollbarProperties, Scrollbar, Scroller, +}; use iced::widget::{ button, column, container, horizontal_space, progress_bar, radio, row, scrollable, slider, text, vertical_space, @@ -199,12 +201,12 @@ impl Application for ScrollableDemo { .spacing(40), ) .height(Length::Fill) - .vertical_scroll( + .scrollbar_properties(ScrollbarProperties::Vertical( Properties::new() .width(self.scrollbar_width) .margin(self.scrollbar_margin) .scroller_width(self.scroller_width), - ) + )) .id(SCROLLABLE_ID.clone()) .on_scroll(Message::Scrolled), Direction::Horizontal => scrollable( @@ -223,12 +225,12 @@ impl Application for ScrollableDemo { .spacing(40), ) .height(Length::Fill) - .horizontal_scroll( + .scrollbar_properties(ScrollbarProperties::Horizontal( Properties::new() .width(self.scrollbar_width) .margin(self.scrollbar_margin) .scroller_width(self.scroller_width), - ) + )) .style(theme::Scrollable::custom(ScrollbarCustomStyle)) .id(SCROLLABLE_ID.clone()) .on_scroll(Message::Scrolled), @@ -264,18 +266,16 @@ impl Application for ScrollableDemo { .spacing(40), ) .height(Length::Fill) - .vertical_scroll( + .scrollbar_properties(ScrollbarProperties::Both( Properties::new() .width(self.scrollbar_width) .margin(self.scrollbar_margin) .scroller_width(self.scroller_width), - ) - .horizontal_scroll( Properties::new() .width(self.scrollbar_width) .margin(self.scrollbar_margin) .scroller_width(self.scroller_width), - ) + )) .style(theme::Scrollable::Custom(Box::new( ScrollbarCustomStyle, ))) -- cgit