From b773abd51af8f6f254215708a16f749c86d7b651 Mon Sep 17 00:00:00 2001 From: Dmytro Kondakov Date: Sun, 23 Feb 2025 14:59:01 +0100 Subject: [PATCH] some window ui tweaks --- src-tauri/Cargo.lock | 1 + src-tauri/Cargo.toml | 4 +- src-tauri/src/lib.rs | 1 + src-tauri/tauri.conf.json | 74 +++++++++++++++++++------------------ src/components/TitleBar.tsx | 4 +- src/index.css | 5 +-- 6 files changed, 47 insertions(+), 42 deletions(-) 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 ( -
-
Haystack
+
+
Haystack
); } diff --git a/src/index.css b/src/index.css index 6b7b8cb..0e5e1a3 100644 --- a/src/index.css +++ b/src/index.css @@ -2,15 +2,14 @@ @tailwind components; @tailwind utilities; + :root { + @apply bg-gray-100 text-black rounded-xl; font-family: Inter, Avenir, Helvetica, Arial, sans-serif; font-size: 16px; line-height: 24px; font-weight: 400; - color: #0f0f0f; - background-color: #f6f6f6; - font-synthesis: none; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased;