icon
This commit is contained in:
@@ -0,0 +1 @@
|
||||
app-icon ICON "icon.ico"
|
||||
+5
-5
@@ -73,14 +73,14 @@ fn main() {
|
||||
|
||||
// Create the tray application
|
||||
// On Linux: empty string works as a default/no icon
|
||||
// On Windows: use IconSource::Data with a 1x1 transparent icon
|
||||
// On Windows: try to load icon.ico, fallback to default
|
||||
#[cfg(unix)]
|
||||
let icon_source = IconSource::Resource("");
|
||||
#[cfg(windows)]
|
||||
let icon_source = IconSource::Data {
|
||||
rgba: &[0, 0, 0, 0], // 1x1 transparent black pixel
|
||||
width: 1,
|
||||
height: 1,
|
||||
let icon_source = if std::path::Path::new("icon.ico").exists() {
|
||||
IconSource::Resource("icon.ico")
|
||||
} else {
|
||||
IconSource::Resource("IDI_APPLICATION")
|
||||
};
|
||||
|
||||
let mut tray = TrayItem::new("Ambiligth", icon_source).unwrap();
|
||||
|
||||
Reference in New Issue
Block a user