summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbd <bdunahu@operationnull.com>2025-04-21 17:09:00 -0400
committerbd <bdunahu@operationnull.com>2025-04-21 17:09:00 -0400
commit812a0036787bea3833bdbf2684a706d4a7165cf1 (patch)
tree4d3fdcf397c4c846f79a9676811252714a8c896f
parent7cad6f05ebed25557fe6a31bfdf6290c72506868 (diff)
Add tab bar
-rw-r--r--gui/gui.cc2
-rw-r--r--gui/gui.ui227
-rw-r--r--gui/resources/styles.qss13
3 files changed, 173 insertions, 69 deletions
diff --git a/gui/gui.cc b/gui/gui.cc
index 294a7d0..30c4a07 100644
--- a/gui/gui.cc
+++ b/gui/gui.cc
@@ -233,11 +233,13 @@ void GUI::onWorkerWriteBackInfo(const std::vector<int> info)
{
if (!info.empty()) {
ui->write_mnemonic->setText(mnemonicToString((Mnemonic)info[0]));
+ ui->write_squashed->setText(QString::number(info[1]));
ui->write_s1->set_value(info[2]);
ui->write_s2->set_value(info[3]);
ui->write_s3->set_value(info[4]);
} else {
ui->write_mnemonic->clear();
+ ui->write_squashed->clear();
ui->write_s1->clear();
ui->write_s2->clear();
ui->write_s3->clear();
diff --git a/gui/gui.ui b/gui/gui.ui
index dbb3a33..e81bca9 100644
--- a/gui/gui.ui
+++ b/gui/gui.ui
@@ -24,81 +24,129 @@
<item>
<layout class="QHBoxLayout" name="storage_view">
<item>
- <layout class="QVBoxLayout" name="registers">
- <item>
- <widget class="QLabel" name="label_5">
- <property name="font">
- <font>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Registers</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTextEdit" name="register_table"/>
- </item>
- </layout>
+ <layout class="QVBoxLayout" name="registers"/>
</item>
<item>
- <layout class="QVBoxLayout" name="dram">
- <item>
- <widget class="QLabel" name="label_10">
- <property name="font">
- <font>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>DRAM</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTextEdit" name="dram_table">
- <property name="minimumSize">
- <size>
- <width>500</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
+ <widget class="QTabWidget" name="storage">
+ <property name="minimumSize">
+ <size>
+ <width>700</width>
+ <height>0</height>
+ </size>
+ </property>
+ <property name="currentIndex">
+ <number>0</number>
+ </property>
+ <widget class="QWidget" name="Registers">
+ <attribute name="title">
+ <string>Registers</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_4">
+ <item row="0" column="0">
+ <widget class="QTextEdit" name="register_table"/>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab">
+ <attribute name="title">
+ <string>DRAM</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout_3">
+ <item row="0" column="0">
+ <widget class="QTextEdit" name="dram_table">
+ <property name="minimumSize">
+ <size>
+ <width>500</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ <widget class="QWidget" name="tab_2">
+ <attribute name="title">
+ <string>Level 1</string>
+ </attribute>
+ <layout class="QGridLayout" name="gridLayout">
+ <item row="0" column="0">
+ <widget class="QTextEdit" name="cache_table">
+ <property name="minimumSize">
+ <size>
+ <width>500</width>
+ <height>0</height>
+ </size>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </widget>
</item>
<item>
- <layout class="QVBoxLayout" name="cache">
- <item>
- <widget class="QLabel" name="label_6">
- <property name="font">
- <font>
- <bold>true</bold>
- </font>
- </property>
- <property name="text">
- <string>Cache</string>
- </property>
- </widget>
- </item>
- <item>
- <widget class="QTextEdit" name="cache_table">
- <property name="minimumSize">
- <size>
- <width>500</width>
- <height>0</height>
- </size>
- </property>
- </widget>
- </item>
- </layout>
+ <layout class="QVBoxLayout" name="dram"/>
+ </item>
+ <item>
+ <layout class="QVBoxLayout" name="cache"/>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="pipe_view">
<item>
+ <widget class="QGroupBox" name="groupBox">
+ <property name="maximumSize">
+ <size>
+ <width>120</width>
+ <height>16777215</height>
+ </size>
+ </property>
+ <property name="title">
+ <string> </string>
+ </property>
+ <property name="alignment">
+ <set>Qt::AlignmentFlag::AlignLeading|Qt::AlignmentFlag::AlignLeft|Qt::AlignmentFlag::AlignTop</set>
+ </property>
+ <layout class="QVBoxLayout" name="verticalLayout_6">
+ <item>
+ <widget class="QLabel" name="label_7">
+ <property name="text">
+ <string>s1</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_8">
+ <property name="text">
+ <string>s2</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_9">
+ <property name="text">
+ <string>s3</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_11">
+ <property name="text">
+ <string>alias</string>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_14">
+ <property name="text">
+ <string>dead</string>
+ </property>
+ </widget>
+ </item>
+ </layout>
+ </widget>
+ </item>
+ <item>
<widget class="QGroupBox" name="Fetch">
<property name="minimumSize">
<size>
@@ -114,6 +162,27 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
+ <widget class="QLabel" name="label_17">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_16">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_15">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="DigitLabel" name="fetch_bits">
<property name="text">
<string/>
@@ -146,6 +215,27 @@
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
+ <widget class="QLabel" name="label_20">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_19">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
+ <widget class="QLabel" name="label_18">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
+ <item>
<widget class="DigitLabel" name="decode_bits">
<property name="text">
<string/>
@@ -314,6 +404,13 @@
</property>
</widget>
</item>
+ <item>
+ <widget class="QLabel" name="write_squashed">
+ <property name="text">
+ <string/>
+ </property>
+ </widget>
+ </item>
</layout>
</widget>
</item>
diff --git a/gui/resources/styles.qss b/gui/resources/styles.qss
index dbaa623..ee92867 100644
--- a/gui/resources/styles.qss
+++ b/gui/resources/styles.qss
@@ -107,14 +107,19 @@ QCheckBox::indicator {
QCheckBox::indicator:unchecked {
}
-/* QCheckBox::indicator:unchecked:pressed { */
-/* image: url(:/images/checkbox_unchecked_pressed.png); */
-/* } */
-
QCheckBox::indicator:checked {
background: "#00cc00";
}
+QTabWidget::tab-bar {
+ alignment: center;
+}
+
+QTabBar::tab:selected {
+ color: "#000200";
+ background-color: "#00cc00";
+}
+
QSlider::groove:horizontal {
height: 10px; /* the groove expands to the size of the slider by default. by giving it a height, it has a fixed size */
background: "#00cc00";