Make Shrink have priority over Fill in layout
This commit is contained in:
parent
68c0484b5c
commit
0655a20ad1
46 changed files with 264 additions and 273 deletions
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue