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

@ -42,7 +42,7 @@ impl<'a, Message: 'static + Clone> Field<'a, Message> {
row::with_capacity(3)
.push(
icon::handle::from_svg_bytes(&include_bytes!("search.svg")[..])
icon::from_svg_bytes(&include_bytes!("search.svg")[..])
.symbolic(true)
.icon()
.size(16),
@ -67,7 +67,7 @@ impl<'a, Message: 'static + Clone> From<Field<'a, Message>> for crate::Element<'
}
fn clear_button<Message: 'static>() -> crate::widget::IconButton<'static, Message> {
icon::handle::from_name("edit-clear-symbolic")
icon::from_name("edit-clear-symbolic")
.size(16)
.apply(crate::widget::button::icon)
}

View file

@ -49,7 +49,7 @@ mod button {
/// A search button which converts to a search [`field`] on click.
#[must_use]
pub fn button<Message: 'static + Clone>(on_press: Message) -> crate::Element<'static, Message> {
icon::handle::from_svg_bytes(&include_bytes!("search.svg")[..])
icon::from_svg_bytes(&include_bytes!("search.svg")[..])
.symbolic(true)
.apply(crate::widget::button::icon)
.on_press(on_press)