Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change menu structure on MacOS #2822

Merged
merged 1 commit into from
Feb 27, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
{
"name": "opossum-ui",
"productName": "OpossumUI",
"description": "The OpossumUI enables the editing of attribution information that is assigned to a resource tree.",
"license": "Apache-2.0",
"version": "0.1.0",
Expand Down
4 changes: 3 additions & 1 deletion src/ElectronBackend/main/menu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
// SPDX-FileCopyrightText: Nico Carl <[email protected]>
//
// SPDX-License-Identifier: Apache-2.0
import { BrowserWindow, Menu } from 'electron';
import { BrowserWindow, Menu, MenuItem } from 'electron';
import os from 'os';

import { getAboutMenu } from './menu/aboutMenu';
import { getEditMenu } from './menu/editMenu';
Expand All @@ -15,6 +16,7 @@ export async function createMenu(mainWindow: BrowserWindow): Promise<Menu> {
const webContents = mainWindow.webContents;

return Menu.buildFromTemplate([
...(os.platform() === 'darwin' ? [{ role: 'appMenu' } as MenuItem] : []),
getFileMenu(mainWindow),
getEditMenu(webContents),
await getViewMenu(),
Expand Down
3 changes: 2 additions & 1 deletion src/ElectronBackend/main/menu/fileMenu.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
//
// SPDX-License-Identifier: Apache-2.0
import { app, BrowserWindow } from 'electron';
import os from 'os';

import { AllowedFrontendChannels } from '../../../shared/ipc-channels';
import {
Expand Down Expand Up @@ -278,7 +279,7 @@ export function getFileMenu(mainWindow: BrowserWindow) {
getProjectMetadata(webContents),
getProjectStatistics(webContents),
getSetBaseUrl(mainWindow),
getQuit(),
...(os.platform() === 'darwin' ? [] : [getQuit()]),
],
};
}
Loading