diff --git a/src/lib/component/controller/GraphController.cpp b/src/lib/component/controller/GraphController.cpp index f6a74d34..fbec36e9 100644 --- a/src/lib/component/controller/GraphController.cpp +++ b/src/lib/component/controller/GraphController.cpp @@ -18,6 +18,7 @@ #include "StorageAccess.h" #include "TokenComponentAccess.h" #include "TokenComponentFilePath.h" +#include "TokenComponentInheritanceChain.h" #include "Graph.h" #include "AccessKind.h" #include "ApplicationSettings.h" @@ -2600,10 +2601,15 @@ void GraphController::createLegendGraph() { addText(L"class inheritance", 0, Vec2i(x, y + dy * ++i)); - Node* base = addNode(NodeType::NODE_CLASS, L"Base Class", Vec2i(x, y + dy * ++i)); - i += 2; - Node* derived = addNode(NodeType::NODE_CLASS, L"Derived Class", Vec2i(x, y + dy * i)); + Node* base = addNode(NodeType::NODE_CLASS, L"Base Class", Vec2i(x, y + dy * (i + 1))); + Node* derived = addNode(NodeType::NODE_CLASS, L"Derived Class", Vec2i(x, y + dy * (i + 3))); addEdge(Edge::EDGE_INHERITANCE, derived, base); + + Node* base2 = addNode(NodeType::NODE_CLASS, L"Base Class", Vec2i(x + 180, y + dy * (i + 1))); + Node* derived2 = addNode(NodeType::NODE_CLASS, L"Derived Derived Class", Vec2i(x + 180, y + dy * (i + 3))); + Edge* edge = addEdge(Edge::EDGE_INHERITANCE, derived2, base2); + edge->addComponent(std::make_shared(std::vector({ 1, 2 }))); + i += 3; } { diff --git a/src/lib_gui/qt/view/graphElements/QtGraphEdge.cpp b/src/lib_gui/qt/view/graphElements/QtGraphEdge.cpp index 1a93037f..7647d96c 100644 --- a/src/lib_gui/qt/view/graphElements/QtGraphEdge.cpp +++ b/src/lib_gui/qt/view/graphElements/QtGraphEdge.cpp @@ -375,6 +375,15 @@ void QtGraphEdge::focusIn() } info.offset = Vec2i(10, 20); + if (type == Edge::EDGE_INHERITANCE && getData()) + { + TokenComponentInheritanceChain* componentInheritance = getData()->getComponent(); + if (componentInheritance && componentInheritance->inheritanceEdgeIds.size() > 1) + { + info.title = L"multi-level " + info.title; + } + } + MessageTooltipShow(info, TOOLTIP_ORIGIN_GRAPH).dispatch(); } }