Implement From<Option<T>> for Element
This commit is contained in:
parent
dcea10f707
commit
e0d9078334
9 changed files with 110 additions and 74 deletions
|
|
@ -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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue