macOS: Fix bug re-assigning default keyboard shortcuts to other native menus

I've found this bug re-assigning Cmd+E shortcut to File > Export,
after restarting Aseprite, Cmd+E will still execute the default
action (File > Export Sprite Sheet), and the only way to fix this was
opening "Edit > Keyboard Shortcuts" and closing the file (which will
call AppMenus::instance()->syncNativeMenuItemKeyShortcuts()).

Now if we create native menus after loading user defined keyboard
shortcuts, the native menus will contain the correct keyboard
shortcuts from the very beginning.
This commit is contained in:
David Capello 2018-06-27 11:32:24 -03:00
parent 51ce52981a
commit aa8d4dfc11

View File

@ -1,5 +1,5 @@
// Aseprite
// Copyright (C) 2001-2017 David Capello
// Copyright (C) 2001-2018 David Capello
//
// This program is distributed under the terms of
// the End-User License Agreement for Aseprite.
@ -339,8 +339,6 @@ void AppMenus::reload()
m_palettePopupMenu.reset(loadMenuById(handle, "palette_popup_menu"));
m_inkPopupMenu.reset(loadMenuById(handle, "ink_popup_menu"));
createNativeMenus();
////////////////////////////////////////
// Load keyboard shortcuts for commands
@ -361,6 +359,10 @@ void AppMenus::reload()
if (base::is_file(fn))
KeyboardShortcuts::instance()->importFile(fn, KeySource::UserDefined);
}
// Create native menus after the default + user defined keyboard
// shortcuts are loaded correctly.
createNativeMenus();
}
void AppMenus::initTheme()