refactor: accept icon name, and style in icon_button
This commit is contained in:
parent
33779b8652
commit
6f17328eb1
1 changed files with 2 additions and 2 deletions
|
|
@ -14,7 +14,7 @@ use crate::{
|
||||||
widget::icon,
|
widget::icon,
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn icon_button<'a, M: 'a, Renderer>() -> Button<'a, M, Renderer>
|
pub fn icon_button<'a, M: 'a, Renderer>(name: &str, icon_style: <Renderer::Theme as iced_native::svg::StyleSheet>::Style) -> Button<'a, M, Renderer>
|
||||||
where
|
where
|
||||||
Renderer::Theme: iced_native::svg::StyleSheet + iced_style::button::StyleSheet,
|
Renderer::Theme: iced_native::svg::StyleSheet + iced_style::button::StyleSheet,
|
||||||
Renderer: iced_native::Renderer + iced_native::svg::Renderer + 'a,
|
Renderer: iced_native::Renderer + iced_native::svg::Renderer + 'a,
|
||||||
|
|
@ -30,7 +30,7 @@ where
|
||||||
Err(_) => Some(12),
|
Err(_) => Some(12),
|
||||||
})
|
})
|
||||||
.unwrap_or(16);
|
.unwrap_or(16);
|
||||||
button!(icon("input-gaming-symbolic", pixels))
|
button!(icon(name, pixels).style(icon_style))
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn get_popup_settings(
|
pub fn get_popup_settings(
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue