aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib
diff options
context:
space:
mode:
authorLibravatar André Oliveira <37463445+SpecialAro@users.noreply.github.com>2022-08-11 23:56:51 +0100
committerLibravatar GitHub <noreply@github.com>2022-08-11 23:56:51 +0100
commit5d68307fd154dc95744e5f28a371b233764dbb67 (patch)
tree646e869390a6c05f9c9556480f728f295d36dadf /src/lib
parent6.0.1-nightly.13 [skip ci] (diff)
downloadferdium-app-5d68307fd154dc95744e5f28a371b233764dbb67.tar.gz
ferdium-app-5d68307fd154dc95744e5f28a371b233764dbb67.tar.zst
ferdium-app-5d68307fd154dc95744e5f28a371b233764dbb67.zip
fix: Toggle Full Screen not working on Menu bar (#552)
fix: role not working for toggle full screen
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/Menu.js18
1 files changed, 17 insertions, 1 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js
index b8826f12e..52b6be18a 100644
--- a/src/lib/Menu.js
+++ b/src/lib/Menu.js
@@ -31,6 +31,7 @@ import {
31 chromeVersion, 31 chromeVersion,
32 nodeVersion, 32 nodeVersion,
33 osArch, 33 osArch,
34 toggleFullScreenKey,
34} from '../environment'; 35} from '../environment';
35import { CUSTOM_WEBSITE_RECIPE_ID, LIVE_API_FERDIUM_WEBSITE } from '../config'; 36import { CUSTOM_WEBSITE_RECIPE_ID, LIVE_API_FERDIUM_WEBSITE } from '../config';
36import { ferdiumVersion } from '../environment-remote'; 37import { ferdiumVersion } from '../environment-remote';
@@ -352,6 +353,18 @@ function getActiveService() {
352 return window['ferdium'].stores.services.active; 353 return window['ferdium'].stores.services.active;
353} 354}
354 355
356function _toggleFullScreen() {
357 const mainWindow = getCurrentWindow();
358
359 if (!mainWindow) return;
360
361 if (mainWindow.isFullScreen()) {
362 mainWindow.setFullScreen(false);
363 } else {
364 mainWindow.setFullScreen(true);
365 }
366}
367
355const _titleBarTemplateFactory = (intl, locked) => [ 368const _titleBarTemplateFactory = (intl, locked) => [
356 { 369 {
357 label: intl.formatMessage(menuItems.edit), 370 label: intl.formatMessage(menuItems.edit),
@@ -487,7 +500,10 @@ const _titleBarTemplateFactory = (intl, locked) => [
487 }, 500 },
488 { 501 {
489 label: intl.formatMessage(menuItems.toggleFullScreen), 502 label: intl.formatMessage(menuItems.toggleFullScreen),
490 role: 'toggleFullScreen', 503 click: () => {
504 _toggleFullScreen();
505 },
506 accelerator: toggleFullScreenKey(),
491 }, 507 },
492 { 508 {
493 label: intl.formatMessage(menuItems.toggleNavigationBar), 509 label: intl.formatMessage(menuItems.toggleNavigationBar),