mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-03-30 08:31:08 +03:00
custom.txt and tray for mac
This commit is contained in:
18
src/tray.rs
18
src/tray.rs
@@ -205,15 +205,17 @@ async fn start_query_session_count(sender: std::sync::mpsc::Sender<Data>) {
|
||||
}
|
||||
|
||||
fn load_icon_from_asset() -> Option<image::DynamicImage> {
|
||||
let Some(path) = std::env::current_exe().map_or(None, |x| x.parent().map(|x| x.to_path_buf()))
|
||||
else {
|
||||
return None;
|
||||
};
|
||||
#[cfg(target_os = "macos")]
|
||||
let path = path.join("../Resources/AppIcon.icns");
|
||||
#[cfg(windows)]
|
||||
if let Ok(cmd) = std::env::current_exe() {
|
||||
let path = r".\data\flutter_assets\assets\icon.png";
|
||||
if let Some(path) = cmd.parent().map(|x| x.join(path)) {
|
||||
if path.exists() {
|
||||
if let Ok(image) = image::open(path) {
|
||||
return Some(image);
|
||||
}
|
||||
}
|
||||
let path = path.join(r"data\flutter_assets\assets\icon.png");
|
||||
if path.exists() {
|
||||
if let Ok(image) = image::open(path) {
|
||||
return Some(image);
|
||||
}
|
||||
}
|
||||
None
|
||||
|
||||
Reference in New Issue
Block a user