mirror of
https://github.com/Zedfrigg/ironbar.git
synced 2025-08-17 14:51:04 +02:00
refactor: take reference into image provider
This commit is contained in:
parent
df4bfc83d0
commit
cc6f21ed68
7 changed files with 11 additions and 10 deletions
|
@ -13,7 +13,7 @@ pub fn new_icon_button(input: &str, icon_theme: &IconTheme, size: i32) -> Button
|
|||
image.add_class("icon");
|
||||
|
||||
match ImageProvider::parse(input, icon_theme, false, size)
|
||||
.map(|provider| provider.load_into_image(image.clone()))
|
||||
.map(|provider| provider.load_into_image(&image))
|
||||
{
|
||||
Some(_) => {
|
||||
button.set_image(Some(&image));
|
||||
|
@ -42,7 +42,7 @@ pub fn new_icon_label(input: &str, icon_theme: &IconTheme, size: i32) -> gtk::Bo
|
|||
container.add(&image);
|
||||
|
||||
ImageProvider::parse(input, icon_theme, false, size)
|
||||
.map(|provider| provider.load_into_image(image));
|
||||
.map(|provider| provider.load_into_image(&image));
|
||||
} else {
|
||||
let label = Label::builder().use_markup(true).label(input).build();
|
||||
label.add_class("icon");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue