aboutsummaryrefslogtreecommitdiffstats
path: root/gui
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2018-07-12 22:04:13 +0200
committerClifford Wolf <clifford@clifford.at>2018-07-12 22:04:13 +0200
commitb8a42ff53b1fbb6e03d169d14e58180a750f4cad (patch)
tree72920e1ca49d1520045c5df847abe227f70b2a2a /gui
parentad60ab2ef164678cdde4410906cea674d122bf13 (diff)
downloadnextpnr-b8a42ff53b1fbb6e03d169d14e58180a750f4cad.tar.gz
nextpnr-b8a42ff53b1fbb6e03d169d14e58180a750f4cad.tar.bz2
nextpnr-b8a42ff53b1fbb6e03d169d14e58180a750f4cad.zip
Updates from clang-format
Signed-off-by: Clifford Wolf <clifford@clifford.at>
Diffstat (limited to 'gui')
-rw-r--r--gui/basewindow.h2
-rw-r--r--gui/designwidget.cc10
-rw-r--r--gui/fpgaviewwidget.cc16
-rw-r--r--gui/fpgaviewwidget.h2
4 files changed, 13 insertions, 17 deletions
diff --git a/gui/basewindow.h b/gui/basewindow.h
index c98a0356..ef3dcb95 100644
--- a/gui/basewindow.h
+++ b/gui/basewindow.h
@@ -26,10 +26,10 @@
#include <QMainWindow>
#include <QMenu>
#include <QMenuBar>
+#include <QProgressBar>
#include <QStatusBar>
#include <QTabWidget>
#include <QToolBar>
-#include <QProgressBar>
Q_DECLARE_METATYPE(std::string)
diff --git a/gui/designwidget.cc b/gui/designwidget.cc
index 14de974e..110cf1b7 100644
--- a/gui/designwidget.cc
+++ b/gui/designwidget.cc
@@ -91,7 +91,7 @@ DesignWidget::DesignWidget(QWidget *parent) : QWidget(parent), ctx(nullptr), net
propertyEditor->show();
const QIcon searchIcon(":/icons/resources/zoom.png");
- QLineEdit* lineEdit = new QLineEdit();
+ QLineEdit *lineEdit = new QLineEdit();
lineEdit->setClearButtonEnabled(true);
lineEdit->addAction(searchIcon, QLineEdit::LeadingPosition);
lineEdit->setPlaceholderText("Search...");
@@ -139,17 +139,17 @@ DesignWidget::DesignWidget(QWidget *parent) : QWidget(parent), ctx(nullptr), net
hbox->addWidget(toolbar);
QWidget *btmWidget = new QWidget();
-
+
QVBoxLayout *vbox2 = new QVBoxLayout();
- btmWidget->setLayout(vbox2);
+ btmWidget->setLayout(vbox2);
vbox2->setSpacing(0);
vbox2->setContentsMargins(0, 0, 0, 0);
vbox2->addWidget(toolbarWidget);
vbox2->addWidget(propertyEditor);
QSplitter *splitter = new QSplitter(Qt::Vertical);
- splitter->addWidget(topWidget);
- splitter->addWidget(btmWidget);
+ splitter->addWidget(topWidget);
+ splitter->addWidget(btmWidget);
QGridLayout *mainLayout = new QGridLayout();
mainLayout->setSpacing(0);
diff --git a/gui/fpgaviewwidget.cc b/gui/fpgaviewwidget.cc
index edb3aca8..1b105b98 100644
--- a/gui/fpgaviewwidget.cc
+++ b/gui/fpgaviewwidget.cc
@@ -240,8 +240,7 @@ void LineShader::draw(const LineShaderData &line, const QMatrix4x4 &projection)
vao_.release();
}
-FPGAViewWidget::FPGAViewWidget(QWidget *parent)
- : QOpenGLWidget(parent), lineShader_(this), zoom_(500.f), ctx_(nullptr)
+FPGAViewWidget::FPGAViewWidget(QWidget *parent) : QOpenGLWidget(parent), lineShader_(this), zoom_(500.f), ctx_(nullptr)
{
backgroundColor = QColor("#ffffff");
gridColor = QColor("#ddd");
@@ -284,7 +283,7 @@ void FPGAViewWidget::initializeGL()
log_error("Could not compile shader.\n");
}
initializeOpenGLFunctions();
- glClearColor(backgroundColor.red()/255, backgroundColor.green()/255, backgroundColor.blue()/255, 0.0);
+ glClearColor(backgroundColor.red() / 255, backgroundColor.green() / 255, backgroundColor.blue() / 255, 0.0);
}
void FPGAViewWidget::drawElement(LineShaderData &out, const GraphicElement &el)
@@ -311,7 +310,7 @@ QMatrix4x4 FPGAViewWidget::getProjection(void)
QMatrix4x4 matrix;
const float aspect = float(width()) / float(height());
- matrix.perspective(3.14/2, aspect, zoomNear_, zoomFar_);
+ matrix.perspective(3.14 / 2, aspect, zoomNear_, zoomFar_);
matrix.translate(0.0f, 0.0f, -zoom_);
return matrix;
}
@@ -391,10 +390,7 @@ void FPGAViewWidget::paintGL()
void FPGAViewWidget::resizeGL(int width, int height) {}
-void FPGAViewWidget::mousePressEvent(QMouseEvent *event)
-{
- lastPos_ = event->pos();
-}
+void FPGAViewWidget::mousePressEvent(QMouseEvent *event) { lastPos_ = event->pos(); }
// Invert the projection matrix to calculate screen/mouse to world/grid
// coordinates.
@@ -403,8 +399,8 @@ QVector4D FPGAViewWidget::mouseToWorldCoordinates(int x, int y)
QMatrix4x4 p = getProjection();
QVector2D unit = p.map(QVector4D(1, 1, 0, 1)).toVector2DAffine();
- float sx = (((float)x) / (width()/2));
- float sy = (((float)y) / (height()/2));
+ float sx = (((float)x) / (width() / 2));
+ float sy = (((float)y) / (height() / 2));
return QVector4D(sx / unit.x(), sy / unit.y(), 0, 1);
}
diff --git a/gui/fpgaviewwidget.h b/gui/fpgaviewwidget.h
index 526c6199..a2495f4e 100644
--- a/gui/fpgaviewwidget.h
+++ b/gui/fpgaviewwidget.h
@@ -258,7 +258,7 @@ class FPGAViewWidget : public QOpenGLWidget, protected QOpenGLFunctions
QMatrix4x4 getProjection(void);
QVector4D mouseToWorldCoordinates(int x, int y);
- const float zoomNear_ = 1.0f; // do not zoom closer than this
+ const float zoomNear_ = 1.0f; // do not zoom closer than this
const float zoomFar_ = 10000.0f; // do not zoom further than this
const float zoomLvl1_ = 100.0f;