SDA-5024 Toggle fullscreen menu entry workaround on macOS (#2530)

This commit is contained in:
Salah Benmoussati authored and GitHub committed 2026-04-28 20:55:44 +02:00
1 parent e614d0997b
commit 74ae6b564b
2 files changed
+25 -5

No files matched your search

+1 -1
View File
@@ -195,7 +195,7 @@
"cheerio": "v1.0.0-rc.12",
"cross-env": "7.0.3",
"del": "3.0.0",
"electron": "39.5.1",
"electron": "41.3.0",
"electron-builder": "^26.3.1",
"electron-devtools-installer": "^3.2.0",
"electron-icon-maker": "0.0.5",
+24 -4
View File
@@ -400,14 +400,34 @@ export class AppMenu {
'zoomOut',
),
this.buildSeparator(),
this.assignRoleOrLabel({
role: 'togglefullscreen',
label: i18n.t('Toggle Full Screen')(),
}),
this.addToggleFullScreenMenuItem(),
],
};
}
/**
* Creates a menu item to toggle full screen with different implementation for windows and macOS due to the difference in how full screen is handled in both OS
* @returns Menu item
*/
private addToggleFullScreenMenuItem(): Electron.MenuItemConstructorOptions {
if (isWindowsOS) {
return this.assignRoleOrLabel({
role: 'togglefullscreen',
label: i18n.t('Toggle Full Screen')(),
});
} else {
return {
label: i18n.t('Toggle Full Screen')(),
accelerator: 'Ctrl+Command+F',
click: (_item, focusedWindow) => {
if (focusedWindow) {
focusedWindow.setFullScreen(!focusedWindow.isFullScreen());
}
},
};
}
}
/**
* Builds menu items for window section
*/