diff options
author | 2020-04-05 11:26:26 +0530 | |
---|---|---|
committer | 2020-04-05 06:56:26 +0100 | |
commit | 53b659259eda3adbeffe430b6ed2eb3d9ab87109 (patch) | |
tree | c38ed9339bd32dee23e4168dc8629a1d832028b5 | |
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>
-rw-r--r-- | src/i18n/locales/en-US.json | 1 | ||||
-rw-r--r-- | src/i18n/locales/en.json | 1 | ||||
-rw-r--r-- | src/i18n/messages/src/lib/Menu.json | 13 | ||||
-rw-r--r-- | src/lib/Menu.js | 32 |
4 files changed, 47 insertions, 0 deletions
diff --git a/src/i18n/locales/en-US.json b/src/i18n/locales/en-US.json index 3306febe1..d9a191982 100644 --- a/src/i18n/locales/en-US.json +++ b/src/i18n/locales/en-US.json | |||
@@ -158,6 +158,7 @@ | |||
158 | "menu.view.reloadService": "Reload Service", | 158 | "menu.view.reloadService": "Reload Service", |
159 | "menu.view.resetZoom": "Actual Size", | 159 | "menu.view.resetZoom": "Actual Size", |
160 | "menu.view.toggleDevTools": "Toggle Developer Tools", | 160 | "menu.view.toggleDevTools": "Toggle Developer Tools", |
161 | "menu.view.toggleDarkMode": "Toggle Dark Mode", | ||
161 | "menu.view.toggleFullScreen": "Toggle Full Screen", | 162 | "menu.view.toggleFullScreen": "Toggle Full Screen", |
162 | "menu.view.toggleServiceDevTools": "Toggle Service Developer Tools", | 163 | "menu.view.toggleServiceDevTools": "Toggle Service Developer Tools", |
163 | "menu.view.toggleTodosDevTools": "Toggle Todos Developer Tools", | 164 | "menu.view.toggleTodosDevTools": "Toggle Todos Developer Tools", |
diff --git a/src/i18n/locales/en.json b/src/i18n/locales/en.json index 235e12146..fb2cb3d7e 100644 --- a/src/i18n/locales/en.json +++ b/src/i18n/locales/en.json | |||
@@ -116,6 +116,7 @@ | |||
116 | "menu.view.reloadService": "Athlódáil seirbhís", | 116 | "menu.view.reloadService": "Athlódáil seirbhís", |
117 | "menu.view.resetZoom": "Fíormhéid", | 117 | "menu.view.resetZoom": "Fíormhéid", |
118 | "menu.view.toggleDevTools": "Scoránaigh uirlis forbróra", | 118 | "menu.view.toggleDevTools": "Scoránaigh uirlis forbróra", |
119 | "menu.view.toggleDarkMode": "Toggle Dark Mode", | ||
119 | "menu.view.toggleFullScreen": "Scoránaigh mód lánscáileáin", | 120 | "menu.view.toggleFullScreen": "Scoránaigh mód lánscáileáin", |
120 | "menu.view.toggleServiceDevTools": "Scoránaigh uirlis forbróra seirbhíse", | 121 | "menu.view.toggleServiceDevTools": "Scoránaigh uirlis forbróra seirbhíse", |
121 | "menu.view.toggleTodosDevTools": "Toggle Todos Developer Tools", | 122 | "menu.view.toggleTodosDevTools": "Toggle Todos Developer Tools", |
diff --git a/src/i18n/messages/src/lib/Menu.json b/src/i18n/messages/src/lib/Menu.json index 15f5ff75f..587754463 100644 --- a/src/i18n/messages/src/lib/Menu.json +++ b/src/i18n/messages/src/lib/Menu.json | |||
@@ -325,6 +325,19 @@ | |||
325 | } | 325 | } |
326 | }, | 326 | }, |
327 | { | 327 | { |
328 | "id": "menu.view.toggleDarkMode", | ||
329 | "defaultMessage": "!!!Toggle Dark Mode", | ||
330 | "file": "src/lib/Menu.js", | ||
331 | "start": { | ||
332 | "line": 114, | ||
333 | "column": 18 | ||
334 | }, | ||
335 | "end": { | ||
336 | "line": 117, | ||
337 | "column": 3 | ||
338 | } | ||
339 | }, | ||
340 | { | ||
328 | "id": "menu.view.toggleTodosDevTools", | 341 | "id": "menu.view.toggleTodosDevTools", |
329 | "defaultMessage": "!!!Toggle Todos Developer Tools", | 342 | "defaultMessage": "!!!Toggle Todos Developer Tools", |
330 | "file": "src/lib/Menu.js", | 343 | "file": "src/lib/Menu.js", |
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, |