mirror of
https://github.com/0PandaDEV/Qopy.git
synced 2025-04-21 13:14:04 +02:00
finally image support
This commit is contained in:
parent
bae359f1cf
commit
c67ed49c3d
9 changed files with 98 additions and 100 deletions
|
@ -12,7 +12,7 @@ use tauri::Manager;
|
|||
use tauri::PhysicalPosition;
|
||||
use tauri_plugin_autostart::MacosLauncher;
|
||||
|
||||
fn center_window_on_current_monitor(window: &tauri::Window) {
|
||||
fn center_window_on_current_monitor(window: &tauri::WebviewWindow) {
|
||||
if let Some(monitor) = window.current_monitor().unwrap() {
|
||||
let monitor_size = monitor.size();
|
||||
let window_size = window.outer_size().unwrap();
|
||||
|
@ -43,9 +43,9 @@ fn main() {
|
|||
hotkeys::setup(app_handle.clone());
|
||||
tray::setup(app)?;
|
||||
database::setup(app)?;
|
||||
clipboard::setup(app_handle);
|
||||
clipboard::setup(app_handle.clone());
|
||||
|
||||
if let Some(window) = app.get_window("main") {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
center_window_on_current_monitor(&window);
|
||||
window.hide().unwrap();
|
||||
}
|
||||
|
@ -60,15 +60,12 @@ fn main() {
|
|||
Ok(())
|
||||
})
|
||||
.on_window_event(|app, event| match event {
|
||||
#[cfg(not(dev))]
|
||||
tauri::WindowEvent::Focused(false) => {
|
||||
println!("Window lost focus");
|
||||
if let Some(window) = app.get_window("main") {
|
||||
if let Some(window) = app.get_webview_window("main") {
|
||||
window.hide().unwrap();
|
||||
}
|
||||
}
|
||||
tauri::WindowEvent::Focused(true) => {
|
||||
println!("Window gained focus");
|
||||
}
|
||||
_ => {}
|
||||
})
|
||||
.invoke_handler(tauri::generate_handler![clipboard::simulate_paste])
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue