aboutsummaryrefslogtreecommitdiff
path: root/qtmips_gui
diff options
context:
space:
mode:
authorMichal Malý <madcatxster@devoid-pointer.net>2019-10-08 16:48:16 +0200
committerMichal Malý <madcatxster@devoid-pointer.net>2019-10-08 17:34:50 +0200
commite2e9df52ea548ca5fe2e2d7a06841eac380c27b1 (patch)
tree28afd4b10729d97e66865623804ca0bb1ca29756 /qtmips_gui
parentef2279d14d7ef20a3bc32020215ddb6b3f99a9d2 (diff)
downloadqtmips-e2e9df52ea548ca5fe2e2d7a06841eac380c27b1.tar.gz
qtmips-e2e9df52ea548ca5fe2e2d7a06841eac380c27b1.tar.bz2
qtmips-e2e9df52ea548ca5fe2e2d7a06841eac380c27b1.zip
Force black text in RegistersDock
Diffstat (limited to 'qtmips_gui')
-rw-r--r--qtmips_gui/registersdock.cpp16
1 files changed, 11 insertions, 5 deletions
diff --git a/qtmips_gui/registersdock.cpp b/qtmips_gui/registersdock.cpp
index b72696d..fa89c94 100644
--- a/qtmips_gui/registersdock.cpp
+++ b/qtmips_gui/registersdock.cpp
@@ -71,6 +71,8 @@ static const QString labels[] = {
};
RegistersDock::RegistersDock(QWidget *parent) : QDockWidget(parent) {
+ static const QColor defaultTextColor(0, 0, 0);
+
scrollarea = new QScrollArea(this);
scrollarea->setWidgetResizable(true);
widg = new StaticTable(scrollarea);
@@ -78,12 +80,18 @@ RegistersDock::RegistersDock(QWidget *parent) : QDockWidget(parent) {
hi_highlighted = false;
lo_highlighted = false;
+ pal_normal = palette();
+ pal_normal.setColor(QPalette::WindowText, defaultTextColor);
+
#define INIT(X, LABEL) do{ \
X = new QLabel("0x00000000", widg); \
X->setFixedSize(X->sizeHint()); \
X->setText(""); \
+ X->setPalette(pal_normal); \
X->setTextInteractionFlags(Qt::TextSelectableByMouse); \
- widg->addRow({new QLabel(LABEL, widg), X}); \
+ QLabel *l = new QLabel(LABEL, widg); \
+ l->setPalette(pal_normal); \
+ widg->addRow({l, X}); \
} while(false)
for (int i = 0; i < 32; i++)
@@ -98,10 +106,8 @@ RegistersDock::RegistersDock(QWidget *parent) : QDockWidget(parent) {
setObjectName("Registers");
setWindowTitle("Registers");
- pal_normal = QPalette(gp[0]->palette());
- pal_updated = QPalette(gp[0]->palette());
- pal_read = QPalette(gp[0]->palette());
- pal_normal.setColor(QPalette::WindowText, QColor(0, 0, 0));
+ pal_updated = pal_normal;
+ pal_read = pal_normal;
pal_updated.setColor(QPalette::WindowText, QColor(240, 0, 0));
pal_read.setColor(QPalette::WindowText, QColor(0, 0, 240));
}