-
Notifications
You must be signed in to change notification settings - Fork 28
/
Copy pathaboutMenu.ts
54 lines (49 loc) · 1.45 KB
/
aboutMenu.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
// SPDX-FileCopyrightText: Meta Platforms, Inc. and its affiliates
// SPDX-FileCopyrightText: TNG Technology Consulting GmbH <https://www.tngtech.com>
// SPDX-FileCopyrightText: Nico Carl <nicocarl@protonmail.com>
//
// SPDX-License-Identifier: Apache-2.0
import { shell } from 'electron';
import { text } from '../../../shared/text';
import { getIconBasedOnTheme } from '../iconHelpers';
import {
getPathOfChromiumNoticeDocument,
getPathOfNoticeDocument,
} from '../notice-document-helpers';
function getOpenOnGithub() {
return {
icon: getIconBasedOnTheme(
'icons/github-white.png',
'icons/github-black.png',
),
label: text.menu.aboutSubmenu.openOnGithub,
click: () =>
shell.openExternal('https://github.com/opossum-tool/opossumUI'),
};
}
function getOpossumUiNotices() {
return {
icon: getIconBasedOnTheme(
'icons/notice-white.png',
'icons/notice-black.png',
),
label: text.menu.aboutSubmenu.opossumUINotices,
click: () => shell.openPath(getPathOfNoticeDocument()),
};
}
function getChromiumNotices() {
return {
icon: getIconBasedOnTheme(
'icons/chromium-white.png',
'icons/chromium-black.png',
),
label: text.menu.aboutSubmenu.chromiumNotices,
click: () => shell.openPath(getPathOfChromiumNoticeDocument()),
};
}
export function getAboutMenu() {
return {
label: text.menu.about,
submenu: [getOpenOnGithub(), getOpossumUiNotices(), getChromiumNotices()],
};
}