Added mechanism for viewpanes to request buttons on the main toolbar (#1189)
This commit is contained in:
@@ -912,6 +912,12 @@ QAction* LevelEditorMenuHandler::CreateViewPaneAction(const QtViewPane* view)
|
||||
action = new QAction(menuText, this);
|
||||
action->setObjectName(view->m_name);
|
||||
action->setCheckable(true);
|
||||
|
||||
if (view->m_options.showOnToolsToolbar)
|
||||
{
|
||||
action->setIcon(QIcon(view->m_options.toolbarIcon));
|
||||
}
|
||||
|
||||
m_actionManager->AddAction(view->m_id, action);
|
||||
|
||||
if (!view->m_options.shortcut.isEmpty())
|
||||
@@ -941,6 +947,11 @@ QAction* LevelEditorMenuHandler::CreateViewPaneMenuItem(
|
||||
|
||||
menu->addAction(action);
|
||||
|
||||
if (view->m_options.showOnToolsToolbar)
|
||||
{
|
||||
m_mainWindow->GetToolbarManager()->AddButtonToEditToolbar(action);
|
||||
}
|
||||
|
||||
return action;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user