summaryrefslogtreecommitdiffstats
path: root/examples/scrollable
diff options
context:
space:
mode:
authorLibravatar Héctor Ramón Jiménez <hector0193@gmail.com>2023-03-16 20:23:25 +0100
committerLibravatar Héctor Ramón Jiménez <hector@hecrj.dev>2024-01-04 06:51:21 +0100
commit0655a20ad119e2e9790afcc45039fd4ac0e7d432 (patch)
tree0ce316e386e5b47b6ca80fe16f0a384ef05ff4e8 /examples/scrollable
parent68c0484b5cf6f572e4cb0bf72c22c1a93dbb654e (diff)
downloadiced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.tar.gz
iced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.tar.bz2
iced-0655a20ad119e2e9790afcc45039fd4ac0e7d432.zip
Make `Shrink` have priority over `Fill` in layout
Diffstat (limited to 'examples/scrollable')
-rw-r--r--examples/scrollable/src/main.rs29
1 files changed, 10 insertions, 19 deletions
diff --git a/examples/scrollable/src/main.rs b/examples/scrollable/src/main.rs
index d82ea841..1042e7a4 100644
--- a/examples/scrollable/src/main.rs
+++ b/examples/scrollable/src/main.rs
@@ -147,35 +147,30 @@ impl Application for ScrollableDemo {
text("Scroller width:"),
scroller_width_slider,
]
- .spacing(10)
- .width(Length::Fill);
+ .spacing(10);
- let scroll_orientation_controls = column(vec![
- text("Scrollbar direction:").into(),
+ let scroll_orientation_controls = column![
+ text("Scrollbar direction:"),
radio(
"Vertical",
Direction::Vertical,
Some(self.scrollable_direction),
Message::SwitchDirection,
- )
- .into(),
+ ),
radio(
"Horizontal",
Direction::Horizontal,
Some(self.scrollable_direction),
Message::SwitchDirection,
- )
- .into(),
+ ),
radio(
"Both!",
Direction::Multi,
Some(self.scrollable_direction),
Message::SwitchDirection,
- )
- .into(),
- ])
- .spacing(10)
- .width(Length::Fill);
+ ),
+ ]
+ .spacing(10);
let scroll_alignment_controls = column(vec![
text("Scrollable alignment:").into(),
@@ -194,16 +189,14 @@ impl Application for ScrollableDemo {
)
.into(),
])
- .spacing(10)
- .width(Length::Fill);
+ .spacing(10);
let scroll_controls = row![
scroll_slider_controls,
scroll_orientation_controls,
scroll_alignment_controls
]
- .spacing(20)
- .width(Length::Fill);
+ .spacing(20);
let scroll_to_end_button = || {
button("Scroll to end")
@@ -229,7 +222,6 @@ impl Application for ScrollableDemo {
text("End!"),
scroll_to_beginning_button(),
]
- .width(Length::Fill)
.align_items(Alignment::Center)
.padding([40, 0, 40, 0])
.spacing(40),
@@ -341,7 +333,6 @@ impl Application for ScrollableDemo {
let content: Element<Message> =
column![scroll_controls, scrollable_content, progress_bars]
- .width(Length::Fill)
.height(Length::Fill)
.align_items(Alignment::Center)
.spacing(10)