ui: Hide nodes and edges from graph via context menu action or Alt + Click (issue #472)
* show all context menu actions, but disable unavailable * added hide action to undo redo stack
This commit is contained in:
@@ -581,14 +581,13 @@ void QtCodeArea::contextMenuEvent(QContextMenuEvent* event)
|
||||
{
|
||||
m_eventPosition = event->pos();
|
||||
|
||||
m_setIDECursorPositionAction->setEnabled(!getSourceLocationFile()->getFilePath().empty());
|
||||
|
||||
QtContextMenu menu(event, this);
|
||||
if (!getSourceLocationFile()->getFilePath().empty())
|
||||
{
|
||||
menu.addSeparator();
|
||||
menu.addFileActions(getSourceLocationFile()->getFilePath());
|
||||
menu.addSeparator();
|
||||
menu.addAction(m_setIDECursorPositionAction);
|
||||
}
|
||||
menu.addSeparator();
|
||||
menu.addFileActions(getSourceLocationFile()->getFilePath());
|
||||
menu.addSeparator();
|
||||
menu.addAction(m_setIDECursorPositionAction);
|
||||
menu.show();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -128,14 +128,8 @@ void QtCodeFileTitleButton::updateTexts()
|
||||
|
||||
void QtCodeFileTitleButton::contextMenuEvent(QContextMenuEvent* event)
|
||||
{
|
||||
QtContextMenu menu(event, this);
|
||||
menu.addSeparator();
|
||||
|
||||
if (!m_filePath.empty())
|
||||
{
|
||||
menu.addFileActions(m_filePath);
|
||||
}
|
||||
else if (text().size())
|
||||
FilePath path = m_filePath;
|
||||
if (text().size())
|
||||
{
|
||||
Project* currentProject = Application::getInstance()->getCurrentProject().get();
|
||||
if (!currentProject)
|
||||
@@ -143,9 +137,12 @@ void QtCodeFileTitleButton::contextMenuEvent(QContextMenuEvent* event)
|
||||
return;
|
||||
}
|
||||
|
||||
menu.addFileActions(currentProject->getProjectSettingsFilePath());
|
||||
path = currentProject->getProjectSettingsFilePath();
|
||||
}
|
||||
|
||||
QtContextMenu menu(event, this);
|
||||
menu.addSeparator();
|
||||
menu.addFileActions(path);
|
||||
menu.show();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user