Skip to content

Commit

Permalink
refactor: Update Tauri CLI to version 2.0.2 and simplify macOS window…
Browse files Browse the repository at this point in the history
… code
  • Loading branch information
pacholoamit committed Oct 8, 2024
1 parent c9e56aa commit 1be3528
Show file tree
Hide file tree
Showing 9 changed files with 17 additions and 511 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@
},
"devDependencies": {
"@eslint/js": "^9.7.0",
"@tauri-apps/cli": "latest",
"@tauri-apps/cli": "2.0.2",
"@types/lodash.sortby": "^4.7.9",
"@types/node": "^20.16.11",
"@types/react": "^18.3.11",
Expand Down
10 changes: 10 additions & 0 deletions src-tauri/gen/schemas/macOS-schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -3392,6 +3392,16 @@
"type": "string",
"const": "core:window:deny-unminimize"
},
{
"description": "Enables the show_snap_overlay command without any pre-configured scope.",
"type": "string",
"const": "decorum:allow-show-snap-overlay"
},
{
"description": "Denies the show_snap_overlay command without any pre-configured scope.",
"type": "string",
"const": "decorum:deny-show-snap-overlay"
},
{
"description": "This set of permissions describes the what kind of\nfile system access the `fs` plugin has enabled or denied by default.\n\n#### Granted Permissions\n\nThis default permission set enables read access to the\napplication specific directories (AppConfig, AppData, AppLocalData, AppCache,\nAppLog) and all files and sub directories created in it.\nThe location of these directories depends on the operating system,\nwhere the application is run.\n\nIn general these directories need to be manually created\nby the application at runtime, before accessing files or folders\nin it is possible.\n\nTherefore, it is also allowed to create all of these folders via\nthe `mkdir` command.\n\n#### Denied Permissions\n\nThis default permission set prevents access to critical components\nof the Tauri application by default.\nOn Windows the webview data folder access is denied.\n\n",
"type": "string",
Expand Down
18 changes: 1 addition & 17 deletions src-tauri/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@ extern crate cocoa;
#[macro_use]
extern crate objc;

#[cfg(target_os = "macos")]
mod mac;

#[cfg(target_os = "windows")]
mod win;

mod app;
mod commands;
mod dirstat;
Expand Down Expand Up @@ -74,17 +68,7 @@ fn build_and_run_app(app: AppState) {

// Some macOS-specific helpers
#[cfg(target_os = "macos")]
{
// Set a custom inset to the traffic lights
main_window.set_traffic_lights_inset(12.0, 16.0).unwrap();

// Make window transparent without privateApi
main_window.make_transparent().unwrap();

// Set window level
// NSWindowLevel: https://developer.apple.com/documentation/appkit/nswindowlevel
main_window.set_window_level(25).unwrap()
}
main_window.set_traffic_lights_inset(12.0, 16.0).unwrap();

// BUILD TRAY - TODO MOVE TO DIFFERENT FILE

Expand Down
1 change: 0 additions & 1 deletion src-tauri/src/mac/mod.rs

This file was deleted.

Loading

0 comments on commit 1be3528

Please sign in to comment.