summaryrefslogtreecommitdiffstats
path: root/examples/scrollable
diff options
context:
space:
mode:
authorLibravatar Austin M. Reppert <austinmreppert@protonmail.com>2023-05-26 20:27:17 -0400
committerLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-06-27 23:03:29 +0200
commitfa04f40524ab7a4ee23bcbc09bc4960c05b192db (patch)
tree6ae46c64ecd5687d5639e516eb90ce15ef1cf8f2 /examples/scrollable
parentf63a9d1a79eb7423bf5280585a36e2b42ab114a0 (diff)
downloadiced-fa04f40524ab7a4ee23bcbc09bc4960c05b192db.tar.gz
iced-fa04f40524ab7a4ee23bcbc09bc4960c05b192db.tar.bz2
iced-fa04f40524ab7a4ee23bcbc09bc4960c05b192db.zip
Make vertical scroll properties optional
Co-Authored-By: Austin M. Reppert <austinmreppert@gmail.com>
Diffstat (limited to 'examples/scrollable')
-rw-r--r--examples/scrollable/src/main.rs18
1 files changed, 9 insertions, 9 deletions
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,
)))