1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-11-27 08:21:03 +02:00

Desktop: Add checkmark to menu item, if Dev Tools are on (#1949)

* add checkmark to menu item, if Dev Tools are on

If one closed the dev tools window, one could think that the Dev Tools are closed.
This is not the case. After the next action, the window opens again. This can be
confusing, therefore I added a checkmark to the menu item so that it is very clear.

* fix no-case-declarations

* fix reducer issue
This commit is contained in:
Helmut K. C. Tessarek 2019-10-09 13:55:35 -04:00 committed by Laurent Cozic
parent fdcf27fc65
commit 08295525de

View File

@ -196,7 +196,6 @@ class Application extends BaseApplication {
break;
case 'NOTE_DEVTOOLS_TOGGLE':
newState = Object.assign({}, state);
newState.noteDevToolsVisible = !newState.noteDevToolsVisible;
break;
@ -250,6 +249,11 @@ class Application extends BaseApplication {
this.updateMenuItemStates();
}
if (action.type === 'NOTE_DEVTOOLS_TOGGLE') {
const menuItem = Menu.getApplicationMenu().getMenuItemById('help:toggleDevTools');
menuItem.checked = newState.noteDevToolsVisible;
}
return result;
}
@ -913,6 +917,8 @@ class Application extends BaseApplication {
type: 'separator',
screens: ['Main'],
}, {
id: 'help:toggleDevTools',
type: 'checkbox',
label: _('Toggle development tools'),
visible: true,
click: () => {