From 5c2de6eccd2d4b32ce81082b82917e8768394ed1 Mon Sep 17 00:00:00 2001 From: bd Date: Fri, 18 Apr 2025 20:08:21 -0400 Subject: Initial retro-theme change --- gui/gui.cc | 2 +- gui/gui.ui | 92 +++++++++++++++++++------------ gui/main.cc | 15 ++++- gui/resources.qrc | 5 +- gui/resources/input.txt | 1 - gui/resources/styles.qss | 139 +++++++++++++++++++++++++++++++++++++++++++++++ 6 files changed, 213 insertions(+), 41 deletions(-) delete mode 100644 gui/resources/input.txt create mode 100644 gui/resources/styles.qss (limited to 'gui') diff --git a/gui/gui.cc b/gui/gui.cc index 7e3ddfe..8281fb1 100644 --- a/gui/gui.cc +++ b/gui/gui.cc @@ -336,7 +336,7 @@ void GUI::on_enabl_cache_checkbox_checkStateChanged(const Qt::CheckState &arg1) void GUI::on_step_btn_clicked() { qDebug() << "Run step button clicked."; - int steps = step_values[ui->step_slider->value()]; + int steps = step_values[ui->step_slider->value()]; emit sendRunSteps(steps); } diff --git a/gui/gui.ui b/gui/gui.ui index 7198a20..ad6275f 100644 --- a/gui/gui.ui +++ b/gui/gui.ui @@ -124,18 +124,21 @@ Fetch + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + - Instruction Bits + - Program Counter + @@ -154,18 +157,21 @@ Decode + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + - Instruction Bits + - Program Counter + @@ -184,11 +190,14 @@ Execute + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + - s1 + @@ -198,28 +207,28 @@ - s2 + - s3 + - Mnemonic + - Program Counter + @@ -238,11 +247,14 @@ Memory + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + - s1 + @@ -252,28 +264,28 @@ - s2 + - s3 + - Mnemonic + - Program Counter + @@ -292,11 +304,14 @@ Write Back + + Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop + - s1 + @@ -306,28 +321,28 @@ - s2 + - s3 + - Mnemonic + - Program Counter + @@ -372,8 +387,14 @@ + + + 400 + 0 + + - Step + Step 1 @@ -421,15 +442,21 @@ - - - - - Upload Program State File - - - - + + + Upload Program State File + + + + + + + Save Current Program State + + + + + @@ -585,13 +612,6 @@ - - - - Save Current Program State - - - diff --git a/gui/main.cc b/gui/main.cc index 5e45465..09bc4e9 100644 --- a/gui/main.cc +++ b/gui/main.cc @@ -1,7 +1,9 @@ -#include "pipe_spec.h" #include "gui.h" #include "logger.h" +#include "pipe_spec.h" #include +#include +#include #include #include @@ -67,6 +69,17 @@ int main(int argc, char **argv) global_log->log(INFO, "Starting QT..."); QApplication a(argc, argv); + + int fId = QFontDatabase::addApplicationFont( + ":/resources/BigBlueTermPlusNerdFontMono-Regular.ttf"); + QFile ssf(":/resources/styles.qss"); + QString f = QFontDatabase::applicationFontFamilies(fId).at(0); + a.setFont(QFont(f)); + + ssf.open(QFile::ReadOnly); + QString ss = QLatin1String(ssf.readAll()); + a.setStyleSheet(ss); + GUI w; w.show(); return a.exec(); diff --git a/gui/resources.qrc b/gui/resources.qrc index 8bfd4e7..59fb36f 100644 --- a/gui/resources.qrc +++ b/gui/resources.qrc @@ -1,6 +1,7 @@ - - resources/input.txt + + resources/styles.qss + resources/BigBlueTermPlusNerdFontMono-Regular.ttf diff --git a/gui/resources/input.txt b/gui/resources/input.txt deleted file mode 100644 index fc1c3cf..0000000 --- a/gui/resources/input.txt +++ /dev/null @@ -1 +0,0 @@ -Lorem Ipsum \ No newline at end of file diff --git a/gui/resources/styles.qss b/gui/resources/styles.qss new file mode 100644 index 0000000..1f1b82f --- /dev/null +++ b/gui/resources/styles.qss @@ -0,0 +1,139 @@ +* { + font-family: "BigBlueTermPlusNerdFontMono", "monospace"; + font-size: 20pt; + color: "#00cc00"; + background-color: "#000004"; +} + +/* main window */ +QWidget { +} + +QGroupBox { + font-size: 17pt; + background-color: "#000004"; + border: 4px solid ; + border-radius: 0px; + margin-bottom: 1ex; /* leave space at the bottom for the title */ +} + +QGroupBox::title { + subcontrol-origin: margin; + subcontrol-position: bottom left; + border-radius: 0px; + padding: 0 2px; + background-color: "#00cc00"; + color: "#000000"; +} + +QLabel { +} + +/* text entry */ +QLineEdit { + font-size: 15pt; + border-radius: 0px; + padding: 0 4px; + selection-background-color: "#00cc00"; +} + +QTextEdit, QListView { + font-size: 10pt; + background-color: "#000004"; +} + +QPushButton { + border: 4px solid "#00cc00"; +} + +QPushButton:pressed { + color: "#000004"; + background-color: "#00cc00"; +} + +QPushButton:flat { + border: none; /* no border for a flat push button */ +} + +QPushButton:default { + border-color: "#00cc00"; +} + +QMenuBar { + background-color: "#00cc00"; + spacing: 3px; /* spacing between menu bar items */ +} + +QMenuBar::item { + padding: 1px 4px; + background: transparent; + border-radius: 4px; +} + +QMenuBar::item:selected { /* when selected using mouse or keyboard */ + background: #a8a8a8; +} + +QMenuBar::item:pressed { + background: #888888; +} + +QCheckBox { + spacing: 5px; +} + +QCheckBox::indicator { + width: 13px; + height: 13px; + border: 2px solid "#00cc00"; +} + +QCheckBox::indicator:unchecked { +} + +/* QCheckBox::indicator:unchecked:pressed { */ +/* image: url(:/images/checkbox_unchecked_pressed.png); */ +/* } */ + +QCheckBox::indicator:checked { + background: "#00cc00"; +} + +QSlider::groove:horizontal { + height: 5px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */ + background: "#00cc00"; + margin: 2px 0; +} + +QSlider::handle:horizontal { + background: "#00cc00"; + width: 10px; + margin: -30px 0; /* handle is placed by default on the contents rect of the groove. Expand outside the groove */ + border-radius: 3px; +} + +QScrollBar:horizontal { + border: 2px solid "#00cc00"; + height: 4px; + margin: 0px 20px 0 20px; +} +QScrollBar::handle:horizontal { + min-width: 20px; +} +QScrollBar::add-line:horizontal { + border: 2px solid "#00cc00"; + width: 4px; + subcontrol-position: right; + subcontrol-origin: margin; +} + +QScrollBar::sub-line:horizontal { + border: 2px solid "#00cc00"; + width: 4px; + subcontrol-position: left; + subcontrol-origin: margin; +} + +/* Local Variables: */ +/* mode: css */ +/* End: */ -- cgit v1.2.3