feat(iconsource): additional helper methods for creating handles

This commit is contained in:
Michael Aaron Murphy 2023-01-19 13:01:02 +01:00 committed by Michael Murphy
parent b3d550cc5e
commit 2b0227d34f
6 changed files with 37 additions and 9 deletions

View file

@ -29,11 +29,9 @@ impl<Message: 'static + Clone> From<NavBarToggle<Message>> for Element<'static,
fn from(nav_bar_toggle: NavBarToggle<Message>) -> Self {
let mut widget = super::icon(
if nav_bar_toggle.nav_bar_active {
IconSource::EmbeddedSvg(iced::widget::svg::Handle::from_memory(
&include_bytes!("../../res/sidebar-active.svg")[..],
))
IconSource::svg_from_memory(&include_bytes!("../../res/sidebar-active.svg")[..])
} else {
IconSource::Name("open-menu-symbolic".into())
IconSource::from("open-menu-symbolic")
},
16,
)