clean up
Rust / build (macos-latest, stable) (push) Canceled after 0s
Rust / build (ubuntu-latest, stable) (push) Canceled after 0s
Rust / build (windows-latest, stable) (push) Canceled after 0s
Rust / build (macos-latest, stable) (pull_request) Canceled after 0s
Rust / build (ubuntu-latest, stable) (pull_request) Canceled after 0s
Rust / build (windows-latest, stable) (pull_request) Canceled after 0s

This commit is contained in:
2026-11-12 10:36:53 +07:00
parent 4a871e417a
commit a27eca45c8
26 changed files with 1566 additions and 1352 deletions
+9 -9
View File
@@ -37,6 +37,15 @@ impl DialogHost {
}
}
impl Render for DialogHost {
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
div()
.absolute()
.inset_0()
.when_some(self.open.clone(), |host, view| host.child(view))
}
}
/// Replaces the mounted modal with `view`.
pub fn open_global(view: impl Into<AnyView>, cx: &mut App) {
let host = DialogHost::global(cx);
@@ -48,12 +57,3 @@ pub fn close_global(cx: &mut App) {
let host = DialogHost::global(cx);
host.update(cx, |host, cx| host.close(cx));
}
impl Render for DialogHost {
fn render(&mut self, _window: &mut Window, _cx: &mut Context<Self>) -> impl IntoElement {
div()
.absolute()
.inset_0()
.when_some(self.open.clone(), |host, view| host.child(view))
}
}
+13
View File
@@ -3,3 +3,16 @@ pub mod panels;
pub mod progress;
pub mod tree;
pub mod widgets;
/// Logs a discarded `Result` with its source location instead of dropping it silently.
#[track_caller]
pub fn log_dropped<T>(result: Result<T, anyhow::Error>) {
if let Err(error) = result {
let location = std::panic::Location::caller();
log::warn!(
"{}:{}: dropped result: {error}",
location.file(),
location.line()
);
}
}