diff options
author | Pavel Pisa <pisa@cmp.felk.cvut.cz> | 2019-10-10 07:39:50 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-10-10 07:39:50 +0200 |
commit | 9aa03382ea46f87f336dd8f55bcd17423d1632b5 (patch) | |
tree | c1665ae87bc5a1208aa353ad9df2a44185b8e84c /qtmips_gui/registersdock.cpp | |
parent | 7ec180881848027fbad6c7dd84b883c26643103f (diff) | |
parent | 2bfe22d935cb7d7c4f6c75f79ecfb568e75dc5d0 (diff) | |
download | qtmips-9aa03382ea46f87f336dd8f55bcd17423d1632b5.tar.gz qtmips-9aa03382ea46f87f336dd8f55bcd17423d1632b5.tar.bz2 qtmips-9aa03382ea46f87f336dd8f55bcd17423d1632b5.zip |
Merge pull request #3 from MadCatX/dark_themes_compat
Improve UI compatbility with dark color schemes
Diffstat (limited to 'qtmips_gui/registersdock.cpp')
-rw-r--r-- | qtmips_gui/registersdock.cpp | 16 |
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)); } |