fix(menus): Always show main win in menu, move Activity #1314

This commit is contained in:
Ben Gotow 2016-05-09 17:22:39 -07:00
parent c4b5b4b779
commit 18262d043b
9 changed files with 7 additions and 15 deletions

View file

@ -3,7 +3,6 @@
"application:hide": "command+h",
"application:hide-other-applications": "command+alt+h",
"application:zoom": "alt+command+ctrl+m",
"application:show-work-window": "mod+alt+w",
"application:run-all-specs": "mod+alt+s",
"application:run-package-specs": "mod+alt+p",

View file

@ -4,7 +4,6 @@
"window:toggle-full-screen": "f11",
"window:reload": "mod+alt+l",
"window:toggle-dev-tools": "mod+alt+i",
"application:show-work-window": "mod+alt+w",
"application:run-all-specs": "mod+alt+s",
"application:run-package-specs": "mod+alt+p"
}

View file

@ -95,8 +95,6 @@
{ "label": "Toggle Component Regions", "command": "window:toggle-component-regions" },
{ "label": "Toggle Screenshot Mode", "command": "window:toggle-screenshot-mode" },
{ "type": "separator" },
{ "label": "Open Activity Window", "command": "application:show-work-window" },
{ "type": "separator" },
{ "label": "Create a Plugin...", "command": "application:create-package" },
{ "label": "Install a Plugin...", "command": "application:install-package" },
{ "type": "separator" },

View file

@ -70,8 +70,6 @@
{ "label": "Toggle Component Regions", "command": "window:toggle-component-regions" },
{ "label": "Toggle Screenshot Mode", "command": "window:toggle-screenshot-mode" },
{ "type": "separator" },
{ "label": "Open Activity Window", "command": "application:show-work-window" },
{ "type": "separator" },
{ "label": "Create a Plugin...", "command": "application:create-package" },
{ "label": "Install a Plugin...", "command": "application:install-package" },
{ "type": "separator" },

View file

@ -52,8 +52,6 @@
{ "label": "Toggle Component Regions", "command": "window:toggle-component-regions" },
{ "label": "Toggle Screenshot Mode", "command": "window:toggle-screenshot-mode" },
{ "type": "separator" },
{ "label": "Open Activity Window", "command": "application:show-work-window" },
{ "type": "separator" },
{ "label": "Create a Plugin...", "command": "application:create-package" },
{ "label": "Install a Plugin...", "command": "application:install-package" },
{ "type": "separator" },

View file

@ -109,9 +109,14 @@ class ApplicationMenu
return unless windowMenu
idx = _.findIndex(windowMenu.submenu, ({id}) -> id is 'window-list-separator')
accelerators = {
'default': 'CmdOrCtrl+0',
'work': 'CmdOrCtrl+alt+w',
}
windows = global.application.windowManager.getOpenWindows()
windowsItems = windows.map (w) => {
label: w.loadSettings().title || "Window"
accelerator: accelerators[w.windowType]
click: ->
w.show()
w.focus()

View file

@ -325,12 +325,6 @@ export default class Application extends EventEmitter {
this.openWindowsForTokenState();
});
this.on('application:show-work-window', () => {
const win = this.windowManager.get(WindowManager.WORK_WINDOW)
win.show()
win.focus()
});
this.on('application:check-for-update', () => {
this.autoUpdateManager.check();
});

View file

@ -57,6 +57,7 @@ export default class WindowLauncher {
// This will fire `NylasEnv::populateHotWindow` and reload the
// packages.
win.windowKey = opts.windowKey;
win.windowType = opts.windowType;
win.setLoadSettings(newLoadSettings);
}

View file

@ -28,7 +28,7 @@ export default class WindowManager {
const values = [];
Object.keys(this._windows).forEach((key) => {
const win = this._windows[key];
if (win.isVisible() || win.isMinimized()) {
if (win.windowType !== WindowLauncher.EMPTY_WINDOW) {
values.push(win);
}
});