diff options
Diffstat (limited to 'src/lib/Menu.js')
-rw-r--r-- | src/lib/Menu.js | 18 |
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'; |
35 | import { CUSTOM_WEBSITE_RECIPE_ID, LIVE_API_FERDIUM_WEBSITE } from '../config'; | 36 | import { CUSTOM_WEBSITE_RECIPE_ID, LIVE_API_FERDIUM_WEBSITE } from '../config'; |
36 | import { ferdiumVersion } from '../environment-remote'; | 37 | import { 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 | ||
356 | function _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 | |||
355 | const _titleBarTemplateFactory = (intl, locked) => [ | 368 | const _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), |