ui: Added expand and collapse node actions to graph view context menu
* expand/collapse node via graph view context menu * also possible with Shift + Left Click
This commit is contained in:
@@ -11,7 +11,9 @@
|
||||
#include "qt/utility/utilityQt.h"
|
||||
#include "qt/view/graphElements/nodeComponents/QtGraphNodeComponent.h"
|
||||
#include "qt/view/graphElements/QtGraphEdge.h"
|
||||
#include "qt/view/graphElements/QtGraphNodeExpandToggle.h"
|
||||
#include "utility/messaging/type/code/MessageCodeShowDefinition.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeExpand.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeHide.h"
|
||||
#include "utility/messaging/type/MessageGraphNodeMove.h"
|
||||
#include "utility/ResourcePaths.h"
|
||||
@@ -394,6 +396,23 @@ void QtGraphNode::onHide()
|
||||
}
|
||||
}
|
||||
|
||||
void QtGraphNode::onCollapseExpand()
|
||||
{
|
||||
for (auto subNode : getSubNodes())
|
||||
{
|
||||
if (subNode->isExpandToggleNode())
|
||||
{
|
||||
MessageGraphNodeExpand(getTokenId(), !dynamic_cast<QtGraphNodeExpandToggle*>(subNode)->isExpanded()).dispatch();
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
if (getParent())
|
||||
{
|
||||
getParent()->onCollapseExpand();
|
||||
}
|
||||
}
|
||||
|
||||
void QtGraphNode::onShowDefinition()
|
||||
{
|
||||
Id tokenId = getTokenId();
|
||||
|
||||
Reference in New Issue
Block a user