feat: transparent button style

This commit is contained in:
Ashley Wulber 2022-11-17 20:49:20 -05:00
parent 3850def414
commit a8c753d429
No known key found for this signature in database
GPG key ID: 5216D4F46A90A820
4 changed files with 36 additions and 9 deletions

View file

@ -1,4 +1,7 @@
use iced::{widget::{svg, Image}, Length};
use iced::{
widget::{svg, Image},
Length,
};
pub fn icon<Renderer>(name: &str, size: u16) -> svg::Svg<Renderer>
where
@ -23,11 +26,14 @@ where
.height(Length::Units(size))
}
pub fn image_icon(name: &str, size: u16) -> Option<Image>
{
pub fn image_icon(name: &str, size: u16) -> Option<Image> {
freedesktop_icons::lookup(name)
.with_size(size)
.with_cache()
.find().map(|path| Image::new(path).width(Length::Units(size))
.height(Length::Units(size)))
.find()
.map(|path| {
Image::new(path)
.width(Length::Units(size))
.height(Length::Units(size))
})
}