ui: show tooltips when hovering nodes and edges

This commit is contained in:
Eberhard Graether
2015-09-24 16:18:23 +02:00
parent b8c95c5a20
commit ae27d8025b
10 changed files with 43 additions and 22 deletions
+8 -8
View File
@@ -148,10 +148,10 @@
<normal>#7BB5D4</normal>
<hover>#42A1D4</hover>
</field>
<global>
<global_variable>
<normal>#7BB5D4</normal>
<hover>#42A1D4</hover>
</global>
</global_variable>
<undefined_variable>
<normal>#7BB5D4</normal>
<hover>#42A1D4</hover>
@@ -176,10 +176,10 @@
</file>
</node>
<edge>
<type_use>
<type_of>
<normal>#878787</normal>
<hover>#878787</hover>
</type_use>
</type_of>
<return_type>
<normal>#878787</normal>
<hover>#878787</hover>
@@ -188,10 +188,10 @@
<normal>#878787</normal>
<hover>#878787</hover>
</parameter_type>
<type_usage>
<type_use>
<normal>#878787</normal>
<hover>#878787</hover>
</type_usage>
</type_use>
<inheritance>
<normal>#878787</normal>
<hover>#878787</hover>
@@ -211,10 +211,10 @@
<hover>#F4BC3D</hover>
</call>
<usage>
<use>
<normal>#3190BA</normal>
<hover>#3190BA</hover>
</usage>
</use>
<template_parameter>
<normal>#C1305D</normal>
+8 -8
View File
@@ -148,10 +148,10 @@
<normal>#21516B</normal>
<hover>#2A6484</hover>
</field>
<global>
<global_variable>
<normal>#21516B</normal>
<hover>#2A6484</hover>
</global>
</global_variable>
<undefined_variable>
<normal>#21516B</normal>
<hover>#2A6484</hover>
@@ -176,10 +176,10 @@
</file>
</node>
<edge>
<type_use>
<type_of>
<normal>#797979</normal>
<hover>#797979</hover>
</type_use>
</type_of>
<return_type>
<normal>#797979</normal>
<hover>#797979</hover>
@@ -188,10 +188,10 @@
<normal>#797979</normal>
<hover>#797979</hover>
</parameter_type>
<type_usage>
<type_use>
<normal>#797979</normal>
<hover>#797979</hover>
</type_usage>
</type_use>
<inheritance>
<normal>#797979</normal>
<hover>#797979</hover>
@@ -211,10 +211,10 @@
<hover>#9C8528</hover>
</call>
<usage>
<use>
<normal>#2A6484</normal>
<hover>#2A6484</hover>
</usage>
</use>
<template_parameter>
<normal>#C1305D</normal>
@@ -0,0 +1,5 @@
QToolTip {
background-color: <color:tool_tip/background>;
color: <color:tool_tip/text>;
font-size: <setting:font_size>pt;
}
+2 -2
View File
@@ -217,8 +217,8 @@ FileManager.cpp ERROR: No FileInfo found for file: input.cc
Token.cpp ERROR: Location Id was not referenced by this Token.
Node.cpp WARNING: Cannot change NodeType after it was already set from namespace to class
Edge.cpp ERROR: Nodes are not plain copies.
Edge.cpp ERROR: Edge usage can't go from Node undefined to Node undefined
Edge.cpp ERROR: Edge usage can't go from Node undefined to Node undefined
Edge.cpp ERROR: Edge use can't go from Node undefined to Node undefined
Edge.cpp ERROR: Edge use can't go from Node undefined to Node undefined
Settings.cpp WARNING: File for Settings not found: data/SettingsTestSuite/wrong_settings.xml
ConfigManager.cpp WARNING: value Bool is not present in config.
ConfigManager.cpp WARNING: value Int is not present in config.
+3
View File
@@ -246,6 +246,9 @@ void QtGraphView::doRefreshView()
utility::setWidgetBackgroundColor(QtViewWidgetWrapper::getWidgetOfView(this), backgroundColor);
utility::setWidgetBackgroundColor(getView(), backgroundColor);
std::string css = utility::getStyleSheet("data/gui/graph_view/graph_view.css");
getView()->setStyleSheet(css.c_str());
}
std::shared_ptr<QtGraphNode> QtGraphView::findNodeRecursive(const std::list<std::shared_ptr<QtGraphNode>>& nodes, Id tokenId)
@@ -117,6 +117,15 @@ void QtGraphEdge::updateLine()
}
}
if (m_data)
{
m_child->setToolTip(QString::fromStdString(m_data->getTypeString()));
}
else
{
m_child->setToolTip(QString::fromStdString(Edge::getTypeString(Edge::EDGE_AGGREGATION)));
}
this->setZValue(style.zValue); // Used to draw edges always on top of nodes.
}
@@ -19,6 +19,8 @@ QtGraphNodeBundle::QtGraphNodeBundle(Id tokenId, size_t nodeCount, std::string n
m_circle->setNumber(nodeCount);
this->setAcceptHoverEvents(true);
this->setToolTip("bundle");
}
QtGraphNodeBundle::~QtGraphNodeBundle()
@@ -19,6 +19,8 @@ QtGraphNodeData::QtGraphNodeData(const Node* data, bool hasParent, bool childVis
{
this->setName(data->getName());
}
this->setToolTip(QString::fromStdString(data->getTypeString()));
}
QtGraphNodeData::~QtGraphNodeData()
+3 -3
View File
@@ -185,13 +185,13 @@ std::string Edge::getTypeString(EdgeType type)
case EDGE_MEMBER:
return "child";
case EDGE_TYPE_OF:
return "type_use";
return "type_of";
case EDGE_RETURN_TYPE_OF:
return "return_type";
case EDGE_PARAMETER_TYPE_OF:
return "parameter_type";
case EDGE_TYPE_USAGE:
return "type_usage";
return "type_use";
case EDGE_INHERITANCE:
return "inheritance";
case EDGE_OVERRIDE:
@@ -199,7 +199,7 @@ std::string Edge::getTypeString(EdgeType type)
case EDGE_CALL:
return "call";
case EDGE_USAGE:
return "usage";
return "use";
case EDGE_TYPEDEF_OF:
return "typedef";
case EDGE_TEMPLATE_PARAMETER_OF:
+1 -1
View File
@@ -28,7 +28,7 @@ std::string Node::getTypeString(NodeType type)
case NODE_STRUCT:
return "struct";
case NODE_GLOBAL_VARIABLE:
return "global";
return "global_variable";
case NODE_FIELD:
return "field";
case NODE_FUNCTION: