refactor(widget): improvements to button and icon widgets

This commit is contained in:
Michael Aaron Murphy 2023-09-13 15:47:32 +02:00 committed by Michael Murphy
parent 7f0943924a
commit 9dbc1be269
20 changed files with 399 additions and 558 deletions

View file

@ -26,12 +26,10 @@ pub fn nav_bar_toggle<Message>() -> NavBarToggle<Message> {
impl<'a, Message: 'static + Clone> From<NavBarToggle<Message>> for Element<'a, Message> {
fn from(nav_bar_toggle: NavBarToggle<Message>) -> Self {
let icon = if nav_bar_toggle.active {
widget::icon::handle::from_svg_bytes(
&include_bytes!("../../res/sidebar-active.svg")[..],
)
.symbolic(true)
widget::icon::from_svg_bytes(&include_bytes!("../../res/sidebar-active.svg")[..])
.symbolic(true)
} else {
widget::icon::handle::from_name("open-menu-symbolic")
widget::icon::from_name("open-menu-symbolic")
.size(16)
.handle()
};