mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-01-24 14:23:36 -05:00
fixed position of scaled/highlighted nodes in node graph (patch from Chozabu)
This commit is contained in:
parent
a9ef48d133
commit
d004056f67
@ -404,7 +404,7 @@ void GraphWidget::setNameSearch(QString s)
|
||||
std::string ns = QString::fromStdString(ni->descString()).toLower().toStdString();
|
||||
|
||||
if (ns.find(qs) != std::string::npos) {
|
||||
std::cout << "found!" << '\n';
|
||||
//std::cout << "found!" << '\n';
|
||||
ni->setNodeDrawSize(22);
|
||||
//std::cout << ni->getNodeDrawSize() << '\n';
|
||||
} else {
|
||||
|
@ -285,7 +285,8 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
|
||||
|
||||
painter->setPen(Qt::NoPen);
|
||||
painter->setBrush(Qt::darkGray);
|
||||
painter->drawEllipse(-7, -7, mNodeDrawSize, mNodeDrawSize);
|
||||
int mNodeDrawSize2 = mNodeDrawSize/2;
|
||||
painter->drawEllipse(-mNodeDrawSize2+3, -mNodeDrawSize2+3, mNodeDrawSize, mNodeDrawSize);
|
||||
|
||||
QRadialGradient gradient(-3, -3, 10);
|
||||
if (option->state & QStyle::State_Sunken)
|
||||
@ -312,7 +313,7 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
|
||||
}
|
||||
painter->setBrush(gradient);
|
||||
painter->setPen(QPen(Qt::black, 0));
|
||||
painter->drawEllipse(-10, -10, mNodeDrawSize, mNodeDrawSize);
|
||||
painter->drawEllipse(-mNodeDrawSize2, -mNodeDrawSize2, mNodeDrawSize, mNodeDrawSize);
|
||||
painter->drawText(-10, 0, QString::fromUtf8(_desc_string.c_str()));
|
||||
|
||||
if (!mDeterminedBB)
|
||||
|
Loading…
Reference in New Issue
Block a user