aboutsummaryrefslogtreecommitdiffstats
path: root/gui/fpgaviewwidget.cc
diff options
context:
space:
mode:
authorMiodrag Milanovic <mmicko@gmail.com>2018-07-12 18:02:57 +0200
committerMiodrag Milanovic <mmicko@gmail.com>2018-07-12 18:03:10 +0200
commit7b9b2bef3c622bd54225c1c44ee63a211e0e1d3e (patch)
tree205e0473e3681c5d2a74a1d286c1d595db3580c5 /gui/fpgaviewwidget.cc
parenta8a3ba264704182547639053f71b0be0b31d05af (diff)
downloadnextpnr-7b9b2bef3c622bd54225c1c44ee63a211e0e1d3e.tar.gz
nextpnr-7b9b2bef3c622bd54225c1c44ee63a211e0e1d3e.tar.bz2
nextpnr-7b9b2bef3c622bd54225c1c44ee63a211e0e1d3e.zip
make colors configurable, changed to gray
Diffstat (limited to 'gui/fpgaviewwidget.cc')
-rw-r--r--gui/fpgaviewwidget.cc21
1 files changed, 14 insertions, 7 deletions
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc
index 7d9d3727..19f7cf0d 100644
--- a/gui/fpgaviewwidget.cc
+++ b/gui/fpgaviewwidget.cc
@@ -243,6 +243,13 @@ void LineShader::draw(const LineShaderData &line, const QMatrix4x4 &projection)
FPGAViewWidget::FPGAViewWidget(QWidget *parent)
: QOpenGLWidget(parent), moveX_(0), moveY_(0), zoom_(10.0f), lineShader_(this), ctx_(nullptr)
{
+ backgroundColor = QColor("#ffffff");
+ gridColor = QColor("#ddd");
+ belColor = QColor("#303030");
+ wireColor = QColor("#303030");
+ pipColor = QColor("#303030");
+ groupColor = QColor("#303030");
+ frameColor = QColor("#0066ba");
auto fmt = format();
fmt.setMajorVersion(3);
fmt.setMinorVersion(1);
@@ -309,7 +316,7 @@ void FPGAViewWidget::initializeGL()
log_error("Could not compile shader.\n");
}
initializeOpenGLFunctions();
- glClearColor(1.0, 1.0, 1.0, 0.0);
+ glClearColor(backgroundColor.red()/255, backgroundColor.green()/255, backgroundColor.blue()/255, 0.0);
}
void FPGAViewWidget::drawElement(LineShaderData &out, const GraphicElement &el)
@@ -346,7 +353,7 @@ void FPGAViewWidget::paintGL()
matrix.translate(moveX_, -moveY_, 0);
// Draw grid.
- auto grid = LineShaderData(0.001f, QColor("#DDD"));
+ auto grid = LineShaderData(0.001f, gridColor);
for (float i = -100.0f; i < 100.0f; i += 1.0f) {
PolyLine(-100.0f, i, 100.0f, i).build(grid);
PolyLine(i, -100.0f, i, 100.0f).build(grid);
@@ -354,7 +361,7 @@ void FPGAViewWidget::paintGL()
lineShader_.draw(grid, matrix);
// Draw Bels.
- auto bels = LineShaderData(0.0005f, QColor("#b000ba"));
+ auto bels = LineShaderData(0.0005f, belColor);
if (ctx_) {
for (auto bel : ctx_->getBels()) {
for (auto &el : ctx_->getBelGraphics(bel))
@@ -364,7 +371,7 @@ void FPGAViewWidget::paintGL()
}
// Draw Wires.
- auto wires = LineShaderData(0.0005f, QColor("#b000ba"));
+ auto wires = LineShaderData(0.0005f, wireColor);
if (ctx_) {
for (auto wire : ctx_->getWires()) {
for (auto &el : ctx_->getWireGraphics(wire))
@@ -374,7 +381,7 @@ void FPGAViewWidget::paintGL()
}
// Draw Pips.
- auto pips = LineShaderData(0.0005f, QColor("#b000ba"));
+ auto pips = LineShaderData(0.0005f, pipColor);
if (ctx_) {
for (auto wire : ctx_->getPips()) {
for (auto &el : ctx_->getPipGraphics(wire))
@@ -384,7 +391,7 @@ void FPGAViewWidget::paintGL()
}
// Draw Groups.
- auto groups = LineShaderData(0.0005f, QColor("#b000ba"));
+ auto groups = LineShaderData(0.0005f, groupColor);
if (ctx_) {
for (auto group : ctx_->getGroups()) {
for (auto &el : ctx_->getGroupGraphics(group))
@@ -394,7 +401,7 @@ void FPGAViewWidget::paintGL()
}
// Draw Frame Graphics.
- auto frames = LineShaderData(0.002f, QColor("#0066ba"));
+ auto frames = LineShaderData(0.002f, frameColor);
if (ctx_) {
for (auto &el : ctx_->getFrameGraphics()) {
drawElement(frames, el);