mirror of
https://github.com/rizinorg/cutter.git
synced 2025-02-21 14:16:08 +00:00
Added color for import functions (Fix #219)
This commit is contained in:
parent
15a1a6bd9c
commit
ec2dfe83f7
@ -45,6 +45,7 @@ void Configuration::loadDefaultTheme()
|
|||||||
QColor color7 = QColor(215, 135, 0);
|
QColor color7 = QColor(215, 135, 0);
|
||||||
QColor color8 = QColor(108, 108, 108);
|
QColor color8 = QColor(108, 108, 108);
|
||||||
QColor color9 = QColor(96, 48, 0);
|
QColor color9 = QColor(96, 48, 0);
|
||||||
|
QColor colorA = QColor(50, 140, 255);
|
||||||
|
|
||||||
QColor highlightColor = QColor(210, 210, 255);
|
QColor highlightColor = QColor(210, 210, 255);
|
||||||
|
|
||||||
@ -114,6 +115,8 @@ void Configuration::loadDefaultTheme()
|
|||||||
setColor("gui.background", QColor(255, 255, 255));
|
setColor("gui.background", QColor(255, 255, 255));
|
||||||
// Disassembly nodes background
|
// Disassembly nodes background
|
||||||
setColor("gui.alt_background", QColor(245, 250, 255));
|
setColor("gui.alt_background", QColor(245, 250, 255));
|
||||||
|
// Custom
|
||||||
|
setColor("gui.imports", colorA);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -129,6 +132,7 @@ void Configuration::loadDarkTheme()
|
|||||||
QColor color7 = QColor(255, 130, 0);
|
QColor color7 = QColor(255, 130, 0);
|
||||||
QColor color8 = QColor(108, 108, 108);
|
QColor color8 = QColor(108, 108, 108);
|
||||||
QColor color9 = QColor(255, 130, 0);
|
QColor color9 = QColor(255, 130, 0);
|
||||||
|
QColor colorA = QColor(50, 140, 255);
|
||||||
|
|
||||||
QColor highlightColor = QColor(64, 115, 115);
|
QColor highlightColor = QColor(64, 115, 115);
|
||||||
|
|
||||||
@ -198,6 +202,8 @@ void Configuration::loadDarkTheme()
|
|||||||
setColor("gui.background", QColor(36, 66, 79));
|
setColor("gui.background", QColor(36, 66, 79));
|
||||||
// Disassembly nodes background
|
// Disassembly nodes background
|
||||||
setColor("gui.alt_background", QColor(58, 100, 128));
|
setColor("gui.alt_background", QColor(58, 100, 128));
|
||||||
|
// Custom
|
||||||
|
setColor("gui.imports", colorA);
|
||||||
}
|
}
|
||||||
|
|
||||||
const QFont Configuration::getFont() const
|
const QFont Configuration::getFont() const
|
||||||
|
@ -70,6 +70,11 @@ int FunctionModel::columnCount(const QModelIndex &/*parent*/) const
|
|||||||
return ColumnCount;
|
return ColumnCount;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool FunctionModel::functionIsImport(ut64 addr) const
|
||||||
|
{
|
||||||
|
return import_addresses->contains(addr);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
QVariant FunctionModel::data(const QModelIndex &index, int role) const
|
QVariant FunctionModel::data(const QModelIndex &index, int role) const
|
||||||
{
|
{
|
||||||
@ -108,7 +113,7 @@ QVariant FunctionModel::data(const QModelIndex &index, int role) const
|
|||||||
case 1:
|
case 1:
|
||||||
return tr("Size: %1").arg(RSizeString(function.size));
|
return tr("Size: %1").arg(RSizeString(function.size));
|
||||||
case 2:
|
case 2:
|
||||||
return tr("Import: %1").arg(import_addresses->contains(function.offset) ? tr("true") : tr("false"));
|
return tr("Import: %1").arg(functionIsImport(function.offset) ? tr("true") : tr("false"));
|
||||||
default:
|
default:
|
||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
@ -159,6 +164,11 @@ QVariant FunctionModel::data(const QModelIndex &index, int role) const
|
|||||||
return QVariant();
|
return QVariant();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case Qt::ForegroundRole:
|
||||||
|
if (functionIsImport(function.offset))
|
||||||
|
return QVariant(ConfigColor("gui.imports"));
|
||||||
|
return QVariant(QColor(Qt::black));
|
||||||
|
|
||||||
case FunctionDescriptionRole:
|
case FunctionDescriptionRole:
|
||||||
return QVariant::fromValue(function);
|
return QVariant::fromValue(function);
|
||||||
|
|
||||||
@ -570,4 +580,4 @@ void FunctionsWidget::resizeEvent(QResizeEvent *event)
|
|||||||
void FunctionsWidget::setScrollMode()
|
void FunctionsWidget::setScrollMode()
|
||||||
{
|
{
|
||||||
qhelpers::setVerticalScrollMode(ui->functionsTreeView);
|
qhelpers::setVerticalScrollMode(ui->functionsTreeView);
|
||||||
}
|
}
|
||||||
|
@ -33,6 +33,8 @@ private:
|
|||||||
|
|
||||||
int current_index;
|
int current_index;
|
||||||
|
|
||||||
|
bool functionIsImport(ut64 addr) const;
|
||||||
|
|
||||||
public:
|
public:
|
||||||
static const int FunctionDescriptionRole = Qt::UserRole;
|
static const int FunctionDescriptionRole = Qt::UserRole;
|
||||||
static const int IsImportRole = Qt::UserRole + 1;
|
static const int IsImportRole = Qt::UserRole + 1;
|
||||||
|
Loading…
Reference in New Issue
Block a user