feat: transparent button style
This commit is contained in:
parent
3850def414
commit
a8c753d429
4 changed files with 36 additions and 9 deletions
|
|
@ -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))
|
||||
})
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue