feat: managing dependencies and building on different platforms

This commit is contained in:
2025-04-29 16:48:04 +01:00
parent 9b006836c6
commit d102ab3f6e
5 changed files with 52 additions and 701 deletions

View File

@@ -6,6 +6,8 @@ use std::path::PathBuf;
use std::sync::mpsc::channel;
use tauri::AppHandle;
// TODO: we might be able to delete this soon.
#[tauri::command]
pub async fn handle_selected_folder(
path: String,

View File

@@ -1,18 +1,24 @@
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod window;
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod screenshot;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod commands;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod shortcut;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod state;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
mod utils;
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
use state::new_shared_watcher_state;
#[cfg(target_os = "linux")]
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
use window::setup_window;
#[cfg(any(target_os = "linux", target_os = "macos", target_os = "windows"))]
@@ -40,7 +46,7 @@ pub fn desktop() {
// .invoke_handler(tauri::generate_handler![commands::handle_selected_folder,])
.setup(|app| {
setup_window(app)?;
shortcut::enable_shortcut(app);
// shortcut::enable_shortcut(app);
Ok(())
})

View File

@@ -15,7 +15,9 @@ pub fn setup_window(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
let window = win_builder
.hidden_title(true)
.title_bar_style(TitleBarStyle::Transparent).build().unwrap();
.title_bar_style(TitleBarStyle::Transparent)
.build()
.unwrap();
let ns_window = window.ns_window().unwrap() as id;
unsafe {
@@ -30,5 +32,10 @@ pub fn setup_window(app: &mut App) -> Result<(), Box<dyn std::error::Error>> {
}
}
#[cfg(not(target_os = "macos"))]
{
let _ = win_builder.build().unwrap();
}
Ok(())
}