mirror of
https://github.com/tauri-apps/plugins-workspace.git
synced 2026-09-26 21:41:48 +02:00
chore: edition 2024
This commit is contained in:
@@ -3,7 +3,7 @@ name = "api"
|
||||
publish = false
|
||||
version = "2.0.49"
|
||||
description = "An example Tauri Application showcasing the api"
|
||||
edition = "2021"
|
||||
edition = "2024"
|
||||
rust-version = { workspace = true }
|
||||
license = "Apache-2.0 OR MIT"
|
||||
|
||||
|
||||
@@ -8,8 +8,8 @@ mod tray;
|
||||
|
||||
use serde::Serialize;
|
||||
use tauri::{
|
||||
webview::{PageLoadEvent, WebviewWindowBuilder},
|
||||
App, AppHandle, Emitter, Listener, RunEvent, WebviewUrl,
|
||||
webview::{PageLoadEvent, WebviewWindowBuilder},
|
||||
};
|
||||
|
||||
#[derive(Clone, Serialize)]
|
||||
@@ -204,12 +204,11 @@ pub fn run() {
|
||||
|
||||
app.run(move |_app_handle, _event| {
|
||||
#[cfg(desktop)]
|
||||
if let RunEvent::ExitRequested { code, api, .. } = &_event {
|
||||
if code.is_none() {
|
||||
if let RunEvent::ExitRequested { code, api, .. } = &_event
|
||||
&& code.is_none() {
|
||||
// Keep the event loop running even if all windows are closed
|
||||
// This allow us to catch system tray events when there is no window
|
||||
api.prevent_exit();
|
||||
}
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
|
||||
use std::sync::atomic::{AtomicBool, Ordering};
|
||||
use tauri::{
|
||||
Manager, Runtime, WebviewUrl, WebviewWindowBuilder,
|
||||
menu::{Menu, MenuItem},
|
||||
tray::{MouseButton, MouseButtonState, TrayIconBuilder, TrayIconEvent},
|
||||
Manager, Runtime, WebviewUrl, WebviewWindowBuilder,
|
||||
};
|
||||
|
||||
pub fn create_tray<R: Runtime>(app: &tauri::AppHandle<R>) -> tauri::Result<()> {
|
||||
|
||||
Reference in New Issue
Block a user