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
25
src-tauri/Cargo.lock
generated
25
src-tauri/Cargo.lock
generated
|
@ -1834,8 +1834,13 @@ dependencies = [
|
||||||
"bytemuck",
|
"bytemuck",
|
||||||
"byteorder",
|
"byteorder",
|
||||||
"color_quant",
|
"color_quant",
|
||||||
|
"exr",
|
||||||
|
"gif",
|
||||||
|
"jpeg-decoder",
|
||||||
"num-traits",
|
"num-traits",
|
||||||
"png",
|
"png",
|
||||||
|
"qoi",
|
||||||
|
"tiff",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
|
@ -2014,6 +2019,9 @@ name = "jpeg-decoder"
|
||||||
version = "0.3.1"
|
version = "0.3.1"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0"
|
checksum = "f5d4a7da358eff58addd2877a45865158f0d78c911d43a5784ceb7bbf52833b0"
|
||||||
|
dependencies = [
|
||||||
|
"rayon",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "js-sys"
|
name = "js-sys"
|
||||||
|
@ -3147,6 +3155,7 @@ dependencies = [
|
||||||
"tauri",
|
"tauri",
|
||||||
"tauri-build",
|
"tauri-build",
|
||||||
"tauri-plugin-autostart",
|
"tauri-plugin-autostart",
|
||||||
|
"tauri-plugin-clipboard-manager",
|
||||||
"tauri-plugin-global-shortcut",
|
"tauri-plugin-global-shortcut",
|
||||||
"tauri-plugin-os",
|
"tauri-plugin-os",
|
||||||
"tauri-plugin-sql",
|
"tauri-plugin-sql",
|
||||||
|
@ -4490,6 +4499,22 @@ dependencies = [
|
||||||
"thiserror",
|
"thiserror",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "tauri-plugin-clipboard-manager"
|
||||||
|
version = "2.1.0-beta.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "e1d111ff331a3ef150a02eab7d7e8350bb7f92495ee272d6f22179b2e03feb66"
|
||||||
|
dependencies = [
|
||||||
|
"arboard",
|
||||||
|
"image 0.24.9",
|
||||||
|
"log",
|
||||||
|
"serde",
|
||||||
|
"serde_json",
|
||||||
|
"tauri",
|
||||||
|
"tauri-plugin",
|
||||||
|
"thiserror",
|
||||||
|
]
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "tauri-plugin-global-shortcut"
|
name = "tauri-plugin-global-shortcut"
|
||||||
version = "2.0.0-beta.7"
|
version = "2.0.0-beta.7"
|
||||||
|
|
|
@ -13,6 +13,7 @@ tauri-build = { version = "2.0.0-beta.18", features = [] }
|
||||||
tauri = { version = "2.0.0-beta.23", features = ["unstable", "tray-icon", "image-png"] }
|
tauri = { version = "2.0.0-beta.23", features = ["unstable", "tray-icon", "image-png"] }
|
||||||
tauri-plugin-window-state = "2.0.0-beta.10"
|
tauri-plugin-window-state = "2.0.0-beta.10"
|
||||||
tauri-plugin-sql = {version = "2.0.0-beta.8", features = ["sqlite"] }
|
tauri-plugin-sql = {version = "2.0.0-beta.8", features = ["sqlite"] }
|
||||||
|
tauri-plugin-clipboard-manager = "2.1.0-beta.5"
|
||||||
tauri-plugin-global-shortcut = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
|
tauri-plugin-global-shortcut = { git = "https://github.com/tauri-apps/plugins-workspace", branch = "v2" }
|
||||||
tauri-plugin-autostart = "2.0.0-beta.8"
|
tauri-plugin-autostart = "2.0.0-beta.8"
|
||||||
tauri-plugin-os = "2.0.0-beta.7"
|
tauri-plugin-os = "2.0.0-beta.7"
|
||||||
|
|
|
@ -33,6 +33,7 @@
|
||||||
"window:allow-show",
|
"window:allow-show",
|
||||||
"window:allow-set-focus",
|
"window:allow-set-focus",
|
||||||
"window:allow-is-focused",
|
"window:allow-is-focused",
|
||||||
"window:allow-is-visible"
|
"window:allow-is-visible",
|
||||||
|
"clipboard-manager:allow-write-text"
|
||||||
]
|
]
|
||||||
}
|
}
|
|
@ -14,14 +14,15 @@ use tauri_plugin_window_state::{AppHandleExt, StateFlags, WindowExt};
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
tauri::Builder::default()
|
tauri::Builder::default()
|
||||||
|
.plugin(tauri_plugin_clipboard_manager::init())
|
||||||
.plugin(tauri_plugin_os::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(
|
.plugin(tauri_plugin_autostart::init(
|
||||||
MacosLauncher::LaunchAgent,
|
MacosLauncher::LaunchAgent,
|
||||||
Some(vec![]),
|
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| {
|
.setup(|app| {
|
||||||
let app_handle = app.handle().clone();
|
let app_handle = app.handle().clone();
|
||||||
|
|
||||||
|
|
|
@ -2,7 +2,6 @@ use tauri::{
|
||||||
Manager,
|
Manager,
|
||||||
menu::{MenuBuilder, MenuItemBuilder},
|
menu::{MenuBuilder, MenuItemBuilder},
|
||||||
tray::{MouseButton, TrayIconBuilder, TrayIconEvent},
|
tray::{MouseButton, TrayIconBuilder, TrayIconEvent},
|
||||||
image::Image,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
pub fn setup(app: &mut tauri::App) -> Result<(), Box<dyn std::error::Error>> {
|
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_tray = window.clone();
|
||||||
let window_clone_for_click = 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()
|
let _tray = TrayIconBuilder::new()
|
||||||
.menu(
|
.menu(
|
||||||
&MenuBuilder::new(app)
|
&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)?;
|
.build(app)?;
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue