Skip to content

Commit

Permalink
feat: clicking notifs focuses dorion
Browse files Browse the repository at this point in the history
  • Loading branch information
SpikeHD committed Dec 15, 2024
1 parent c683b8a commit 743de35
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src-tauri/src/util/notifications.rs
Original file line number Diff line number Diff line change
Expand Up @@ -72,12 +72,22 @@ fn send_notification_internal(app: &tauri::AppHandle, title: String, body: Strin
fn send_notification_internal(app: &tauri::AppHandle, title: String, body: String, icon: String) {
use std::path::Path;
use tauri_winrt_notification::{IconCrop, Toast};
use crate::util::window_helpers::ultrashow;

let win = app.get_webview_window("main");

Toast::new(&app.config().identifier)
.icon(Path::new(&icon), IconCrop::Circular, "")
.title(title.as_str())
.text2(body.as_str())
.sound(None)
.on_activated(move |_s| {
if let Some(win) = &win {
ultrashow(win.clone());
}

Ok(())
})
.show()
.unwrap_or_else(|e| log!("Failed to send notification: {:?}", e));
}
Expand Down

0 comments on commit 743de35

Please sign in to comment.