ui: Added singleton QtContextMenu with global back and forward actions
* QtContextMenu holds default actions for back and forward * additional actions can be passed to extend the default menu * currently used in QtMainWindow and QtCodeArea * fixed crash on undo when only view actions happened since project load bug id = 108
This commit is contained in:
@@ -21,6 +21,7 @@
|
||||
#include "data/location/TokenLocationFile.h"
|
||||
#include "qt/element/QtCodeFile.h"
|
||||
#include "qt/element/QtCodeSnippet.h"
|
||||
#include "qt/utility/QtContextMenu.h"
|
||||
#include "qt/utility/QtHighlighter.h"
|
||||
#include "settings/ApplicationSettings.h"
|
||||
#include "settings/ColorScheme.h"
|
||||
@@ -498,10 +499,7 @@ void QtCodeArea::contextMenuEvent(QContextMenuEvent* event)
|
||||
if (m_setIDECursorPositionAction != nullptr)
|
||||
{
|
||||
m_eventPosition = event->pos();
|
||||
|
||||
QMenu menu(this);
|
||||
menu.addAction(m_setIDECursorPositionAction);
|
||||
menu.exec(event->globalPos());
|
||||
QtContextMenu::getInstance()->showExtended(event, this, std::vector<QAction*>(1, m_setIDECursorPositionAction));
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user