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.
This commit is contained in:
aldelaro5 2018-05-05 01:31:53 -04:00
parent 9bacb3cb26
commit 9a2dd470a0
No known key found for this signature in database
GPG Key ID: 054DD3E6FF48DB71
1 changed files with 17 additions and 14 deletions

View File

@ -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,