feat(iconsource): additional helper methods for creating handles

This commit is contained in:
Michael Aaron Murphy 2023-01-19 13:01:02 +01:00
parent 01783e6b59
commit e5b06359e4
No known key found for this signature in database
GPG key ID: B2732D4240C9212C
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,
)