mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-22 05:34:04 +02:00
fixed instant crash
This commit is contained in:
parent
4954e374fe
commit
db9cbfbfc4
5 changed files with 36 additions and 6 deletions
|
@ -14,14 +14,15 @@ use tauri_plugin_window_state::{AppHandleExt, StateFlags, WindowExt};
|
|||
|
||||
fn main() {
|
||||
tauri::Builder::default()
|
||||
.plugin(tauri_plugin_clipboard_manager::init())
|
||||
.plugin(tauri_plugin_os::init())
|
||||
.plugin(tauri_plugin_global_shortcut::Builder::new().build())
|
||||
.plugin(tauri_plugin_window_state::Builder::default().build())
|
||||
.plugin(tauri_plugin_sql::Builder::default().build())
|
||||
.plugin(tauri_plugin_autostart::init(
|
||||
MacosLauncher::LaunchAgent,
|
||||
Some(vec![]),
|
||||
))
|
||||
.plugin(tauri_plugin_global_shortcut::Builder::new().build())
|
||||
.plugin(tauri_plugin_window_state::Builder::default().build())
|
||||
.plugin(tauri_plugin_sql::Builder::default().build())
|
||||
.setup(|app| {
|
||||
let app_handle = app.handle().clone();
|
||||
|
||||
|
|
|
@ -2,7 +2,6 @@ use tauri::{
|
|||
Manager,
|
||||
menu::{MenuBuilder, MenuItemBuilder},
|
||||
tray::{MouseButton, TrayIconBuilder, TrayIconEvent},
|
||||
image::Image,
|
||||
};
|
||||
|
||||
pub fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
||||
|
@ -10,6 +9,9 @@ pub fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
|||
let window_clone_for_tray = window.clone();
|
||||
let window_clone_for_click = window.clone();
|
||||
|
||||
let icon_bytes = include_bytes!("../icons/Square71x71Logo.png");
|
||||
let icon = tauri::image::Image::from_bytes(icon_bytes).unwrap();
|
||||
|
||||
let _tray = TrayIconBuilder::new()
|
||||
.menu(
|
||||
&MenuBuilder::new(app)
|
||||
|
@ -44,7 +46,7 @@ pub fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
|||
}
|
||||
}
|
||||
})
|
||||
.icon(Image::from_path("icons/Square71x71Logo.png").unwrap())
|
||||
.icon(icon)
|
||||
.build(app)?;
|
||||
|
||||
Ok(())
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue