Merge pull request #9562 from sepalani/dis-icons

Breakpoints: Change icon when disabled
This commit is contained in:
Léo Lam 2021-03-07 12:14:12 +01:00 committed by GitHub
commit 61198541a0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -338,9 +338,19 @@ void CodeViewWidget::Update()
if (PowerPC::debug_interface.IsBreakpoint(addr))
{
bp_item->setData(
Qt::DecorationRole,
Resources::GetScaledThemeIcon("debugger_breakpoint").pixmap(QSize(rowh - 2, rowh - 2)));
auto icon =
Resources::GetScaledThemeIcon("debugger_breakpoint").pixmap(QSize(rowh - 2, rowh - 2));
if (!PowerPC::breakpoints.IsBreakPointEnable(addr))
{
QPixmap disabled_icon(icon.size());
disabled_icon.fill(Qt::transparent);
QPainter p(&disabled_icon);
p.setOpacity(0.20);
p.drawPixmap(0, 0, icon);
p.end();
icon = disabled_icon;
}
bp_item->setData(Qt::DecorationRole, icon);
}
setItem(i, CODE_VIEW_COLUMN_BREAKPOINT, bp_item);