mirror of
https://github.com/szymon-jozef/libnotify-rs.git
synced 2026-10-27 19:20:43 +01:00
feat: implement set_app_icon
This commit is contained in:
@@ -169,8 +169,13 @@ pub fn set_app_name(app_name: &str) -> Result<(), Box<dyn std::error::Error>> {
|
|||||||
|
|
||||||
/// Sets the application icon.
|
/// Sets the application icon.
|
||||||
/// Available since: 0.8.4
|
/// Available since: 0.8.4
|
||||||
pub fn set_app_icon(app_icon: &str) {
|
///
|
||||||
todo!();
|
/// app_icon is icon name or path to an image
|
||||||
|
pub fn set_app_icon(app_icon: &str) -> Result<(), Box<dyn std::error::Error>> {
|
||||||
|
let app_icon_c = std::ffi::CString::new(app_icon)?;
|
||||||
|
unsafe { notify_set_app_icon(app_icon_c.as_ptr()) };
|
||||||
|
|
||||||
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|||||||
Reference in New Issue
Block a user