Improve Padding ergonomics

We expose free functions for creating a `Padding`
and methods with the same name to modify its fields.
This commit is contained in:
Héctor Ramón Jiménez 2024-07-12 18:40:54 +02:00
parent 915c926c28
commit 7c3341760d
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
5 changed files with 70 additions and 47 deletions

View file

@ -213,7 +213,7 @@ impl ScrollableDemo {
scroll_to_beginning_button(),
]
.align_x(Center)
.padding([40, 0, 40, 0])
.padding([40, 0])
.spacing(40),
)
.direction(scrollable::Direction::Vertical(
@ -239,7 +239,7 @@ impl ScrollableDemo {
]
.height(450)
.align_y(Center)
.padding([0, 40, 0, 40])
.padding([0, 40])
.spacing(40),
)
.direction(scrollable::Direction::Horizontal(
@ -281,7 +281,7 @@ impl ScrollableDemo {
scroll_to_beginning_button(),
]
.align_y(Center)
.padding([0, 40, 0, 40])
.padding([0, 40])
.spacing(40),
)
.direction({