From 9a2dd470a09c40fe36117f2c3b8b95c472e13e96 Mon Sep 17 00:00:00 2001 From: aldelaro5 Date: Sat, 5 May 2018 01:31:53 -0400 Subject: [PATCH] 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. --- .../DolphinQt2/Debugger/CodeViewWidget.cpp | 31 ++++++++++--------- 1 file 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,