mirror of
https://github.com/overte-org/overte.git
synced 2025-04-25 21:16:00 +02:00
fix macos menu placement for About, Preferences, and Quit
This commit is contained in:
parent
4da70cf3c8
commit
73c1ef9997
2 changed files with 13 additions and 5 deletions
|
@ -72,7 +72,8 @@ Menu::Menu() :
|
||||||
MenuOption::AboutApp,
|
MenuOption::AboutApp,
|
||||||
0,
|
0,
|
||||||
this,
|
this,
|
||||||
SLOT(aboutApp()));
|
SLOT(aboutApp()),
|
||||||
|
QAction::AboutRole);
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
(addActionToQMenuAndActionHash(fileMenu,
|
(addActionToQMenuAndActionHash(fileMenu,
|
||||||
|
@ -120,7 +121,9 @@ Menu::Menu() :
|
||||||
MenuOption::Quit,
|
MenuOption::Quit,
|
||||||
Qt::CTRL | Qt::Key_Q,
|
Qt::CTRL | Qt::Key_Q,
|
||||||
appInstance,
|
appInstance,
|
||||||
SLOT(quit()));
|
SLOT(quit()),
|
||||||
|
QAction::QuitRole);
|
||||||
|
|
||||||
|
|
||||||
QMenu* editMenu = addMenu("Edit");
|
QMenu* editMenu = addMenu("Edit");
|
||||||
|
|
||||||
|
@ -128,7 +131,8 @@ Menu::Menu() :
|
||||||
MenuOption::Preferences,
|
MenuOption::Preferences,
|
||||||
Qt::CTRL | Qt::Key_Comma,
|
Qt::CTRL | Qt::Key_Comma,
|
||||||
this,
|
this,
|
||||||
SLOT(editPreferences()));
|
SLOT(editPreferences()),
|
||||||
|
QAction::PreferencesRole);
|
||||||
|
|
||||||
addDisabledActionAndSeparator(editMenu, "Voxels");
|
addDisabledActionAndSeparator(editMenu, "Voxels");
|
||||||
|
|
||||||
|
@ -679,7 +683,8 @@ QAction* Menu::addActionToQMenuAndActionHash(QMenu* destinationMenu,
|
||||||
const QString actionName,
|
const QString actionName,
|
||||||
const QKeySequence& shortcut,
|
const QKeySequence& shortcut,
|
||||||
const QObject* receiver,
|
const QObject* receiver,
|
||||||
const char* member) {
|
const char* member,
|
||||||
|
QAction::MenuRole role) {
|
||||||
QAction* action;
|
QAction* action;
|
||||||
|
|
||||||
if (receiver && member) {
|
if (receiver && member) {
|
||||||
|
@ -688,6 +693,7 @@ QAction* Menu::addActionToQMenuAndActionHash(QMenu* destinationMenu,
|
||||||
action = destinationMenu->addAction(actionName);
|
action = destinationMenu->addAction(actionName);
|
||||||
action->setShortcut(shortcut);
|
action->setShortcut(shortcut);
|
||||||
}
|
}
|
||||||
|
action->setMenuRole(role);
|
||||||
|
|
||||||
_actionHash.insert(actionName, action);
|
_actionHash.insert(actionName, action);
|
||||||
|
|
||||||
|
|
|
@ -113,7 +113,9 @@ private:
|
||||||
const QString actionName,
|
const QString actionName,
|
||||||
const QKeySequence& shortcut = 0,
|
const QKeySequence& shortcut = 0,
|
||||||
const QObject* receiver = NULL,
|
const QObject* receiver = NULL,
|
||||||
const char* member = NULL);
|
const char* member = NULL,
|
||||||
|
QAction::MenuRole role = QAction::NoRole);
|
||||||
|
|
||||||
QAction* addCheckableActionToQMenuAndActionHash(QMenu* destinationMenu,
|
QAction* addCheckableActionToQMenuAndActionHash(QMenu* destinationMenu,
|
||||||
const QString actionName,
|
const QString actionName,
|
||||||
const QKeySequence& shortcut = 0,
|
const QKeySequence& shortcut = 0,
|
||||||
|
|
Loading…
Reference in a new issue