From 493571695a8853ee91309a92d04b8dbea29bab8d Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Tue, 27 Jun 2023 22:30:54 +0200 Subject: Rename `ScrollbarProperties` to `Direction` in `scrollable` --- examples/scrollable/src/main.rs | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) (limited to 'examples/scrollable/src') diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs index 1ba81609..4104871f 100644 --- a/examples/scrollable/src/main.rs +++ b/examples/scrollable/src/main.rs @@ -1,12 +1,11 @@ -use iced::widget::scrollable::{ - Properties, ScrollbarProperties, Scrollbar, Scroller, -}; +use iced::widget::scrollable::{Properties, Scrollbar, Scroller}; use iced::widget::{ button, column, container, horizontal_space, progress_bar, radio, row, scrollable, slider, text, vertical_space, }; use iced::{executor, theme, Alignment, Color}; use iced::{Application, Command, Element, Length, Settings, Theme}; + use once_cell::sync::Lazy; static SCROLLABLE_ID: Lazy = Lazy::new(scrollable::Id::unique); @@ -201,7 +200,7 @@ impl Application for ScrollableDemo { .spacing(40), ) .height(Length::Fill) - .scrollbar_properties(ScrollbarProperties::Vertical( + .direction(scrollable::Direction::Vertical( Properties::new() .width(self.scrollbar_width) .margin(self.scrollbar_margin) @@ -225,7 +224,7 @@ impl Application for ScrollableDemo { .spacing(40), ) .height(Length::Fill) - .scrollbar_properties(ScrollbarProperties::Horizontal( + .direction(scrollable::Direction::Horizontal( Properties::new() .width(self.scrollbar_width) .margin(self.scrollbar_margin) @@ -266,16 +265,17 @@ impl Application for ScrollableDemo { .spacing(40), ) .height(Length::Fill) - .scrollbar_properties(ScrollbarProperties::Both( - Properties::new() - .width(self.scrollbar_width) - .margin(self.scrollbar_margin) - .scroller_width(self.scroller_width), - Properties::new() + .direction({ + let properties = Properties::new() .width(self.scrollbar_width) .margin(self.scrollbar_margin) - .scroller_width(self.scroller_width), - )) + .scroller_width(self.scroller_width); + + scrollable::Direction::Both { + horizontal: properties, + vertical: properties, + } + }) .style(theme::Scrollable::Custom(Box::new( ScrollbarCustomStyle, ))) -- cgit