Skip to content

Commit

Permalink
perf: ♻️ Add context menu
Browse files Browse the repository at this point in the history
  • Loading branch information
viarotel committed Nov 16, 2023
1 parent f1106ee commit f0f25a7
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions electron/main.js
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import path from 'node:path'
import { BrowserWindow, app, shell } from 'electron'
import { electronApp, optimizer } from '@electron-toolkit/utils'
import contextMenu from 'electron-context-menu'

// process.js 必须位于非依赖项的顶部
import './helpers/process.js'
Expand All @@ -26,6 +27,14 @@ if (!debug) {
)
}

contextMenu({
showCopyImage: false,
showSelectAll: false,
showSearchWithGoogle: false,
showSaveImageAs: true,
showInspectElement: !app.isPackaged,
})

// The built directory structure
//
// ├─┬─┬ dist
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@
"dayjs": "^1.11.10",
"electron": "^27.0.3",
"electron-builder": "^24.6.4",
"electron-context-menu": "^3.6.1",
"electron-log": "^5.0.0",
"electron-store": "^8.1.0",
"electron-updater": "^6.1.4",
Expand Down

0 comments on commit f0f25a7

Please sign in to comment.