截图模块调整

This commit is contained in:
2026-08-01 22:24:33 +08:00
parent 89e5b7bed5
commit f51a7f894e
13 changed files with 2408 additions and 527 deletions
+21 -6
View File
@@ -1,4 +1,5 @@
use std::sync::Arc;
use tauri::Emitter;
use tauri::Manager;
mod clipboard;
@@ -45,10 +46,12 @@ use process_manager::{
stop_all_processes, stop_process, ProcessManager,
};
use screenshot::commands::{
screenshot_capture_fullscreen, screenshot_capture_window, screenshot_copy_image,
screenshot_crop_stored, screenshot_enum_windows, screenshot_get_editor_image,
screenshot_save_png, screenshot_set_editor_image, screenshot_take_fullscreen,
screenshot_window_from_point,
screenshot_capture_fullscreen, screenshot_capture_window, screenshot_clear_fullscreen,
screenshot_copy_image, screenshot_crop_copy_stored, screenshot_crop_stored,
screenshot_cursor_pos, screenshot_disable_transitions, screenshot_enum_windows,
screenshot_fullscreen_png, screenshot_get_editor_image, screenshot_get_fullscreen_bmp,
screenshot_register_shortcut, screenshot_save_png, screenshot_set_editor_image,
screenshot_unregister_shortcut, screenshot_window_from_point,
};
use clipboard::{
ClipboardManager,
@@ -94,6 +97,8 @@ pub fn run() {
.plugin(tauri_plugin_autostart::Builder::new().build())
.plugin(tauri_plugin_opener::init())
.plugin(tauri_plugin_dialog::init())
// 截图快捷键改由 screenshot::shortcut::register_shortcuton_shortcut)按需注册,
// 支持自定义;默认 Ctrl+Alt+A 由前端 store 启动时注册
.plugin(tauri_plugin_global_shortcut::Builder::new().build())
.plugin(tauri_plugin_notification::init())
.plugin(
@@ -195,15 +200,22 @@ pub fn run() {
tray_menu_ready,
snap_fix::fix_snap_background,
screenshot_capture_fullscreen,
screenshot_take_fullscreen,
screenshot_get_fullscreen_bmp,
screenshot_fullscreen_png,
screenshot_clear_fullscreen,
screenshot_crop_stored,
screenshot_crop_copy_stored,
screenshot_window_from_point,
screenshot_cursor_pos,
screenshot_enum_windows,
screenshot_capture_window,
screenshot_set_editor_image,
screenshot_get_editor_image,
screenshot_copy_image,
screenshot_save_png
screenshot_save_png,
screenshot_register_shortcut,
screenshot_unregister_shortcut,
screenshot_disable_transitions
])
.setup(|app| {
// 初始化日志系统,日志目录: {app_data_dir}/logs/
@@ -296,6 +308,9 @@ pub fn run() {
});
}
// 截图快捷键由前端 screenshotStore 启动时调用 screenshot_register_shortcut 注册
// (支持自定义,默认 Ctrl+Alt+A),此处不再硬编码注册
Ok(())
})
.on_window_event(|window, event| {