aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui/coreview
diff options
context:
space:
mode:
authorFanda Vacek <vacek@elektroline.cz>2019-02-18 20:07:20 +0100
committerPavel Pisa <pisa@cmp.felk.cvut.cz>2019-02-19 11:26:28 +0100
commitb6355b1d65edfa51c9f80ac4c8c088bf9f19b788 (patch)
treebe83041544feb5811498cb8424413a8a48dd5697 /qtmips_gui/coreview
parent49c367d1d46cbe65de367ccb763f072399c6c05b (diff)
downloadqtmips-b6355b1d65edfa51c9f80ac4c8c088bf9f19b788.tar.gz
qtmips-b6355b1d65edfa51c9f80ac4c8c088bf9f19b788.tar.bz2
qtmips-b6355b1d65edfa51c9f80ac4c8c088bf9f19b788.zip
variable font size
Diffstat (limited to 'qtmips_gui/coreview')
-rw-r--r--qtmips_gui/coreview/adder.cpp3
-rw-r--r--qtmips_gui/coreview/alu.cpp3
-rw-r--r--qtmips_gui/coreview/constant.cpp3
-rw-r--r--qtmips_gui/coreview/instructionview.cpp4
-rw-r--r--qtmips_gui/coreview/logicblock.cpp3
-rw-r--r--qtmips_gui/coreview/memory.cpp3
-rw-r--r--qtmips_gui/coreview/programcounter.cpp5
-rw-r--r--qtmips_gui/coreview/registers.cpp3
-rw-r--r--qtmips_gui/coreview/value.cpp3
9 files changed, 20 insertions, 10 deletions
diff --git a/qtmips_gui/coreview/adder.cpp b/qtmips_gui/coreview/adder.cpp
index 0da3814..d24b603 100644
--- a/qtmips_gui/coreview/adder.cpp
+++ b/qtmips_gui/coreview/adder.cpp
@@ -34,6 +34,7 @@
******************************************************************************/
#include "adder.h"
+#include "fontsize.h"
#include <cmath>
using namespace coreview;
@@ -47,7 +48,7 @@ using namespace coreview;
Adder::Adder() : QGraphicsItem(nullptr), plus("+", this) {
QFont font;
- font.setPointSize(7);
+ font.setPointSize(FontSize::SIZE7);
plus.setFont(font);
QRectF plus_box = plus.boundingRect();
plus.setPos(DENT + (WIDTH-DENT)/2 - plus_box.width()/2, HEIGHT/2 - plus_box.height()/2);
diff --git a/qtmips_gui/coreview/alu.cpp b/qtmips_gui/coreview/alu.cpp
index 5327f4e..31f1529 100644
--- a/qtmips_gui/coreview/alu.cpp
+++ b/qtmips_gui/coreview/alu.cpp
@@ -34,6 +34,7 @@
******************************************************************************/
#include "alu.h"
+#include "fontsize.h"
#include <cmath>
//////////////////////
@@ -46,7 +47,7 @@
coreview::Alu::Alu() : QGraphicsItem(nullptr), name("ALU", this) {
name.setPos(3, 25);
QFont font;
- font.setPointSize(7);
+ font.setPointSize(FontSize::SIZE7);
name.setFont(font);
con_in_a = new Connector(Connector::AX_X);
diff --git a/qtmips_gui/coreview/constant.cpp b/qtmips_gui/coreview/constant.cpp
index 15ebbc7..a4286e6 100644
--- a/qtmips_gui/coreview/constant.cpp
+++ b/qtmips_gui/coreview/constant.cpp
@@ -34,6 +34,7 @@
******************************************************************************/
#include "constant.h"
+#include "fontsize.h"
#include <cmath>
using namespace coreview;
@@ -44,7 +45,7 @@ using namespace coreview;
Constant::Constant(const Connector *con, const QString &text) : QGraphicsObject(nullptr), text(text, this) {
QFont font;
- font.setPointSize(7);
+ font.setPointSize(FontSize::SIZE7);
this->text.setFont(font);
con_our = new Connector(Connector::AX_X);
diff --git a/qtmips_gui/coreview/instructionview.cpp b/qtmips_gui/coreview/instructionview.cpp
index 495edfb..9794ae5 100644
--- a/qtmips_gui/coreview/instructionview.cpp
+++ b/qtmips_gui/coreview/instructionview.cpp
@@ -34,6 +34,8 @@
******************************************************************************/
#include "instructionview.h"
+#include "../fontsize.h"
+
#include <QPainter>
#include <QFont>
@@ -49,7 +51,7 @@ using namespace coreview;
InstructionView::InstructionView() : QGraphicsObject(nullptr), text(this) {
QFont f;
- f.setPointSize(6);
+ f.setPointSize(FontSize::SIZE6);
text.setFont(f);
// Initialize to NOP
diff --git a/qtmips_gui/coreview/logicblock.cpp b/qtmips_gui/coreview/logicblock.cpp
index e2c5e24..dfc77b1 100644
--- a/qtmips_gui/coreview/logicblock.cpp
+++ b/qtmips_gui/coreview/logicblock.cpp
@@ -34,6 +34,7 @@
******************************************************************************/
#include "logicblock.h"
+#include "fontsize.h"
#include <cmath>
using namespace coreview;
@@ -49,7 +50,7 @@ LogicBlock::LogicBlock(QString name) : LogicBlock(QVector<QString>({name})) { }
LogicBlock::LogicBlock(QVector<QString> name) : QGraphicsObject(nullptr) {
QFont font;
- font.setPointSize(7);
+ font.setPointSize(FontSize::SIZE7);
qreal h = 0, w = 0;
for (int i = 0; i < name.size(); i++) {
diff --git a/qtmips_gui/coreview/memory.cpp b/qtmips_gui/coreview/memory.cpp
index 7d30da8..b690db4 100644
--- a/qtmips_gui/coreview/memory.cpp
+++ b/qtmips_gui/coreview/memory.cpp
@@ -34,6 +34,7 @@
******************************************************************************/
#include "memory.h"
+#include "fontsize.h"
#include <cmath>
using namespace coreview;
@@ -49,7 +50,7 @@ Memory::Memory(bool cache_used, const machine::Cache *cch) : QGraphicsObject(nul
cache = cache_used;
QFont font;
- font.setPointSize(7);
+ font.setPointSize(FontSize::SIZE7);
name.setFont(font);
type.setFont(font);
cache_t.setFont(font);
diff --git a/qtmips_gui/coreview/programcounter.cpp b/qtmips_gui/coreview/programcounter.cpp
index 262d122..3a8c068 100644
--- a/qtmips_gui/coreview/programcounter.cpp
+++ b/qtmips_gui/coreview/programcounter.cpp
@@ -34,6 +34,7 @@
******************************************************************************/
#include "programcounter.h"
+#include "fontsize.h"
#include <cmath>
using namespace coreview;
@@ -49,10 +50,10 @@ ProgramCounter::ProgramCounter(machine::QtMipsMachine *machine) : QGraphicsObjec
QFont font;
- font.setPointSize(7);
+ font.setPointSize(FontSize::SIZE7);
name.setPos(WIDTH/2 - name.boundingRect().width()/2, 0);
name.setFont(font);
- font.setPointSize(8);
+ font.setPointSize(FontSize::SIZE8);
value.setText(QString("0x") + QString::number(machine->registers()->read_pc(), 16));
value.setPos(1, HEIGHT - value.boundingRect().height());
value.setFont(font);
diff --git a/qtmips_gui/coreview/registers.cpp b/qtmips_gui/coreview/registers.cpp
index d58109f..8ccff27 100644
--- a/qtmips_gui/coreview/registers.cpp
+++ b/qtmips_gui/coreview/registers.cpp
@@ -34,6 +34,7 @@
******************************************************************************/
#include "registers.h"
+#include "fontsize.h"
#include <cmath>
using namespace coreview;
@@ -56,7 +57,7 @@ Registers::Registers() : QGraphicsObject(nullptr), name("Registers", this) {
// TODO do we want to have any hooks on real registers?
QFont font;
- font.setPointSize(7);
+ font.setPointSize(FontSize::SIZE7);
name.setFont(font);
QRectF name_box = name.boundingRect();
diff --git a/qtmips_gui/coreview/value.cpp b/qtmips_gui/coreview/value.cpp
index 9a3ab09..2be8bb6 100644
--- a/qtmips_gui/coreview/value.cpp
+++ b/qtmips_gui/coreview/value.cpp
@@ -34,6 +34,7 @@
******************************************************************************/
#include "value.h"
+#include "../fontsize.h"
using namespace coreview;
@@ -58,7 +59,7 @@ QRectF Value::boundingRect() const {
void Value::paint(QPainter *painter, const QStyleOptionGraphicsItem *option __attribute__((unused)), QWidget *widget __attribute__((unused))){
QFont f;
- f.setPointSize(7);
+ f.setPointSize(FontSize::SIZE7);
painter->setFont(f);
QRectF rect;