Implement From<Option<T>> for Element

This commit is contained in:
Héctor Ramón Jiménez 2025-07-18 03:53:59 +02:00
parent dcea10f707
commit e0d9078334
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
9 changed files with 110 additions and 74 deletions

View file

@ -88,18 +88,18 @@ impl QRGenerator {
input,
row![toggle_total_size, choose_theme]
.spacing(20)
.align_y(Center)
.align_y(Center),
self.total_size.map(|total_size| {
slider(Self::SIZE_RANGE, total_size, Message::TotalSizeChanged)
}),
self.qr_code.as_ref().map(|data| {
if let Some(total_size) = self.total_size {
qr_code(data).total_size(total_size)
} else {
qr_code(data).cell_size(10.0)
}
})
]
.push_maybe(self.total_size.map(|total_size| {
slider(Self::SIZE_RANGE, total_size, Message::TotalSizeChanged)
}))
.push_maybe(self.qr_code.as_ref().map(|data| {
if let Some(total_size) = self.total_size {
qr_code(data).total_size(total_size)
} else {
qr_code(data).cell_size(10.0)
}
}))
.width(700)
.spacing(20)
.align_x(Center);