feat(icon): optimize & bundle icons with crabtime for non-unix platforms

This commit is contained in:
Michael Aaron Murphy 2025-11-11 23:02:57 +01:00 committed by Michael Murphy
parent ce0868582b
commit 639326fcc3
27 changed files with 128 additions and 189 deletions

View file

@ -28,18 +28,12 @@ pub const fn nav_bar_toggle<Message>() -> NavBarToggle<Message> {
impl<Message: 'static + Clone> From<NavBarToggle<Message>> for Element<'_, Message> {
fn from(nav_bar_toggle: NavBarToggle<Message>) -> Self {
let icon = if nav_bar_toggle.active {
widget::icon::from_svg_bytes(
&include_bytes!("../../res/icons/navbar-open-symbolic.svg")[..],
)
.symbolic(true)
"navbar-open-symbolic"
} else {
widget::icon::from_svg_bytes(
&include_bytes!("../../res/icons/navbar-closed-symbolic.svg")[..],
)
.symbolic(true)
"navbar-closed-symbolic"
};
widget::button::icon(icon)
widget::button::icon(widget::icon::from_name(icon))
.padding([8, 16])
.on_press_maybe(nav_bar_toggle.on_toggle)
.selected(nav_bar_toggle.selected)