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