ui: improvements proposed by Julian Mautner

* automatically expand active class
* increase arrow size
* return child nodes in autocompletions
* always return filters in autocompletions
This commit is contained in:
Eberhard Graether
2015-01-12 23:47:57 +01:00
parent 8242454104
commit 7596c699d6
13 changed files with 103 additions and 55 deletions
+1 -1
View File
@@ -190,7 +190,7 @@ std::shared_ptr<QtGraphNode> QtGraphView::createNodeRecursive(
}
else
{
newNode = std::make_shared<QtGraphNodeAccess>(node.accessType, node.expanded, node.invisibleSubNodeCount);
newNode = std::make_shared<QtGraphNodeAccess>(node.accessType, node.isExpanded(), node.invisibleSubNodeCount);
}
newNode->setPosition(node.position);
+12 -7
View File
@@ -90,6 +90,11 @@ QtCorneredConnection::QtCorneredConnection(
, m_targetParentRect(targetParentRect)
{
this->setAcceptHoverEvents(true);
m_ownerRect.x = m_ownerRect.x - 1;
m_ownerRect.z = m_ownerRect.z + 1;
m_targetRect.x = m_targetRect.x - 1;
m_targetRect.z = m_targetRect.z + 1;
}
QtCorneredConnection::~QtCorneredConnection()
@@ -214,8 +219,8 @@ void QtCorneredConnection::paint(QPainter *painter, const QStyleOptionGraphicsIt
}
}
int arrowLength = 3;
int arrowWidth = 6;
int arrowLength = 5;
int arrowWidth = 8;
QPointF arrow = poly.at(0) + QPointF((poly.at(0).x() - poly.at(1).x() > 0 ? -1 : 1) * arrowLength, -arrowWidth / 2);
path.lineTo(arrow);
@@ -410,7 +415,7 @@ void QtGraphEdge::updateLine()
break;
}
m_child->setPen(QPen(color, getPenWidth()));
m_child->setPen(QPen(color, getPenWidth(), Qt::SolidLine, Qt::RoundCap));
setIsActive(m_isActive);
}
@@ -433,7 +438,7 @@ void QtGraphEdge::setIsActive(bool isActive)
else
{
QPen p = m_child->pen();
p.setWidth(getPenWidth() + 1);
p.setWidthF(getPenWidth() + 1);
m_child->setPen(p);
}
this->setZValue(getZValue(isActive));
@@ -447,7 +452,7 @@ void QtGraphEdge::setIsActive(bool isActive)
else
{
QPen p = m_child->pen();
p.setWidth(getPenWidth());
p.setWidthF(getPenWidth());
m_child->setPen(p);
}
this->setZValue(getZValue(isActive));
@@ -530,13 +535,13 @@ int QtGraphEdge::getZValue(bool active) const
return 1;
}
int QtGraphEdge::getPenWidth() const
float QtGraphEdge::getPenWidth() const
{
if (isAggregation())
{
return getAggregationCount() + 1;
}
return 1;
return 1.5;
}
int QtGraphEdge::getAggregationCount() const
+1 -1
View File
@@ -77,7 +77,7 @@ protected:
private:
bool isAggregation() const;
int getZValue(bool active) const;
int getPenWidth() const;
float getPenWidth() const;
int getAggregationCount() const;
std::weak_ptr<GraphNode> m_owner;