Closing #929 | Color functions at offset 0x00 in the Imports widget (#992)

* Color function at offset 0. Closing #929
This commit is contained in:
Itay Cohen 2018-12-11 20:23:01 +02:00 committed by xarkes
parent 7ce1790fcf
commit ed621e55a8
2 changed files with 9 additions and 1 deletions

View File

@ -156,6 +156,8 @@ void Configuration::loadDefaultTheme()
setColor("gui.navbar.sym", QColor(229, 150, 69));
setColor("gui.navbar.empty", QColor(100, 100, 100));
setColor("gui.breakpoint_background", QColor(233, 143, 143));
setColor("gui.item_invalid", QColor(155, 155, 155));
setColor("gui.item_unsafe", QColor(255, 129, 123));
}
void Configuration::loadBaseDark()
@ -189,6 +191,8 @@ void Configuration::loadBaseDark()
setColor("gui.dataoffset", QColor(255, 255, 255));
// Custom
setColor("gui.imports", QColor(50, 140, 255));
setColor("gui.item_invalid", QColor(155, 155, 155));
setColor("gui.item_unsafe", QColor(255, 129, 123));
setColor("gui.main", QColor(0, 128, 0));
// GUI: navbar

View File

@ -31,8 +31,12 @@ QVariant ImportsModel::data(const QModelIndex &index, int role) const
switch (role) {
case Qt::ForegroundRole:
if (index.column() < ImportsModel::ColumnCount) {
// Red color for unsafe functions
if (banned.match(import.name).hasMatch())
return QColor(255, 129, 123);
return Config()->getColor("gui.item_unsafe");
// Grey color for symbols at offset 0 which can only be filled at runtime
if (import.plt == 0)
return Config()->getColor("gui.item_invalid");
}
break;
case Qt::DisplayRole: