support displaying completions from editor context menu
This commit is contained in:
@ -502,9 +502,14 @@ void CodeEditor::contextMenuEvent(QContextMenuEvent *event)
|
||||
|
||||
// print augmented context menu if an entry was found
|
||||
auto *menu = createStandardContextMenu();
|
||||
menu->addSeparator();
|
||||
auto action = menu->addAction(QString("Display available completions").arg(help));
|
||||
action->setIcon(QIcon(":/expand-text.png"));
|
||||
connect(action, &QAction::triggered, this, &CodeEditor::runCompletion);
|
||||
|
||||
if (!page.isEmpty()) {
|
||||
menu->addSeparator();
|
||||
auto action = menu->addAction(QString("Reformat '%1' command").arg(help));
|
||||
action = menu->addAction(QString("Reformat '%1' command").arg(help));
|
||||
action->setIcon(QIcon(":/format-indent-less-3.png"));
|
||||
connect(action, &QAction::triggered, this, &CodeEditor::reformatCurrentLine);
|
||||
|
||||
|
||||
BIN
tools/lammps-gui/expand-text.png
Normal file
BIN
tools/lammps-gui/expand-text.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.8 KiB |
@ -23,6 +23,7 @@
|
||||
<file>edit-redo.png</file>
|
||||
<file>edit-undo.png</file>
|
||||
<file>emblem-photos.png</file>
|
||||
<file>expand-text.png</file>
|
||||
<file>format-indent-less-3.png</file>
|
||||
<file>go-first.png</file>
|
||||
<file>go-last.png</file>
|
||||
|
||||
Reference in New Issue
Block a user