mirror of
https://github.com/rustdesk/rustdesk.git
synced 2024-12-12 10:19:09 +08:00
Merge pull request #4611 from NicKoehler/linux-tray
linux tray as mac tray
This commit is contained in:
commit
d8cf18e56d
@ -127,6 +127,8 @@ dbus = "0.9"
|
|||||||
dbus-crossroads = "0.5"
|
dbus-crossroads = "0.5"
|
||||||
pam = { git="https://github.com/fufesou/pam", optional = true }
|
pam = { git="https://github.com/fufesou/pam", optional = true }
|
||||||
users = { version = "0.11" }
|
users = { version = "0.11" }
|
||||||
|
dark-light = "1.0"
|
||||||
|
|
||||||
|
|
||||||
[target.'cfg(target_os = "android")'.dependencies]
|
[target.'cfg(target_os = "android")'.dependencies]
|
||||||
android_logger = "0.13"
|
android_logger = "0.13"
|
||||||
|
Before Width: | Height: | Size: 703 B After Width: | Height: | Size: 703 B |
Before Width: | Height: | Size: 728 B After Width: | Height: | Size: 728 B |
@ -12,17 +12,17 @@ pub fn make_tray() -> hbb_common::ResultType<()> {
|
|||||||
TrayEvent, TrayIconBuilder,
|
TrayEvent, TrayIconBuilder,
|
||||||
};
|
};
|
||||||
let icon;
|
let icon;
|
||||||
#[cfg(target_os = "macos")]
|
#[cfg(any(target_os = "macos", target_os = "linux"))]
|
||||||
{
|
{
|
||||||
let mode = dark_light::detect();
|
let mode = dark_light::detect();
|
||||||
const LIGHT: &[u8] = include_bytes!("../res/mac-tray-light-x2.png");
|
const LIGHT: &[u8] = include_bytes!("../res/outlined-tray-light-x2.png");
|
||||||
const DARK: &[u8] = include_bytes!("../res/mac-tray-dark-x2.png");
|
const DARK: &[u8] = include_bytes!("../res/outlined-tray-dark-x2.png");
|
||||||
icon = match mode {
|
icon = match mode {
|
||||||
dark_light::Mode::Dark => LIGHT,
|
dark_light::Mode::Dark => LIGHT,
|
||||||
_ => DARK,
|
_ => DARK,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
#[cfg(not(target_os = "macos"))]
|
#[cfg(target_os = "windows")]
|
||||||
{
|
{
|
||||||
icon = include_bytes!("../res/tray-icon.ico");
|
icon = include_bytes!("../res/tray-icon.ico");
|
||||||
}
|
}
|
||||||
@ -74,6 +74,7 @@ pub fn make_tray() -> hbb_common::ResultType<()> {
|
|||||||
.spawn()
|
.spawn()
|
||||||
.ok();
|
.ok();
|
||||||
}
|
}
|
||||||
|
// xdg-open?
|
||||||
#[cfg(target_os = "linux")]
|
#[cfg(target_os = "linux")]
|
||||||
if !std::process::Command::new("xdg-open")
|
if !std::process::Command::new("xdg-open")
|
||||||
.arg("rustdesk://")
|
.arg("rustdesk://")
|
||||||
|
Loading…
Reference in New Issue
Block a user