diff options
author | 2020-04-05 11:26:26 +0530 | |
---|---|---|
committer | 2020-04-05 06:56:26 +0100 | |
commit | 53b659259eda3adbeffe430b6ed2eb3d9ab87109 (patch) | |
tree | c38ed9339bd32dee23e4168dc8629a1d832028b5 /src/lib | |
parent | Update Stalebot configuration to not close stale issues (#528) (diff) | |
download | ferdium-app-53b659259eda3adbeffe430b6ed2eb3d9ab87109.tar.gz ferdium-app-53b659259eda3adbeffe430b6ed2eb3d9ab87109.tar.zst ferdium-app-53b659259eda3adbeffe430b6ed2eb3d9ab87109.zip |
* Bump version number
* feat: Add a new menu item for toggling between Dark Mode and Light Mode
- Add a new sub menu entry under 'View' in src/lib/Menu.js named toggleDarkMode
- Add an accelerator hotkey of '${cmdKey}+Shift+D' as the feature request was to have a hot key for dark mode. See #530
- Update intl locales for 'menu.view.toggleDarkMode' in en.json and en-US.json.
Co-authored-by: Amine Mouafik <amine@mouafik.fr>
Co-authored-by: vantezzen <hello@vantezzen.io>
Co-authored-by: Mahadevan Sreenivasan <mahadevan_sreenivasan@trimble.com>
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/Menu.js | 32 |
1 files changed, 32 insertions, 0 deletions
diff --git a/src/lib/Menu.js b/src/lib/Menu.js index 4547e84f9..07a29a224 100644 --- a/src/lib/Menu.js +++ b/src/lib/Menu.js | |||
@@ -111,6 +111,10 @@ const menuItems = defineMessages({ | |||
111 | id: 'menu.view.toggleFullScreen', | 111 | id: 'menu.view.toggleFullScreen', |
112 | defaultMessage: '!!!Toggle Full Screen', | 112 | defaultMessage: '!!!Toggle Full Screen', |
113 | }, | 113 | }, |
114 | toggleDarkMode: { | ||
115 | id: 'menu.view.toggleDarkMode', | ||
116 | defaultMessage: '!!!Toggle Dark Mode', | ||
117 | }, | ||
114 | toggleDevTools: { | 118 | toggleDevTools: { |
115 | id: 'menu.view.toggleDevTools', | 119 | id: 'menu.view.toggleDevTools', |
116 | defaultMessage: '!!!Toggle Developer Tools', | 120 | defaultMessage: '!!!Toggle Developer Tools', |
@@ -457,6 +461,20 @@ const _templateFactory = (intl, locked) => [ | |||
457 | : intl.formatMessage(menuItems.enterFullScreen), | 461 | : intl.formatMessage(menuItems.enterFullScreen), |
458 | role: 'togglefullscreen', | 462 | role: 'togglefullscreen', |
459 | }, | 463 | }, |
464 | { | ||
465 | label: intl.formatMessage(menuItems.toggleDarkMode), | ||
466 | type: 'checkbox', | ||
467 | accelerator: `${cmdKey}+Shift+D`, | ||
468 | checked: window.ferdi.stores.settings.app.darkMode, | ||
469 | click: () => { | ||
470 | window.ferdi.actions.settings.update({ | ||
471 | type: 'app', | ||
472 | data: { | ||
473 | darkMode: !window.ferdi.stores.settings.app.darkMode, | ||
474 | }, | ||
475 | }); | ||
476 | }, | ||
477 | }, | ||
460 | ], | 478 | ], |
461 | }, | 479 | }, |
462 | { | 480 | { |
@@ -690,6 +708,20 @@ const _titleBarTemplateFactory = (intl, locked) => [ | |||
690 | }, | 708 | }, |
691 | }, | 709 | }, |
692 | { | 710 | { |
711 | label: intl.formatMessage(menuItems.toggleDarkMode), | ||
712 | type: 'checkbox', | ||
713 | accelerator: `${cmdKey}+Shift+D`, | ||
714 | checked: window.ferdi.stores.settings.app.darkMode, | ||
715 | click: () => { | ||
716 | window.ferdi.actions.settings.update({ | ||
717 | type: 'app', | ||
718 | data: { | ||
719 | darkMode: !window.ferdi.stores.settings.app.darkMode, | ||
720 | }, | ||
721 | }); | ||
722 | }, | ||
723 | }, | ||
724 | { | ||
693 | label: intl.formatMessage(menuItems.autohideMenuBar), | 725 | label: intl.formatMessage(menuItems.autohideMenuBar), |
694 | type: 'checkbox', | 726 | type: 'checkbox', |
695 | checked: window.ferdi.stores.settings.app.autohideMenuBar, | 727 | checked: window.ferdi.stores.settings.app.autohideMenuBar, |