mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2024-11-15 05:47:56 -07:00
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:
parent
9bacb3cb26
commit
9a2dd470a0
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user