feat: implement tray in linux

This commit is contained in:
Kingtous
2022-11-04 19:20:51 +08:00
parent 884a223449
commit 220d056760
7 changed files with 117 additions and 14 deletions

View File

@@ -148,7 +148,7 @@ pub fn core_main() -> Option<Vec<String>> {
return None;
} else if args[0] == "--server" {
log::info!("start --server");
#[cfg(not(target_os = "macos"))]
#[cfg(target_os = "windows")]
{
crate::start_server(true);
return None;
@@ -158,6 +158,11 @@ pub fn core_main() -> Option<Vec<String>> {
std::thread::spawn(move || crate::start_server(true));
// to-do: for flutter, starting tray not ready yet, or we can reuse sciter's tray implementation.
}
#[cfg(all(target_os = "linux", feature = "flutter"))]
{
std::thread::spawn(move || crate::start_server(true));
crate::tray::start_tray(crate::ui_interface::OPTIONS.clone());
}
} else if args[0] == "--import-config" {
if args.len() == 2 {
let filepath;