diff --git a/apps/desktop/src-tauri/src/menu.rs b/apps/desktop/src-tauri/src/menu.rs index f21223bcf..089517e90 100644 --- a/apps/desktop/src-tauri/src/menu.rs +++ b/apps/desktop/src-tauri/src/menu.rs @@ -1,6 +1,16 @@ +use std::env::consts; + use tauri::{AboutMetadata, CustomMenuItem, Menu, MenuItem, Submenu, WindowMenuEvent, Wry}; pub(crate) fn get_menu() -> Menu { + match consts::OS { + "linux" => Menu::new(), + "macos" => custom_menu_bar(), + _ => Menu::new(), + } +} + +fn custom_menu_bar() -> Menu { // let quit = CustomMenuItem::new("quit".to_string(), "Quit"); // let close = CustomMenuItem::new("close".to_string(), "Close"); // let jeff = CustomMenuItem::new("jeff".to_string(), "Jeff"); diff --git a/apps/desktop/src-tauri/tauri.linux.conf.json b/apps/desktop/src-tauri/tauri.linux.conf.json new file mode 100644 index 000000000..c3e32cb6c --- /dev/null +++ b/apps/desktop/src-tauri/tauri.linux.conf.json @@ -0,0 +1,74 @@ +{ + "package": { + "productName": "Spacedrive", + "version": "0.1.0" + }, + "build": { + "distDir": "../dist", + "devPath": "http://localhost:8085", + "beforeDevCommand": "", + "beforeBuildCommand": "" + }, + "tauri": { + "bundle": { + "active": true, + "targets": "all", + "identifier": "co.spacedrive.desktop", + "icon": ["icons/icon.icns"], + "resources": [], + "externalBin": [], + "copyright": "Jamie Pine", + "shortDescription": "Your personal virtual cloud.", + "longDescription": "Spacedrive is an open source virtual filesystem, a personal cloud powered by your everyday devices. Feature-rich benefits of the cloud, only its owned and hosted by you with security, privacy and ownership as a foundation. Spacedrive makes it possible to create a limitless directory of your digital life that will stand the test of time.", + "deb": { + "depends": [], + "useBootstrapper": false + }, + "macOS": { + "frameworks": [], + "minimumSystemVersion": "", + "useBootstrapper": false, + "exceptionDomain": "", + "signingIdentity": null, + "entitlements": null + }, + "windows": { + "certificateThumbprint": null, + "digestAlgorithm": "sha256", + "timestampUrl": "" + } + }, + "updater": { + "active": false + }, + "allowlist": { + "all": true, + "os": { + "all": true + }, + "dialog": { + "all": true, + "open": true, + "save": true + } + }, + "windows": [ + { + "title": "Spacedrive", + "width": 1250, + "height": 625, + "resizable": true, + "fullscreen": false, + "alwaysOnTop": false, + "focus": true, + "fileDropEnabled": false, + "decorations": true, + "transparent": false, + "center": true + } + ], + "security": { + "csp": "default-src asset: blob: data: filesystem: ws: wss: http: https: tauri: 'unsafe-eval' 'unsafe-inline' 'self' img-src: 'self'" + } + } +} diff --git a/apps/desktop/src/App.tsx b/apps/desktop/src/App.tsx index 4e183a1e9..147eb96c5 100644 --- a/apps/desktop/src/App.tsx +++ b/apps/desktop/src/App.tsx @@ -1,4 +1,4 @@ -import React, { useEffect } from 'react'; +import React, { useEffect, useState } from 'react'; import { BrowserRouter, Location, @@ -23,12 +23,28 @@ import SecuritySettings from './screens/settings/SecuritySettings'; import LocationSettings from './screens/settings/LocationSettings'; import { RedirectPage } from './screens/Redirect'; import { QueryClient, QueryClientProvider } from 'react-query'; +import { platform } from '@tauri-apps/api/os'; const queryClient = new QueryClient(); function AppLayout() { + const [isWindowRounded, setIsWindowRounded] = useState(false); + + useEffect(() => { + platform().then((platform) => { + if (platform === 'darwin') { + setIsWindowRounded(true); + } + }); + }, []); + return ( -