Commit 4fd9f1e6 authored by mae's avatar mae
Browse files

new signal: BaseTextEditor::lineContextMenuRequested(TextEditor::ITextEditor...

new signal: BaseTextEditor::lineContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu);

To be useful and used by the bookmarkmanager, this has to move to ITextEditor.
parent e5948158
......@@ -79,6 +79,7 @@
#include <QtGui/QToolBar>
#include <QtGui/QToolTip>
#include <QtGui/QInputDialog>
#include <QtGui/QMenu>
using namespace TextEditor;
using namespace TextEditor::Internal;
......@@ -2430,6 +2431,11 @@ void BaseTextEditor::extraAreaMouseEvent(QMouseEvent *e)
} else {
d->extraAreaToggleMarkBlockNumber = cursor.blockNumber();
}
} else if (e->button() == Qt::RightButton) {
QMenu * contextMenu = new QMenu(this);
emit lineContextMenuRequested(editableInterface(), cursor.blockNumber(), contextMenu);
if (!contextMenu->isEmpty())
contextMenu->exec(e->globalPos());
}
} else if (d->extraAreaSelectionAnchorBlockNumber >= 0) {
QTextCursor selection = cursor;
......
......@@ -432,6 +432,7 @@ protected slots:
signals:
void markRequested(TextEditor::ITextEditor *editor, int line);
void lineContextMenuRequested(TextEditor::ITextEditor *editor, int line, QMenu *menu);
void requestBlockUpdate(const QTextBlock &);
void requestAutoCompletion(ITextEditable *editor, bool forced);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment