diff --git a/src-tauri/Cargo.lock b/src-tauri/Cargo.lock index 1f43f65..75b2ce6 100644 --- a/src-tauri/Cargo.lock +++ b/src-tauri/Cargo.lock @@ -1523,6 +1523,7 @@ name = "haystack" version = "0.1.0" dependencies = [ "base64 0.21.7", + "cocoa", "notify", "serde", "serde_json", diff --git a/src-tauri/Cargo.toml b/src-tauri/Cargo.toml index 2bfc778..90f3c4d 100644 --- a/src-tauri/Cargo.toml +++ b/src-tauri/Cargo.toml @@ -18,7 +18,7 @@ crate-type = ["staticlib", "cdylib", "rlib"] tauri-build = { version = "2", features = [] } [dependencies] -tauri = { version = "2", features = [] } +tauri = { version = "2", features = ["macos-private-api"] } tauri-plugin-opener = "2" serde = { version = "1", features = ["derive"] } serde_json = "1" @@ -27,3 +27,5 @@ notify = "6.1.1" base64 = "0.21.7" tokio = { version = "1.36.0", features = ["full"] } +[target."cfg(target_os = \"macos\")".dependencies] +cocoa = "0.26" diff --git a/src-tauri/src/lib.rs b/src-tauri/src/lib.rs index b96b0ca..e87a85b 100644 --- a/src-tauri/src/lib.rs +++ b/src-tauri/src/lib.rs @@ -8,6 +8,7 @@ use base64::{Engine as _, engine::general_purpose::STANDARD as BASE64}; use std::sync::Mutex; use std::sync::Arc; use tauri::AppHandle; +use tauri::{TitleBarStyle, WebviewUrl, WebviewWindowBuilder}; // Global state to store the watcher diff --git a/src-tauri/tauri.conf.json b/src-tauri/tauri.conf.json index ddbf8db..32a6b4d 100644 --- a/src-tauri/tauri.conf.json +++ b/src-tauri/tauri.conf.json @@ -1,38 +1,40 @@ { - "$schema": "https://schema.tauri.app/config/2", - "productName": "haystack", - "version": "0.1.0", - "identifier": "com.haystack.app", - "build": { - "beforeDevCommand": "bun run dev", - "devUrl": "http://localhost:1420", - "beforeBuildCommand": "bun run build", - "frontendDist": "../dist" - }, - "app": { - "windows": [ - { - "title": "Haystack", - "width": 640, - "height": 480, - "decorations": false, - "transparent": true, - "resizable": false - } - ], - "security": { - "csp": null - } - }, - "bundle": { - "active": true, - "targets": "all", - "icon": [ - "icons/32x32.png", - "icons/128x128.png", - "icons/128x128@2x.png", - "icons/icon.icns", - "icons/icon.ico" - ] - } + "$schema": "https://schema.tauri.app/config/2", + "productName": "haystack", + "version": "0.1.0", + "identifier": "com.haystack.app", + "build": { + "beforeDevCommand": "bun run dev", + "devUrl": "http://localhost:1420", + "beforeBuildCommand": "bun run build", + "frontendDist": "../dist" + }, + "app": { + "windows": [ + { + "title": "Haystack", + "width": 640, + "height": 480, + "decorations": false, + "transparent": true, + "resizable": false, + "shadow": true + } + ], + "macOSPrivateApi": true, + "security": { + "csp": null + } + }, + "bundle": { + "active": true, + "targets": "all", + "icon": [ + "icons/32x32.png", + "icons/128x128.png", + "icons/128x128@2x.png", + "icons/icon.icns", + "icons/icon.ico" + ] + } } diff --git a/src/components/TitleBar.tsx b/src/components/TitleBar.tsx index 77441af..83e5290 100644 --- a/src/components/TitleBar.tsx +++ b/src/components/TitleBar.tsx @@ -1,7 +1,7 @@ export function TitleBar() { return ( -