fix: lifetime

This commit is contained in:
Ashley Wulber 2022-12-07 11:25:00 -05:00
parent 80cc66f18a
commit 7e00febc4d
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820

View file

@ -31,18 +31,6 @@ impl Default for CosmicAppletHelper {
} }
} }
// 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
// Renderer::Theme: iced_native::svg::StyleSheet + iced_style::button::StyleSheet,
// Renderer: iced_native::Renderer + iced_native::svg::Renderer + 'a,
// {
// button(icon_style).icon(name, pixels).style(icon_style))
// }
impl CosmicAppletHelper { impl CosmicAppletHelper {
pub fn suggested_icon_size(&self) -> u16 { pub fn suggested_icon_size(&self) -> u16 {
match self.size { match self.size {
@ -55,7 +43,7 @@ impl CosmicAppletHelper {
} }
pub fn icon_button<Message: 'static>(&self, icon_name: &'static str) -> widget::Button<'static, Message, Renderer> { pub fn icon_button<'a, Message: 'static>(&self, icon_name: &'a str) -> widget::Button<'a, Message, Renderer> {
crate::widget::button(crate::theme::Button::Text).icon(crate::theme::Svg::Symbolic, icon_name, self.suggested_icon_size()) crate::widget::button(crate::theme::Button::Text).icon(crate::theme::Svg::Symbolic, icon_name, self.suggested_icon_size())
} }