mirror of
https://github.com/JakeStanger/ironbar.git
synced 2024-11-25 10:53:56 +03:00
fix(clipboard): crash when unsupported image type
This commit is contained in:
parent
3cd2fce333
commit
81c48fecad
@ -209,16 +209,24 @@ impl Module<Button> for ClipboardModule {
|
|||||||
64,
|
64,
|
||||||
true,
|
true,
|
||||||
Some(&Cancellable::new()),
|
Some(&Cancellable::new()),
|
||||||
)
|
);
|
||||||
.expect("Failed to read Pixbuf from stream");
|
|
||||||
let image = Image::from_pixbuf(Some(&pixbuf));
|
|
||||||
|
|
||||||
let button = RadioButton::from_widget(&hidden_option);
|
match pixbuf {
|
||||||
button.set_image(Some(&image));
|
Ok(pixbuf) => {
|
||||||
button.set_always_show_image(true);
|
let image = Image::from_pixbuf(Some(&pixbuf));
|
||||||
button.style_context().add_class("image");
|
|
||||||
|
|
||||||
button
|
let button = RadioButton::from_widget(&hidden_option);
|
||||||
|
button.set_image(Some(&image));
|
||||||
|
button.set_always_show_image(true);
|
||||||
|
button.style_context().add_class("image");
|
||||||
|
|
||||||
|
button
|
||||||
|
},
|
||||||
|
Err(err) => {
|
||||||
|
error!("{err:?}");
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
ClipboardValue::Other => unreachable!(),
|
ClipboardValue::Other => unreachable!(),
|
||||||
};
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user