mirror of
https://github.com/RetroShare/RetroShare.git
synced 2025-07-19 20:59:02 -04:00
Merge 557e24a5dc
into f3150e9d42
This commit is contained in:
commit
92ebcf83d4
3 changed files with 23 additions and 5 deletions
|
@ -21,6 +21,7 @@
|
|||
// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-diagramscene-arrow-cpp.html
|
||||
|
||||
#include <QPainter>
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
|
||||
#include "arrow.h"
|
||||
#include "elnode.h"
|
||||
|
@ -121,8 +122,11 @@ void Arrow::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *
|
|||
cos(angle - Pi / 3) * arrowSize);
|
||||
QPointF destArrowP2 = destPoint + QPointF(sin(angle - Pi + Pi / 3) * arrowSize,
|
||||
cos(angle - Pi + Pi / 3) * arrowSize);
|
||||
|
||||
painter->setBrush(Qt::black);
|
||||
if (Settings->getSheetName() == ":Standard_Dark"){
|
||||
painter->setBrush(Qt::white);
|
||||
} else {
|
||||
painter->setBrush(Qt::black);
|
||||
}
|
||||
painter->drawPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2);
|
||||
painter->drawPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-edge-cpp.html
|
||||
|
||||
#include <QPainter>
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
|
||||
#include "edge.h"
|
||||
#include "elnode.h"
|
||||
|
@ -103,7 +104,11 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
|||
|
||||
// Draw the line itself
|
||||
QLineF line(sourcePoint, destPoint);
|
||||
painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
if (Settings->getSheetName() == ":Standard_Dark"){
|
||||
painter->setPen(QPen(Qt::white, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
} else {
|
||||
painter->setPen(QPen(Qt::black, 1, Qt::SolidLine, Qt::RoundCap, Qt::RoundJoin));
|
||||
}
|
||||
painter->drawLine(line);
|
||||
|
||||
return ;
|
||||
|
@ -146,7 +151,11 @@ void Edge::paint(QPainter *painter, const QStyleOptionGraphicsItem *, QWidget *)
|
|||
QPointF destArrowP1 = destPoint + QPointF( sin_theta_mins_pi_over_3 * arrowSize, cos_theta_mins_pi_over_3 * arrowSize);
|
||||
QPointF destArrowP2 = destPoint + QPointF(sin_theta_mins_2_pi_over_3 * arrowSize, cos_theta_mins_2_pi_over_3 * arrowSize);
|
||||
|
||||
painter->setBrush(Qt::black);
|
||||
if (Settings->getSheetName() == ":Standard_Dark"){
|
||||
painter->setBrush(Qt::white);
|
||||
}else {
|
||||
painter->setBrush(Qt::black);
|
||||
}
|
||||
painter->drawConvexPolygon(QPolygonF() << line.p1() << sourceArrowP1 << sourceArrowP2);
|
||||
painter->drawConvexPolygon(QPolygonF() << line.p2() << destArrowP1 << destArrowP2);
|
||||
}
|
||||
|
|
|
@ -21,6 +21,7 @@
|
|||
// This code is inspired from http://doc.qt.io/qt-5/qtwidgets-graphicsview-elasticnodes-node-cpp.html
|
||||
|
||||
#include "gui/common/FilesDefs.h"
|
||||
#include "gui/settings/rsharesettings.h"
|
||||
#include <math.h>
|
||||
|
||||
#include <QApplication>
|
||||
|
@ -302,7 +303,11 @@ void Node::paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWid
|
|||
#endif
|
||||
}
|
||||
painter->setBrush(gradient);
|
||||
painter->setPen(QPen(Qt::black, 0));
|
||||
if (Settings->getSheetName() == ":Standard_Dark"){
|
||||
painter->setPen(QPen(Qt::white, 0));
|
||||
} else {
|
||||
painter->setPen(QPen(Qt::black, 0));
|
||||
}
|
||||
painter->drawEllipse(-mNodeDrawSize2, -mNodeDrawSize2, mNodeDrawSize, mNodeDrawSize);
|
||||
|
||||
QString txt = QString::fromUtf8(_desc_string.c_str());
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue