Move more code to libcosmic

This commit is contained in:
Jeremy Soller 2022-09-30 09:51:00 -06:00
parent 5ad54bd3b1
commit bfcaf829eb
No known key found for this signature in database
GPG key ID: 87F211AF2BE4C2FE
4 changed files with 56 additions and 41 deletions

View file

@ -1,4 +1,7 @@
use iced::widget::svg;
use iced::{
Length,
widget::svg,
};
pub fn icon(name: &str, size: u16) -> svg::Svg {
let handle = match freedesktop_icons::lookup(name)
@ -15,4 +18,6 @@ pub fn icon(name: &str, size: u16) -> svg::Svg {
},
};
svg::Svg::new(handle)
.width(Length::Units(size))
.height(Length::Units(size))
}