Fix desktop file menu on Linux (#7106)
Some checks are pending
CI / build (push) Waiting to run
CI / svelte-check (push) Blocked by required conditions
CI / formatting (push) Blocked by required conditions
CI / test (push) Blocked by required conditions
CI / uitest (push) Waiting to run
CI / uitest-pg (push) Waiting to run
CI / uitest-qms (push) Waiting to run
CI / docker-build (push) Blocked by required conditions
CI / dist-build (push) Blocked by required conditions

This commit is contained in:
Anna Khismatullina 2024-11-05 21:21:17 +07:00 committed by GitHub
parent e3353df572
commit f2f925a2f0
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -16,6 +16,7 @@
import { Menu, MenuItemConstructorOptions, type BrowserWindow } from 'electron' import { Menu, MenuItemConstructorOptions, type BrowserWindow } from 'electron'
const isMac = process.platform === 'darwin' const isMac = process.platform === 'darwin'
const isLinux = process.platform === 'linux'
export const addMenus = (getWindow: () => BrowserWindow, sendCommand: (cmd: string, ...args: any[]) => void): void => { export const addMenus = (getWindow: () => BrowserWindow, sendCommand: (cmd: string, ...args: any[]) => void): void => {
const template: MenuItemConstructorOptions[] = [ const template: MenuItemConstructorOptions[] = [
@ -24,7 +25,7 @@ export const addMenus = (getWindow: () => BrowserWindow, sendCommand: (cmd: stri
submenu: [ submenu: [
{ {
label: 'Settings', label: 'Settings',
accelerator: 'Meta+,', accelerator: isLinux ? 'Ctrl+,' : 'Meta+,',
click: () => { sendCommand('open-settings') } click: () => { sendCommand('open-settings') }
}, },
{ {