Clean up shared UI runtime state

This commit is contained in:
iris committed 2026-09-11 00:55:33 -04:00
1 parent 9b4c690916
commit 5ca244528f
27 files changed
+355 -499

No files matched your search

+22
View File
@@ -0,0 +1,22 @@
use crate::platform::OpenUrl;
use crate::prelude::HasDesktopUiState;
impl<T: HasDesktopUiState> OpenUrl for T {
fn open_url(&mut self, url: &str) {
let (program, first): (&str, &[&str]) = if cfg!(target_os = "macos") {
("open", &[])
} else if cfg!(target_os = "windows") {
("cmd", &["/C", "start", ""])
} else {
("xdg-open", &[])
};
match std::process::Command::new(program)
.args(first)
.arg(url)
.spawn()
{
Ok(_) => {}
Err(e) => log::warn!("could not open {url} with {program}: {e}"),
}
}
}