diff options
| author | aldelaro5 <aldelaro5@gmail.com> | 2018-05-05 01:31:53 -0400 |
|---|---|---|
| committer | aldelaro5 <aldelaro5@gmail.com> | 2018-05-12 15:47:16 -0400 |
| commit | 9a2dd470a09c40fe36117f2c3b8b95c472e13e96 (patch) | |
| tree | 2aebc91bff675ba3f223a819886cc91a609782e5 /Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp | |
| parent | 9bacb3cb262611eeaaac08a959d2f70026fd67ff (diff) | |
Qt/debugger: change some colors logic in the codeWidget
This commit makes the colors hardcoded except when there is no symbols loaded, in which case, it uses the theme colors, except for the PC which is hardcoded to black on green. This makes a compromise between making use of the corespoinding theme color and the text being nicely readable on all themes.
Diffstat (limited to 'Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp')
| -rw-r--r-- | Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp | 31 |
1 files changed, 17 insertions, 14 deletions
diff --git a/Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp b/Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp index 0705dc5708..f4fb25544d 100644 --- a/Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp +++ b/Source/Core/DolphinQt2/Debugger/CodeViewWidget.cpp @@ -119,6 +119,23 @@ void CodeViewWidget::Update() auto* param_item = new QTableWidgetItem(QString::fromStdString(param)); auto* description_item = new QTableWidgetItem(QString::fromStdString(desc)); + for (auto* item : {bp_item, addr_item, ins_item, param_item, description_item}) + { + item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); + item->setData(Qt::UserRole, addr); + + if (color != 0xFFFFFF) + { + item->setForeground(QColor(Qt::black)); + item->setBackground(QColor(color)); + } + if (addr == pc && item != bp_item) + { + item->setBackground(QColor(Qt::green)); + item->setForeground(QColor(Qt::black)); + } + } + // look for hex strings to decode branches std::string hex_str; size_t pos = param.find("0x"); @@ -137,20 +154,6 @@ void CodeViewWidget::Update() if (ins == "blr") ins_item->setForeground(Qt::darkGreen); - for (auto* item : {bp_item, addr_item, ins_item, param_item, description_item}) - { - item->setFlags(Qt::ItemIsEnabled | Qt::ItemIsSelectable); - item->setData(Qt::UserRole, addr); - - if (color != 0xFFFFFF) - item->setBackground(QColor(color).darker(110)); - - if (addr == pc && item != bp_item) - { - item->setBackground(QColor(Qt::green).darker(110)); - } - } - if (PowerPC::debug_interface.IsBreakpoint(addr)) { bp_item->setData(Qt::DecorationRole, |
