fix(image): widgets missing names

This commit is contained in:
Jake Stanger 2023-02-02 20:37:02 +00:00
parent 2ac507144b
commit 7dff3e6f8b
No known key found for this signature in database
GPG Key ID: C51FC8F9CB0BEA61

View File

@ -9,6 +9,8 @@ pub fn new_icon_button(input: &str, icon_theme: &IconTheme, size: i32) -> Button
if ImageProvider::is_definitely_image_input(input) { if ImageProvider::is_definitely_image_input(input) {
let image = Image::new(); let image = Image::new();
image.set_widget_name("image");
match ImageProvider::parse(input, icon_theme, size) match ImageProvider::parse(input, icon_theme, size)
.and_then(|provider| provider.load_into_image(image.clone())) .and_then(|provider| provider.load_into_image(image.clone()))
{ {
@ -34,6 +36,8 @@ pub fn new_icon_label(input: &str, icon_theme: &IconTheme, size: i32) -> gtk::Bo
if ImageProvider::is_definitely_image_input(input) { if ImageProvider::is_definitely_image_input(input) {
let image = Image::new(); let image = Image::new();
image.set_widget_name("image");
container.add(&image); container.add(&image);
if let Err(err) = ImageProvider::parse(input, icon_theme, size) if let Err(err) = ImageProvider::parse(input, icon_theme, size)
@ -43,6 +47,8 @@ pub fn new_icon_label(input: &str, icon_theme: &IconTheme, size: i32) -> gtk::Bo
} }
} else { } else {
let label = Label::new(Some(input)); let label = Label::new(Some(input));
label.set_widget_name("label");
container.add(&label); container.add(&label);
} }