feat(icon): optimize & bundle icons with crabtime for non-unix platforms
This commit is contained in:
parent
ce0868582b
commit
639326fcc3
27 changed files with 128 additions and 189 deletions
|
|
@ -132,10 +132,6 @@ impl<'a, Message: Clone + 'static> From<Button<'a, Message>> for Element<'a, Mes
|
|||
fn from(mut builder: Button<'a, Message>) -> Element<'a, Message> {
|
||||
let mut content = Vec::with_capacity(2);
|
||||
|
||||
if let icon::Data::Name(ref mut named) = builder.variant.handle.data {
|
||||
named.size = Some(builder.icon_size);
|
||||
}
|
||||
|
||||
content.push(
|
||||
crate::widget::icon(builder.variant.handle.clone())
|
||||
.size(builder.icon_size)
|
||||
|
|
|
|||
|
|
@ -91,21 +91,15 @@ impl<Message> Button<'_, Message> {
|
|||
|
||||
impl<'a, Message: Clone + 'static> From<Button<'a, Message>> for Element<'a, Message> {
|
||||
fn from(mut builder: Button<'a, Message>) -> Element<'a, Message> {
|
||||
let trailing_icon = builder.variant.trailing_icon.map(|mut i| {
|
||||
if let icon::Data::Name(ref mut named) = i.data {
|
||||
named.size = Some(builder.icon_size);
|
||||
}
|
||||
let trailing_icon = builder
|
||||
.variant
|
||||
.trailing_icon
|
||||
.map(crate::widget::icon::Handle::icon);
|
||||
|
||||
i.icon()
|
||||
});
|
||||
|
||||
let leading_icon = builder.variant.leading_icon.map(|mut i| {
|
||||
if let icon::Data::Name(ref mut named) = i.data {
|
||||
named.size = Some(builder.icon_size);
|
||||
}
|
||||
|
||||
i.icon()
|
||||
});
|
||||
let leading_icon = builder
|
||||
.variant
|
||||
.leading_icon
|
||||
.map(crate::widget::icon::Handle::icon);
|
||||
|
||||
let label: Option<Element<'_, _>> = (!builder.label.is_empty()).then(|| {
|
||||
let font = crate::font::Font {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue