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

@ -170,7 +170,7 @@ impl Example {
column![
column![
button(centered_text("Screenshot!"))
.padding([10, 20, 10, 20])
.padding([10, 20])
.width(Fill)
.on_press(Message::Screenshot),
if !self.png_saving {
@ -182,7 +182,7 @@ impl Example {
.style(button::secondary)
}
.style(button::secondary)
.padding([10, 20, 10, 20])
.padding([10, 20])
.width(Fill)
]
.spacing(10),
@ -191,7 +191,7 @@ impl Example {
button(centered_text("Crop"))
.on_press(Message::Crop)
.style(button::danger)
.padding([10, 20, 10, 20])
.padding([10, 20])
.width(Fill),
]
.spacing(10)