summaryrefslogtreecommitdiffstats
path: root/examples/scrollable
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-27 22:30:54 +0200
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-27 23:04:49 +0200
commit493571695a8853ee91309a92d04b8dbea29bab8d (patch)
treecb21f9fffcf80332246c4355091f9424576e6201 /examples/scrollable
parentfa04f40524ab7a4ee23bcbc09bc4960c05b192db (diff)
downloadiced-493571695a8853ee91309a92d04b8dbea29bab8d.tar.gz
iced-493571695a8853ee91309a92d04b8dbea29bab8d.tar.bz2
iced-493571695a8853ee91309a92d04b8dbea29bab8d.zip
Rename `ScrollbarProperties` to `Direction` in `scrollable`
Diffstat (limited to 'examples/scrollable')
-rw-r--r--examples/scrollable/src/main.rs26
1 files changed, 13 insertions, 13 deletions
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<scrollable::Id> = 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,
)))