Dark theme for hex_viewer
This commit is contained in:
parent
ede73f1663
commit
69c58ef826
|
@ -169,6 +169,8 @@ set(hex_viewer_SOURCES
|
|||
"hex_viewer/DataExplorerDialog.cpp"
|
||||
"hex_viewer/DataExplorerDialog.h"
|
||||
"hex_viewer/DataExplorerDialog.ui"
|
||||
"hex_viewer/DataTable.cpp"
|
||||
"hex_viewer/DataTable.h"
|
||||
"hex_viewer/File.cpp"
|
||||
"hex_viewer/File.h"
|
||||
"hex_viewer/GotoDialog.cpp"
|
||||
|
|
|
@ -67,24 +67,25 @@ class CodeEditor : public QPlainTextEdit, Styled<CodeEditor>
|
|||
Q_OBJECT
|
||||
|
||||
public:
|
||||
CSS_COLOR(selectedLineHighlightColor, "#DFDBBE");
|
||||
CSS_COLOR(errorLineHighlightColor, "#FF9999");
|
||||
CSS_COLOR(lineNumberColor, "#8799C4");
|
||||
CSS_COLOR(lineNumberBackgroundColor, "#fefff7");
|
||||
// One Dark Pro
|
||||
CSS_COLOR(selectedLineHighlightColor, "#2c313c");
|
||||
CSS_COLOR(errorLineHighlightColor, "#c24039");
|
||||
CSS_COLOR(lineNumberColor, "#5c6370");
|
||||
CSS_COLOR(lineNumberBackgroundColor, "#282c34");
|
||||
|
||||
CSS_COLOR(keywordColor, "#800000");
|
||||
CSS_COLOR(instructionColor, "#333F47");
|
||||
CSS_COLOR(keywordColor, "#c678dd");
|
||||
CSS_COLOR(instructionColor, "#c678dd");
|
||||
|
||||
CSS_COLOR(globalVariableColor, "#1BA7B3");
|
||||
CSS_COLOR(localVariableColor, "#E90B55");
|
||||
CSS_COLOR(constantColor, "#A34784");
|
||||
CSS_COLOR(integerTypeColor, "#1BA7B3");
|
||||
CSS_COLOR(globalVariableColor, "#e06c75");
|
||||
CSS_COLOR(localVariableColor, "#e06c75");
|
||||
CSS_COLOR(constantColor, "#56b6c2");
|
||||
CSS_COLOR(integerTypeColor, "#d19a66");
|
||||
|
||||
CSS_COLOR(commentColor, "#8799C4");
|
||||
CSS_COLOR(metadataColor, "#8799C4");
|
||||
CSS_COLOR(functionColor, "#006793");
|
||||
CSS_COLOR(stringColor, "#008000");
|
||||
CSS_COLOR(operatorColor, "#C2492E");
|
||||
CSS_COLOR(commentColor, "#5c6370");
|
||||
CSS_COLOR(metadataColor, "#5c6370");
|
||||
CSS_COLOR(functionColor, "#61afef");
|
||||
CSS_COLOR(stringColor, "#98c379");
|
||||
CSS_COLOR(operatorColor, "#c678dd");
|
||||
|
||||
public:
|
||||
CodeEditor(QWidget* parent = nullptr);
|
||||
|
|
|
@ -6,6 +6,7 @@
|
|||
#include <QSettings>
|
||||
#include "PatternHighlighter.h"
|
||||
#include "Bridge.h"
|
||||
#include "Configuration.h"
|
||||
|
||||
#include <unordered_map>
|
||||
|
||||
|
@ -93,13 +94,14 @@ struct PatternVisitor
|
|||
}
|
||||
};
|
||||
|
||||
DataExplorerDialog::DataExplorerDialog(QWidget* parent) : QDialog(parent), ui(new Ui::DataExplorerDialog)
|
||||
DataExplorerDialog::DataExplorerDialog(QWidget* parent) : QWidget(parent), ui(new Ui::DataExplorerDialog)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
setWindowFlags(windowFlags() & ~Qt::WindowContextHelpButtonHint);
|
||||
setFixedSize(size());
|
||||
|
||||
ui->codeEdit->setFont(QFont("Courier New", 8));
|
||||
auto font = Config()->monospaceFont();
|
||||
font.setPointSize(28);
|
||||
//ui->codeEdit->setFont(font);
|
||||
|
||||
auto action = new QAction(ui->codeEdit);
|
||||
action->setShortcut(QKeySequence("Ctrl+R"));
|
||||
|
@ -108,22 +110,6 @@ DataExplorerDialog::DataExplorerDialog(QWidget* parent) : QDialog(parent), ui(ne
|
|||
|
||||
mVisitor = new PatternVisitor;
|
||||
mHighlighter = new PatternHighlighter(ui->codeEdit, ui->codeEdit->document());
|
||||
|
||||
// Restore settings
|
||||
{
|
||||
QSettings settings("DataExplorer");
|
||||
|
||||
auto cursor = ui->codeEdit->textCursor();
|
||||
auto savedPosition = settings.value("cursor", cursor.position()).toInt();
|
||||
auto savedCode = settings.value("code", ui->codeEdit->toPlainText()).toString();
|
||||
ui->codeEdit->setPlainText(savedCode);
|
||||
cursor.setPosition(savedPosition);
|
||||
ui->codeEdit->setTextCursor(cursor);
|
||||
|
||||
restoreGeometry(settings.value("geometry").toByteArray());
|
||||
if(settings.value("visible").toBool())
|
||||
show();
|
||||
}
|
||||
}
|
||||
|
||||
DataExplorerDialog::~DataExplorerDialog()
|
||||
|
@ -133,17 +119,6 @@ DataExplorerDialog::~DataExplorerDialog()
|
|||
delete mHighlighter;
|
||||
}
|
||||
|
||||
void DataExplorerDialog::closeEvent(QCloseEvent* event)
|
||||
{
|
||||
QSettings settings("DataExplorer");
|
||||
settings.setValue("code", ui->codeEdit->toPlainText());
|
||||
settings.setValue("cursor", ui->codeEdit->textCursor().position());
|
||||
settings.setValue("geometry", saveGeometry());
|
||||
settings.setValue("visible", isVisible());
|
||||
|
||||
QDialog::closeEvent(event);
|
||||
}
|
||||
|
||||
void DataExplorerDialog::changeEvent(QEvent* event)
|
||||
{
|
||||
if (event->type() == QEvent::StyleChange)
|
||||
|
@ -159,7 +134,7 @@ void DataExplorerDialog::changeEvent(QEvent* event)
|
|||
mHighlighter->setDocument(ui->codeEdit->document());
|
||||
}
|
||||
}
|
||||
QDialog::changeEvent(event);
|
||||
QWidget::changeEvent(event);
|
||||
}
|
||||
|
||||
void DataExplorerDialog::on_buttonParse_pressed()
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#pragma once
|
||||
|
||||
#include <QDialog>
|
||||
#include <QWidget>
|
||||
|
||||
#include "PatternLanguage.h"
|
||||
|
||||
|
@ -9,7 +9,7 @@ namespace Ui
|
|||
class DataExplorerDialog;
|
||||
}
|
||||
|
||||
class DataExplorerDialog : public QDialog
|
||||
class DataExplorerDialog : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
|
@ -18,7 +18,6 @@ public:
|
|||
~DataExplorerDialog();
|
||||
|
||||
protected:
|
||||
void closeEvent(QCloseEvent* event) override;
|
||||
void changeEvent(QEvent* event) override;
|
||||
|
||||
private slots:
|
||||
|
|
|
@ -1,7 +1,7 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DataExplorerDialog</class>
|
||||
<widget class="QDialog" name="DataExplorerDialog">
|
||||
<widget class="QWidget" name="DataExplorerDialog">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
|
@ -13,10 +13,6 @@
|
|||
<property name="windowTitle">
|
||||
<string>DataExplorer</string>
|
||||
</property>
|
||||
<property name="windowIcon">
|
||||
<iconset resource="resource.qrc">
|
||||
<normaloff>:/images/icon.png</normaloff>:/images/icon.png</iconset>
|
||||
</property>
|
||||
<widget class="CodeEditor" name="codeEdit">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
|
@ -26,13 +22,6 @@
|
|||
<height>401</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
<pointsize>8</pointsize>
|
||||
<bold>true</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="styleSheet">
|
||||
<string notr="true">CodeEditor {
|
||||
font-family: "Courier New", "Courier", monospace;
|
||||
|
@ -65,7 +54,7 @@ struct Test {
|
|||
Cat c2[2];
|
||||
};
|
||||
|
||||
Test t @ 0x2;</string>
|
||||
Test t @ 0x3;</string>
|
||||
</property>
|
||||
</widget>
|
||||
<widget class="QLabel" name="label">
|
||||
|
@ -90,11 +79,6 @@ Test t @ 0x2;</string>
|
|||
<height>181</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Courier New</family>
|
||||
</font>
|
||||
</property>
|
||||
<property name="openLinks">
|
||||
<bool>false</bool>
|
||||
</property>
|
||||
|
@ -110,9 +94,9 @@ Test t @ 0x2;</string>
|
|||
</property>
|
||||
<property name="font">
|
||||
<font>
|
||||
<family>Segoe UI Emoji</family>
|
||||
<family>Apple Symbols</family>
|
||||
<pointsize>12</pointsize>
|
||||
<bold>true</bold>
|
||||
<bold>false</bold>
|
||||
</font>
|
||||
</property>
|
||||
<property name="toolTip">
|
||||
|
@ -138,8 +122,6 @@ Test t @ 0x2;</string>
|
|||
<header>CodeEditor.h</header>
|
||||
</customwidget>
|
||||
</customwidgets>
|
||||
<resources>
|
||||
<include location="resource.qrc"/>
|
||||
</resources>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
||||
|
|
|
@ -0,0 +1,72 @@
|
|||
#include "DataTable.h"
|
||||
#include "Bridge.h"
|
||||
|
||||
#include <QDebug>
|
||||
|
||||
DataTable::DataTable(QWidget *parent)
|
||||
: StdTable(parent)
|
||||
{
|
||||
auto type = [this](const QString& name, DataFn fn) {
|
||||
mTypes.emplace_back(name, std::move(fn));
|
||||
};
|
||||
|
||||
type("Binary (u8)", [this](duint start, duint end) {
|
||||
uint8_t data = 0;
|
||||
read(&data, start, sizeof(data));
|
||||
uint8_t mask = 0x80;
|
||||
QString result = "0b0";
|
||||
for(int i = 0; i < 8; i++)
|
||||
{
|
||||
if(data & mask)
|
||||
result += "1";
|
||||
else
|
||||
result += "0";
|
||||
}
|
||||
return result;
|
||||
});
|
||||
type("uint8_t", [this](duint start, duint end) {
|
||||
return primitive<uint8_t>(start);
|
||||
});
|
||||
type("int8_t", [this](duint start, duint end) {
|
||||
return primitive<int8_t>(start);
|
||||
});
|
||||
type("uint16_t", [this](duint start, duint end) {
|
||||
uint16_t data = 0;
|
||||
read(&data, start, sizeof(data));
|
||||
return QString("%1").arg(data);
|
||||
});
|
||||
type("int16_t", [this](duint start, duint end) {
|
||||
int16_t data = 0;
|
||||
read(&data, start, sizeof(data));
|
||||
return QString("%1").arg(data);
|
||||
});
|
||||
|
||||
int width = 1;
|
||||
for(size_t i = 0; i < mTypes.size(); i++)
|
||||
{
|
||||
width = qMax(width, mTypes[i].first.length());
|
||||
}
|
||||
addColumnAt(getCharWidth() * width + 8, "Type", true);
|
||||
addColumnAt(0, "Value", false);
|
||||
|
||||
setRowCount(mTypes.size());
|
||||
for(size_t i = 0; i < mTypes.size(); i++)
|
||||
{
|
||||
setCellContent(i, ColType, mTypes[i].first);
|
||||
}
|
||||
}
|
||||
|
||||
void DataTable::selectionChanged(duint start, duint end)
|
||||
{
|
||||
for(size_t i = 0; i < mTypes.size(); i++)
|
||||
{
|
||||
auto value = mTypes[i].second(start, end);
|
||||
setCellContent(i, ColValue, value);
|
||||
}
|
||||
reloadData();
|
||||
}
|
||||
|
||||
bool DataTable::read(void *destination, duint addr, duint size)
|
||||
{
|
||||
return DbgMemRead(addr, destination, size);
|
||||
}
|
|
@ -0,0 +1,38 @@
|
|||
#pragma once
|
||||
|
||||
#include <vector>
|
||||
#include <functional>
|
||||
|
||||
#include <BasicView/StdTable.h>
|
||||
|
||||
class DataTable : public StdTable
|
||||
{
|
||||
public:
|
||||
explicit DataTable(QWidget* parent = nullptr);
|
||||
|
||||
public slots:
|
||||
void selectionChanged(duint start, duint end);
|
||||
|
||||
private:
|
||||
bool read(void* destination, duint addr, duint size);
|
||||
|
||||
template<class T>
|
||||
QString primitive(duint addr)
|
||||
{
|
||||
T data = {};
|
||||
if(!read(&data, addr, sizeof(data)))
|
||||
{
|
||||
return "???";
|
||||
}
|
||||
return QString("%1").arg(data);
|
||||
}
|
||||
|
||||
enum Columns {
|
||||
ColType,
|
||||
ColValue,
|
||||
};
|
||||
|
||||
using DataFn = std::function<QString(duint, duint)>;
|
||||
|
||||
std::vector<std::pair<QString, DataFn>> mTypes;
|
||||
};
|
|
@ -3,7 +3,11 @@
|
|||
#include <QDebug>
|
||||
#include <QMessageBox>
|
||||
#include <QVBoxLayout>
|
||||
#include <QSplitter>
|
||||
#include <QHBoxLayout>
|
||||
#include <QFileDialog>
|
||||
#include <QCheckBox>
|
||||
#include <QSpacerItem>
|
||||
|
||||
MainWindow::MainWindow(QWidget* parent)
|
||||
: QMainWindow(parent)
|
||||
|
@ -101,7 +105,57 @@ Architecture* GlobalArchitecture()
|
|||
void MainWindow::setupWidgets()
|
||||
{
|
||||
mHexDump = new MiniHexDump(mNavigation, GlobalArchitecture(), this);
|
||||
ui->tabWidget->addTab(mHexDump, "Dump");
|
||||
mCodeEditor = new CodeEditor(this);
|
||||
mCodeEditor->setFont(Config()->monospaceFont());
|
||||
mHighlighter = new PatternHighlighter(mCodeEditor, mCodeEditor->document());
|
||||
mLogBrowser = new QTextBrowser(this);
|
||||
mLogBrowser->setFont(Config()->monospaceFont());
|
||||
mStructWidget = new StructWidget(this);
|
||||
|
||||
mDataTable = new DataTable(this);
|
||||
connect(mHexDump, &MiniHexDump::selectionUpdated, [this]() {
|
||||
mDataTable->selectionChanged(mHexDump->getSelectionStart(), mHexDump->getSelectionEnd());
|
||||
});
|
||||
|
||||
auto hl = new QHBoxLayout();
|
||||
//hl->addSpacing()
|
||||
hl->addStretch(1);
|
||||
hl->addWidget(new QCheckBox("Auto"));
|
||||
hl->addWidget(new QPushButton("Run"));
|
||||
hl->setContentsMargins(4, 4, 4, 0);
|
||||
|
||||
auto vl = new QVBoxLayout();
|
||||
vl->addWidget(mCodeEditor);
|
||||
vl->addLayout(hl);
|
||||
vl->setContentsMargins(0, 0, 0, 0);
|
||||
vl->setSpacing(0);
|
||||
|
||||
auto codeWidget = new QWidget();
|
||||
codeWidget->setLayout(vl);
|
||||
|
||||
auto codeSplitter = new QSplitter(Qt::Vertical, this);
|
||||
codeSplitter->addWidget(codeWidget);
|
||||
codeSplitter->addWidget(mLogBrowser);
|
||||
codeSplitter->setStretchFactor(0, 80);
|
||||
codeSplitter->setStretchFactor(0, 20);
|
||||
|
||||
auto structTabs = new QTabWidget(this);
|
||||
structTabs->addTab(mDataTable, "Data");
|
||||
structTabs->addTab(mStructWidget, "Struct");
|
||||
|
||||
auto hexSplitter = new QSplitter(Qt::Vertical, this);
|
||||
hexSplitter->addWidget(mHexDump);
|
||||
hexSplitter->addWidget(structTabs);
|
||||
hexSplitter->setStretchFactor(0, 65);
|
||||
hexSplitter->setStretchFactor(1, 35);
|
||||
|
||||
auto mainSplitter = new QSplitter(Qt::Horizontal, this);
|
||||
mainSplitter->addWidget(hexSplitter);
|
||||
mainSplitter->addWidget(codeSplitter);
|
||||
mainSplitter->setStretchFactor(0, 58);
|
||||
mainSplitter->setStretchFactor(1, 42);
|
||||
|
||||
ui->tabWidget->addTab(mainSplitter, "Hex");
|
||||
}
|
||||
|
||||
void MainWindow::on_action_Load_file_triggered()
|
||||
|
|
|
@ -8,6 +8,11 @@
|
|||
#include "MiniHexDump.h"
|
||||
#include "Navigation.h"
|
||||
#include "File.h"
|
||||
#include "CodeEditor.h"
|
||||
#include "PatternHighlighter.h"
|
||||
#include "StructWidget.h"
|
||||
#include <QTextBrowser>
|
||||
#include "DataTable.h"
|
||||
|
||||
QT_BEGIN_NAMESPACE
|
||||
namespace Ui { class MainWindow; }
|
||||
|
@ -34,5 +39,10 @@ private:
|
|||
Navigation* mNavigation = nullptr;
|
||||
MiniHexDump* mHexDump = nullptr;
|
||||
File* mFile = nullptr;
|
||||
CodeEditor* mCodeEditor = nullptr;
|
||||
PatternHighlighter* mHighlighter = nullptr;
|
||||
QTextBrowser* mLogBrowser = nullptr;
|
||||
StructWidget* mStructWidget = nullptr;
|
||||
DataTable* mDataTable = nullptr;
|
||||
};
|
||||
#endif // MAINWINDOW_H
|
||||
|
|
|
@ -22,7 +22,7 @@ StructWidget::StructWidget(QWidget* parent) :
|
|||
ui(new Ui::StructWidget)
|
||||
{
|
||||
ui->setupUi(this);
|
||||
ui->treeWidget->setStyleSheet("QTreeWidget { background-color: #FFF8F0; alternate-background-color: #DCD9CF; }");
|
||||
//ui->treeWidget->setStyleSheet("QTreeWidget { background-color: #FFF8F0; alternate-background-color: #DCD9CF; }");
|
||||
ui->treeWidget->setItemDelegate(new RichTextItemDelegate(&mTextColor, ui->treeWidget));
|
||||
connect(Bridge::getBridge(), SIGNAL(typeAddNode(void*, const TYPEDESCRIPTOR*)), this, SLOT(typeAddNode(void*, const TYPEDESCRIPTOR*)));
|
||||
connect(Bridge::getBridge(), SIGNAL(typeClear()), this, SLOT(typeClear()));
|
||||
|
@ -73,8 +73,8 @@ void StructWidget::colorsUpdatedSlot()
|
|||
mTextColor = ConfigColor("StructTextColor");
|
||||
auto background = ConfigColor("StructBackgroundColor");
|
||||
auto altBackground = ConfigColor("StructAlternateBackgroundColor");
|
||||
auto style = QString("QTreeWidget { background-color: %1; alternate-background-color: %2; }").arg(background.name(), altBackground.name());
|
||||
ui->treeWidget->setStyleSheet(style);
|
||||
//auto style = QString("QTreeWidget { background-color: %1; alternate-background-color: %2; }").arg(background.name(), altBackground.name());
|
||||
//ui->treeWidget->setStyleSheet(style);
|
||||
}
|
||||
|
||||
void StructWidget::fontsUpdatedSlot()
|
||||
|
@ -194,9 +194,9 @@ void StructWidget::dbgStateChangedSlot(DBGSTATE state)
|
|||
void StructWidget::setupColumns()
|
||||
{
|
||||
auto charWidth = ui->treeWidget->fontMetrics().horizontalAdvance(' ');
|
||||
ui->treeWidget->setColumnWidth(ColField, 4 + charWidth * 60);
|
||||
ui->treeWidget->setColumnWidth(ColField, 4 + charWidth * 35);
|
||||
ui->treeWidget->setColumnWidth(ColOffset, 6 + charWidth * 7);
|
||||
ui->treeWidget->setColumnWidth(ColAddress, 6 + charWidth * sizeof(duint) * 2);
|
||||
ui->treeWidget->setColumnWidth(ColAddress, 6 + charWidth * 8);
|
||||
ui->treeWidget->setColumnWidth(ColSize, 4 + charWidth * 6);
|
||||
|
||||
// NOTE: Trick to display the expander icons in the second column
|
||||
|
|
|
@ -1,4 +1,6 @@
|
|||
#include <QApplication>
|
||||
#include <QStyleFactory>
|
||||
#include <QPalette>
|
||||
|
||||
#include "MainWindow.h"
|
||||
#include "Configuration.h"
|
||||
|
@ -7,11 +9,148 @@
|
|||
#error Your Qt version is likely too old, upgrade to 5.12 or higher
|
||||
#endif // QT_VERSION
|
||||
|
||||
// https://www.qt.io/blog/dark-mode-on-windows-11-with-qt-6.5
|
||||
|
||||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
Configuration config;
|
||||
QApplication app(argc, argv);
|
||||
app.setStyle(QStyleFactory::create("Fusion"));
|
||||
|
||||
#if 0
|
||||
QColor lightGray(190, 190, 190);
|
||||
QColor gray(128, 128, 128);
|
||||
QColor midDarkGray(100, 100, 100);
|
||||
QColor darkGray(53, 53, 53);
|
||||
QColor black(25, 25, 25);
|
||||
QColor blue(42, 130, 218);
|
||||
QColor white(255, 255, 255);
|
||||
|
||||
QPalette darkPalette;
|
||||
darkPalette.setColor(QPalette::Window, darkGray);
|
||||
darkPalette.setColor(QPalette::WindowText, Qt::white);
|
||||
darkPalette.setColor(QPalette::Base, black);
|
||||
darkPalette.setColor(QPalette::AlternateBase, darkGray);
|
||||
darkPalette.setColor(QPalette::ToolTipBase, darkGray);
|
||||
darkPalette.setColor(QPalette::ToolTipText, Qt::white);
|
||||
darkPalette.setColor(QPalette::Text, lightGray);
|
||||
darkPalette.setColor(QPalette::Button, darkGray);
|
||||
darkPalette.setColor(QPalette::ButtonText, Qt::white);
|
||||
darkPalette.setColor(QPalette::Link, blue);
|
||||
darkPalette.setColor(QPalette::Highlight, blue);
|
||||
darkPalette.setColor(QPalette::HighlightedText, Qt::black);
|
||||
darkPalette.setColor(QPalette::Light, blue);
|
||||
darkPalette.setColor(QPalette::Dark, midDarkGray);
|
||||
|
||||
darkPalette.setColor(QPalette::Active, QPalette::Button, gray.darker());
|
||||
darkPalette.setColor(QPalette::Disabled, QPalette::ButtonText, gray);
|
||||
darkPalette.setColor(QPalette::Disabled, QPalette::WindowText, gray);
|
||||
darkPalette.setColor(QPalette::Disabled, QPalette::Text, gray);
|
||||
darkPalette.setColor(QPalette::Disabled, QPalette::Light, darkGray);
|
||||
|
||||
app.setPalette(darkPalette);
|
||||
#endif
|
||||
|
||||
#if 0
|
||||
QColor black(40, 42, 54);
|
||||
QColor white(248, 248, 242);
|
||||
QColor lightBlue(139, 233, 253);
|
||||
QColor green(80, 250, 123);
|
||||
QColor yellow(229, 238, 138);
|
||||
QColor red(255, 85, 85);
|
||||
QColor purple(189, 147, 249);
|
||||
QColor darkBlue(98, 114, 164);
|
||||
QColor grey(68, 71, 90);
|
||||
QColor orange(255, 184, 108);
|
||||
QColor pink(255, 121, 198);
|
||||
|
||||
QPalette dark;
|
||||
dark.setColor(QPalette::Window, black);
|
||||
dark.setColor(QPalette::WindowText, white);
|
||||
dark.setColor(QPalette::Base, black);
|
||||
dark.setColor(QPalette::AlternateBase, grey);
|
||||
dark.setColor(QPalette::ToolTipBase, black);
|
||||
dark.setColor(QPalette::ToolTipText, lightBlue);
|
||||
dark.setColor(QPalette::Text, white);
|
||||
dark.setColor(QPalette::Button, black);
|
||||
dark.setColor(QPalette::ButtonText, white);
|
||||
dark.setColor(QPalette::BrightText, grey);
|
||||
dark.setColor(QPalette::Link, green);
|
||||
dark.setColor(QPalette::LinkVisited, purple);
|
||||
dark.setColor(QPalette::Highlight, grey);
|
||||
dark.setColor(QPalette::HighlightedText, white);
|
||||
dark.setColor(QPalette::Light, grey);
|
||||
|
||||
dark.setColor(QPalette::Disabled, QPalette::Button, darkBlue);
|
||||
dark.setColor(QPalette::Disabled, QPalette::ButtonText, darkBlue);
|
||||
dark.setColor(QPalette::Disabled, QPalette::Text, darkBlue);
|
||||
dark.setColor(QPalette::Disabled, QPalette::WindowText, darkBlue);
|
||||
|
||||
app.setPalette(dark);
|
||||
#endif
|
||||
|
||||
QPalette palette;
|
||||
|
||||
QColor oneDarkBackground("#282c34");
|
||||
QColor oneDarkForeground("#abb2bf");
|
||||
QColor oneDarkComment("#5c6370");
|
||||
QColor oneDarkKeyword("#c678dd");
|
||||
QColor oneDarkFunction("#61afef");
|
||||
QColor oneDarkString("#98c379");
|
||||
QColor oneDarkNumber("#d19a66");
|
||||
QColor oneDarkVariable("#e06c75");
|
||||
QColor oneDarkConstant("#56b6c2");
|
||||
|
||||
palette.setColor(QPalette::Window, oneDarkBackground);
|
||||
palette.setColor(QPalette::WindowText, oneDarkForeground);
|
||||
palette.setColor(QPalette::Base, QColor("#21252b"));
|
||||
palette.setColor(QPalette::AlternateBase, QColor("#2c313c")); // used for alternate row color in tree
|
||||
palette.setColor(QPalette::ToolTipBase, QColor("#3a3f4b"));
|
||||
palette.setColor(QPalette::ToolTipText, oneDarkForeground);
|
||||
palette.setColor(QPalette::Text, oneDarkForeground);
|
||||
palette.setColor(QPalette::Button, QColor("#3a3f4b"));
|
||||
palette.setColor(QPalette::ButtonText, oneDarkForeground);
|
||||
palette.setColor(QPalette::BrightText, oneDarkVariable);
|
||||
palette.setColor(QPalette::Link, oneDarkFunction);
|
||||
palette.setColor(QPalette::LinkVisited, oneDarkFunction);
|
||||
palette.setColor(QPalette::Highlight, oneDarkFunction);
|
||||
palette.setColor(QPalette::HighlightedText, oneDarkBackground);
|
||||
|
||||
palette.setColor(QPalette::Light, oneDarkBackground.lighter(120));
|
||||
palette.setColor(QPalette::Midlight, oneDarkBackground.lighter(110));
|
||||
palette.setColor(QPalette::Mid, oneDarkBackground.darker(110));
|
||||
palette.setColor(QPalette::Dark, oneDarkBackground.darker(130));
|
||||
palette.setColor(QPalette::Shadow, oneDarkBackground.darker(160));
|
||||
|
||||
palette.setColor(QPalette::Disabled, QPalette::WindowText, oneDarkComment);
|
||||
palette.setColor(QPalette::Disabled, QPalette::Text, oneDarkComment);
|
||||
palette.setColor(QPalette::Disabled, QPalette::ButtonText, oneDarkComment);
|
||||
palette.setColor(QPalette::Disabled, QPalette::Highlight, oneDarkBackground.darker(150));
|
||||
palette.setColor(QPalette::Disabled, QPalette::HighlightedText, oneDarkComment);
|
||||
|
||||
app.setPalette(palette);
|
||||
|
||||
QColor separator(99, 99, 99);
|
||||
QColor header(75, 75, 75);
|
||||
|
||||
// TODO: how is this derived by qt?
|
||||
separator = QColor("#616671");
|
||||
header = QColor("#484d59");
|
||||
|
||||
ConfigurationPalette p;
|
||||
p.background = oneDarkBackground;
|
||||
p.darkGrey = separator;
|
||||
p.lightGrey = header;
|
||||
p.black = oneDarkForeground;
|
||||
|
||||
Configuration config(p);
|
||||
|
||||
auto hexText = config.Colors["HexDumpTextColor"];
|
||||
config.Colors["HexDumpByte00Color"] = oneDarkConstant;
|
||||
config.Colors["HexDumpByte7FColor"] = oneDarkVariable;
|
||||
config.Colors["HexDumpByteFFColor"] = oneDarkVariable;
|
||||
config.Colors["HexDumpByteIsPrintColor"] = oneDarkString;
|
||||
|
||||
MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
return app.exec();
|
||||
}
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
Configuration config;
|
||||
Configuration config(ConfigurationPalette());
|
||||
MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
|
|
|
@ -12,7 +12,7 @@
|
|||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
Configuration config;
|
||||
Configuration config(ConfigurationPalette());
|
||||
TableServer server;
|
||||
MainWindow w;
|
||||
w.show();
|
||||
|
|
|
@ -10,7 +10,7 @@
|
|||
int main(int argc, char* argv[])
|
||||
{
|
||||
QApplication a(argc, argv);
|
||||
Configuration config;
|
||||
Configuration config(ConfigurationPalette());
|
||||
MainWindow w;
|
||||
w.show();
|
||||
return a.exec();
|
||||
|
|
|
@ -26,7 +26,7 @@ inline static void addWindowPosConfig(QMap<QString, duint> & guiUint, const char
|
|||
guiUint.insert(n + "Y", 0);
|
||||
}
|
||||
|
||||
Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
||||
Configuration::Configuration(const ConfigurationPalette& p) : QObject(), noMoreMsgbox(false)
|
||||
{
|
||||
mPtr = this;
|
||||
|
||||
|
@ -58,119 +58,129 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
EmbeddedFonts.push_back(std::move(font));
|
||||
}
|
||||
|
||||
QColor darkGrey = p.darkGrey;
|
||||
QColor mediumGrey = p.mediumGrey;
|
||||
QColor lightGrey = p.lightGrey;
|
||||
QColor lighterGrey = p.lighterGrey;
|
||||
QColor background = p.background;
|
||||
QColor black = p.black;
|
||||
QColor white = p.white;
|
||||
QColor red = p.red;
|
||||
QColor bookmark = p.bookmark;
|
||||
|
||||
//setup default color map
|
||||
defaultColors.clear();
|
||||
defaultColors.insert("AbstractTableViewSeparatorColor", QColor("#808080"));
|
||||
defaultColors.insert("AbstractTableViewBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("AbstractTableViewTextColor", QColor("#000000"));
|
||||
defaultColors.insert("AbstractTableViewHeaderTextColor", QColor("#000000"));
|
||||
defaultColors.insert("AbstractTableViewHeaderBackgroundColor", QColor("#C0C0C0"));
|
||||
defaultColors.insert("AbstractTableViewSelectionColor", QColor("#C0C0C0"));
|
||||
defaultColors.insert("AbstractTableViewSeparatorColor", darkGrey);
|
||||
defaultColors.insert("AbstractTableViewBackgroundColor", background);
|
||||
defaultColors.insert("AbstractTableViewTextColor", black);
|
||||
defaultColors.insert("AbstractTableViewHeaderTextColor", black);
|
||||
defaultColors.insert("AbstractTableViewHeaderBackgroundColor", lightGrey);
|
||||
defaultColors.insert("AbstractTableViewSelectionColor", lightGrey);
|
||||
|
||||
defaultColors.insert("DisassemblyCipColor", QColor("#FFFFFF"));
|
||||
defaultColors.insert("DisassemblyCipBackgroundColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyBreakpointColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyBreakpointBackgroundColor", QColor("#FF0000"));
|
||||
defaultColors.insert("DisassemblyHardwareBreakpointColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyCipColor", white);
|
||||
defaultColors.insert("DisassemblyCipBackgroundColor", black);
|
||||
defaultColors.insert("DisassemblyBreakpointColor", black);
|
||||
defaultColors.insert("DisassemblyBreakpointBackgroundColor", red);
|
||||
defaultColors.insert("DisassemblyHardwareBreakpointColor", black);
|
||||
defaultColors.insert("DisassemblyHardwareBreakpointBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyBookmarkColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyBookmarkBackgroundColor", QColor("#FEE970"));
|
||||
defaultColors.insert("DisassemblyLabelColor", QColor("#FF0000"));
|
||||
defaultColors.insert("DisassemblyBookmarkColor", black);
|
||||
defaultColors.insert("DisassemblyBookmarkBackgroundColor", bookmark);
|
||||
defaultColors.insert("DisassemblyLabelColor", red);
|
||||
defaultColors.insert("DisassemblyLabelBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("DisassemblySelectionColor", QColor("#C0C0C0"));
|
||||
defaultColors.insert("DisassemblyBackgroundColor", background);
|
||||
defaultColors.insert("DisassemblySelectionColor", lightGrey);
|
||||
defaultColors.insert("DisassemblyTracedBackgroundColor", QColor("#C0FFC0"));
|
||||
defaultColors.insert("DisassemblyAddressColor", QColor("#808080"));
|
||||
defaultColors.insert("DisassemblyAddressColor", darkGrey);
|
||||
defaultColors.insert("DisassemblyAddressBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblySelectedAddressColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblySelectedAddressColor", black);
|
||||
defaultColors.insert("DisassemblySelectedAddressBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyConditionalJumpLineTrueColor", QColor("#FF0000"));
|
||||
defaultColors.insert("DisassemblyConditionalJumpLineFalseColor", QColor("#808080"));
|
||||
defaultColors.insert("DisassemblyUnconditionalJumpLineColor", QColor("#FF0000"));
|
||||
defaultColors.insert("DisassemblyBytesColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyConditionalJumpLineTrueColor", red);
|
||||
defaultColors.insert("DisassemblyConditionalJumpLineFalseColor", darkGrey);
|
||||
defaultColors.insert("DisassemblyUnconditionalJumpLineColor", red);
|
||||
defaultColors.insert("DisassemblyBytesColor", black);
|
||||
defaultColors.insert("DisassemblyBytesBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyModifiedBytesColor", QColor("#FF0000"));
|
||||
defaultColors.insert("DisassemblyModifiedBytesColor", red);
|
||||
defaultColors.insert("DisassemblyModifiedBytesBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyRestoredBytesColor", QColor("#808080"));
|
||||
defaultColors.insert("DisassemblyRestoredBytesColor", darkGrey);
|
||||
defaultColors.insert("DisassemblyRestoredBytesBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyRelocationUnderlineColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyCommentColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyRelocationUnderlineColor", black);
|
||||
defaultColors.insert("DisassemblyCommentColor", black);
|
||||
defaultColors.insert("DisassemblyCommentBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyAutoCommentColor", QColor("#AA5500"));
|
||||
defaultColors.insert("DisassemblyAutoCommentBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyMnemonicBriefColor", QColor("#717171"));
|
||||
defaultColors.insert("DisassemblyMnemonicBriefBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("DisassemblyFunctionColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyLoopColor", QColor("#000000"));
|
||||
defaultColors.insert("DisassemblyFunctionColor", black);
|
||||
defaultColors.insert("DisassemblyLoopColor", black);
|
||||
|
||||
defaultColors.insert("SideBarBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("SideBarCipLabelColor", QColor("#FFFFFF"));
|
||||
defaultColors.insert("SideBarBackgroundColor", background);
|
||||
defaultColors.insert("SideBarCipLabelColor", white);
|
||||
defaultColors.insert("SideBarCipLabelBackgroundColor", QColor("#4040FF"));
|
||||
defaultColors.insert("SideBarBulletColor", QColor("#808080"));
|
||||
defaultColors.insert("SideBarBulletBreakpointColor", QColor("#FF0000"));
|
||||
defaultColors.insert("SideBarBulletColor", darkGrey);
|
||||
defaultColors.insert("SideBarBulletBreakpointColor", red);
|
||||
defaultColors.insert("SideBarBulletDisabledBreakpointColor", QColor("#00AA00"));
|
||||
defaultColors.insert("SideBarBulletBookmarkColor", QColor("#FEE970"));
|
||||
defaultColors.insert("SideBarCheckBoxForeColor", QColor("#000000"));
|
||||
defaultColors.insert("SideBarCheckBoxBackColor", QColor("#FFFFFF"));
|
||||
defaultColors.insert("SideBarConditionalJumpLineTrueColor", QColor("#FF0000"));
|
||||
defaultColors.insert("SideBarConditionalJumpLineTrueBackwardsColor", QColor("#FF0000"));
|
||||
defaultColors.insert("SideBarBulletBookmarkColor", bookmark);
|
||||
defaultColors.insert("SideBarCheckBoxForeColor", black);
|
||||
defaultColors.insert("SideBarCheckBoxBackColor", white);
|
||||
defaultColors.insert("SideBarConditionalJumpLineTrueColor", red);
|
||||
defaultColors.insert("SideBarConditionalJumpLineTrueBackwardsColor", red);
|
||||
defaultColors.insert("SideBarConditionalJumpLineFalseColor", QColor("#00BBFF"));
|
||||
defaultColors.insert("SideBarConditionalJumpLineFalseBackwardsColor", QColor("#FFA500"));
|
||||
defaultColors.insert("SideBarUnconditionalJumpLineTrueColor", QColor("#FF0000"));
|
||||
defaultColors.insert("SideBarUnconditionalJumpLineTrueBackwardsColor", QColor("#FF0000"));
|
||||
defaultColors.insert("SideBarUnconditionalJumpLineTrueColor", red);
|
||||
defaultColors.insert("SideBarUnconditionalJumpLineTrueBackwardsColor", red);
|
||||
defaultColors.insert("SideBarUnconditionalJumpLineFalseColor", QColor("#00BBFF"));
|
||||
defaultColors.insert("SideBarUnconditionalJumpLineFalseBackwardsColor", QColor("#FFA500"));
|
||||
|
||||
defaultColors.insert("RegistersBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("RegistersColor", QColor("#000000"));
|
||||
defaultColors.insert("RegistersModifiedColor", QColor("#FF0000"));
|
||||
defaultColors.insert("RegistersBackgroundColor", background);
|
||||
defaultColors.insert("RegistersColor", black);
|
||||
defaultColors.insert("RegistersModifiedColor", red);
|
||||
defaultColors.insert("RegistersSelectionColor", QColor("#EEEEEE"));
|
||||
defaultColors.insert("RegistersLabelColor", QColor("#000000"));
|
||||
defaultColors.insert("RegistersLabelColor", black);
|
||||
defaultColors.insert("RegistersArgumentLabelColor", Qt::darkGreen);
|
||||
defaultColors.insert("RegistersExtraInfoColor", QColor("#000000"));
|
||||
defaultColors.insert("RegistersExtraInfoColor", black);
|
||||
defaultColors.insert("RegistersHighlightReadColor", QColor("#00A000"));
|
||||
defaultColors.insert("RegistersHighlightWriteColor", QColor("#B00000"));
|
||||
defaultColors.insert("RegistersHighlightReadWriteColor", QColor("#808000"));
|
||||
|
||||
defaultColors.insert("InstructionHighlightColor", QColor("#FFFFFF"));
|
||||
defaultColors.insert("InstructionHighlightColor", white);
|
||||
defaultColors.insert("InstructionHighlightBackgroundColor", QColor("#CC0000"));
|
||||
defaultColors.insert("InstructionCommaColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionCommaColor", black);
|
||||
defaultColors.insert("InstructionCommaBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionPrefixColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionPrefixColor", black);
|
||||
defaultColors.insert("InstructionPrefixBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionUncategorizedColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionUncategorizedColor", black);
|
||||
defaultColors.insert("InstructionUncategorizedBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionAddressColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionAddressColor", black);
|
||||
defaultColors.insert("InstructionAddressBackgroundColor", QColor("#FFFF00"));
|
||||
defaultColors.insert("InstructionValueColor", QColor("#828200"));
|
||||
defaultColors.insert("InstructionValueBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionMnemonicColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionMnemonicColor", black);
|
||||
defaultColors.insert("InstructionMnemonicBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionPushPopColor", QColor("#0000FF"));
|
||||
defaultColors.insert("InstructionPushPopBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionCallColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionCallColor", black);
|
||||
defaultColors.insert("InstructionCallBackgroundColor", QColor("#00FFFF"));
|
||||
defaultColors.insert("InstructionRetColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionRetColor", black);
|
||||
defaultColors.insert("InstructionRetBackgroundColor", QColor("#00FFFF"));
|
||||
defaultColors.insert("InstructionConditionalJumpColor", QColor("#FF0000"));
|
||||
defaultColors.insert("InstructionConditionalJumpColor", red);
|
||||
defaultColors.insert("InstructionConditionalJumpBackgroundColor", QColor("#FFFF00"));
|
||||
defaultColors.insert("InstructionUnconditionalJumpColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionUnconditionalJumpColor", black);
|
||||
defaultColors.insert("InstructionUnconditionalJumpBackgroundColor", QColor("#FFFF00"));
|
||||
defaultColors.insert("InstructionUnusualColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionUnusualColor", black);
|
||||
defaultColors.insert("InstructionUnusualBackgroundColor", QColor("#C00000"));
|
||||
defaultColors.insert("InstructionNopColor", QColor("#808080"));
|
||||
defaultColors.insert("InstructionNopColor", darkGrey);
|
||||
defaultColors.insert("InstructionNopBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionFarColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionFarColor", black);
|
||||
defaultColors.insert("InstructionFarBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionInt3Color", QColor("#000000"));
|
||||
defaultColors.insert("InstructionInt3Color", black);
|
||||
defaultColors.insert("InstructionInt3BackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionMemorySizeColor", QColor("#000080"));
|
||||
defaultColors.insert("InstructionMemorySizeBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionMemorySegmentColor", QColor("#FF00FF"));
|
||||
defaultColors.insert("InstructionMemorySegmentBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionMemoryBracketsColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionMemoryBracketsColor", black);
|
||||
defaultColors.insert("InstructionMemoryBracketsBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("InstructionMemoryStackBracketsColor", QColor("#000000"));
|
||||
defaultColors.insert("InstructionMemoryStackBracketsColor", black);
|
||||
defaultColors.insert("InstructionMemoryStackBracketsBackgroundColor", QColor("#00FFFF"));
|
||||
defaultColors.insert("InstructionMemoryBaseRegisterColor", QColor("#B03434"));
|
||||
defaultColors.insert("InstructionMemoryBaseRegisterBackgroundColor", Qt::transparent);
|
||||
|
@ -193,10 +203,10 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
defaultColors.insert("InstructionZmmRegisterColor", QColor("#000080"));
|
||||
defaultColors.insert("InstructionZmmRegisterBackgroundColor", Qt::transparent);
|
||||
|
||||
defaultColors.insert("HexDumpTextColor", QColor("#000000"));
|
||||
defaultColors.insert("HexDumpModifiedBytesColor", QColor("#FF0000"));
|
||||
defaultColors.insert("HexDumpTextColor", black);
|
||||
defaultColors.insert("HexDumpModifiedBytesColor", red);
|
||||
defaultColors.insert("HexDumpModifiedBytesBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("HexDumpRestoredBytesColor", QColor("#808080"));
|
||||
defaultColors.insert("HexDumpRestoredBytesColor", darkGrey);
|
||||
defaultColors.insert("HexDumpRestoredBytesBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("HexDumpByte00Color", QColor("#008000"));
|
||||
defaultColors.insert("HexDumpByte00BackgroundColor", Qt::transparent);
|
||||
|
@ -206,40 +216,40 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
defaultColors.insert("HexDumpByteFFBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("HexDumpByteIsPrintColor", QColor("#800080"));
|
||||
defaultColors.insert("HexDumpByteIsPrintBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("HexDumpBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("HexDumpSelectionColor", QColor("#C0C0C0"));
|
||||
defaultColors.insert("HexDumpAddressColor", QColor("#000000"));
|
||||
defaultColors.insert("HexDumpBackgroundColor", background);
|
||||
defaultColors.insert("HexDumpSelectionColor", lightGrey);
|
||||
defaultColors.insert("HexDumpAddressColor", black);
|
||||
defaultColors.insert("HexDumpAddressBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("HexDumpLabelColor", QColor("#FF0000"));
|
||||
defaultColors.insert("HexDumpLabelColor", red);
|
||||
defaultColors.insert("HexDumpLabelBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("HexDumpUserModuleCodePointerHighlightColor", QColor("#00FF00"));
|
||||
defaultColors.insert("HexDumpUserModuleDataPointerHighlightColor", QColor("#008000"));
|
||||
defaultColors.insert("HexDumpSystemModuleCodePointerHighlightColor", QColor("#FF0000"));
|
||||
defaultColors.insert("HexDumpSystemModuleCodePointerHighlightColor", red);
|
||||
defaultColors.insert("HexDumpSystemModuleDataPointerHighlightColor", QColor("#800000"));
|
||||
defaultColors.insert("HexDumpUnknownCodePointerHighlightColor", QColor("#0000FF"));
|
||||
defaultColors.insert("HexDumpUnknownDataPointerHighlightColor", QColor("#000080"));
|
||||
|
||||
defaultColors.insert("StackTextColor", QColor("#000000"));
|
||||
defaultColors.insert("StackInactiveTextColor", QColor("#808080"));
|
||||
defaultColors.insert("StackBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("StackSelectionColor", QColor("#C0C0C0"));
|
||||
defaultColors.insert("StackCspColor", QColor("#FFFFFF"));
|
||||
defaultColors.insert("StackCspBackgroundColor", QColor("#000000"));
|
||||
defaultColors.insert("StackAddressColor", QColor("#808080"));
|
||||
defaultColors.insert("StackTextColor", black);
|
||||
defaultColors.insert("StackInactiveTextColor", darkGrey);
|
||||
defaultColors.insert("StackBackgroundColor", background);
|
||||
defaultColors.insert("StackSelectionColor", lightGrey);
|
||||
defaultColors.insert("StackCspColor", white);
|
||||
defaultColors.insert("StackCspBackgroundColor", black);
|
||||
defaultColors.insert("StackAddressColor", darkGrey);
|
||||
defaultColors.insert("StackAddressBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("StackSelectedAddressColor", QColor("#000000"));
|
||||
defaultColors.insert("StackSelectedAddressColor", black);
|
||||
defaultColors.insert("StackSelectedAddressBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("StackLabelColor", QColor("#FF0000"));
|
||||
defaultColors.insert("StackLabelColor", red);
|
||||
defaultColors.insert("StackLabelBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("StackReturnToColor", QColor("#FF0000"));
|
||||
defaultColors.insert("StackReturnToColor", red);
|
||||
defaultColors.insert("StackSEHChainColor", QColor("#AE81FF"));
|
||||
defaultColors.insert("StackFrameColor", QColor("#000000"));
|
||||
defaultColors.insert("StackFrameColor", black);
|
||||
defaultColors.insert("StackFrameSystemColor", QColor("#0000FF"));
|
||||
|
||||
defaultColors.insert("HexEditTextColor", QColor("#000000"));
|
||||
defaultColors.insert("HexEditWildcardColor", QColor("#FF0000"));
|
||||
defaultColors.insert("HexEditBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("HexEditSelectionColor", QColor("#C0C0C0"));
|
||||
defaultColors.insert("HexEditTextColor", black);
|
||||
defaultColors.insert("HexEditWildcardColor", red);
|
||||
defaultColors.insert("HexEditBackgroundColor", background);
|
||||
defaultColors.insert("HexEditSelectionColor", lightGrey);
|
||||
|
||||
defaultColors.insert("GraphJmpColor", QColor("#0148FB"));
|
||||
defaultColors.insert("GraphBrtrueColor", QColor("#387804"));
|
||||
|
@ -248,25 +258,25 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
defaultColors.insert("GraphRetShadowColor", QColor("#900000"));
|
||||
defaultColors.insert("GraphIndirectcallShadowColor", QColor("#008080"));
|
||||
defaultColors.insert("GraphBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("GraphNodeColor", QColor("#000000"));
|
||||
defaultColors.insert("GraphNodeColor", black);
|
||||
defaultColors.insert("GraphNodeBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("GraphCipColor", QColor("#000000"));
|
||||
defaultColors.insert("GraphBreakpointColor", QColor("#FF0000"));
|
||||
defaultColors.insert("GraphCipColor", black);
|
||||
defaultColors.insert("GraphBreakpointColor", red);
|
||||
defaultColors.insert("GraphDisabledBreakpointColor", QColor("#00AA00"));
|
||||
|
||||
defaultColors.insert("ThreadCurrentColor", QColor("#FFFFFF"));
|
||||
defaultColors.insert("ThreadCurrentBackgroundColor", QColor("#000000"));
|
||||
defaultColors.insert("WatchTriggeredColor", QColor("#FF0000"));
|
||||
defaultColors.insert("WatchTriggeredBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("MemoryMapBreakpointColor", QColor("#000000"));
|
||||
defaultColors.insert("MemoryMapBreakpointBackgroundColor", QColor("#FF0000"));
|
||||
defaultColors.insert("MemoryMapCipColor", QColor("#FFFFFF"));
|
||||
defaultColors.insert("MemoryMapCipBackgroundColor", QColor("#000000"));
|
||||
defaultColors.insert("ThreadCurrentColor", white);
|
||||
defaultColors.insert("ThreadCurrentBackgroundColor", black);
|
||||
defaultColors.insert("WatchTriggeredColor", red);
|
||||
defaultColors.insert("WatchTriggeredBackgroundColor", background);
|
||||
defaultColors.insert("MemoryMapBreakpointColor", black);
|
||||
defaultColors.insert("MemoryMapBreakpointBackgroundColor", red);
|
||||
defaultColors.insert("MemoryMapCipColor", white);
|
||||
defaultColors.insert("MemoryMapCipBackgroundColor", black);
|
||||
defaultColors.insert("MemoryMapSectionTextColor", QColor("#8B671F"));
|
||||
defaultColors.insert("SearchListViewHighlightColor", QColor("#FF0000"));
|
||||
defaultColors.insert("SearchListViewHighlightColor", red);
|
||||
defaultColors.insert("SearchListViewHighlightBackgroundColor", Qt::transparent);
|
||||
defaultColors.insert("StructTextColor", QColor("#000000"));
|
||||
defaultColors.insert("StructBackgroundColor", QColor("#FFF8F0"));
|
||||
defaultColors.insert("StructTextColor", black);
|
||||
defaultColors.insert("StructBackgroundColor", background);
|
||||
defaultColors.insert("StructAlternateBackgroundColor", QColor("#DCD9CF"));
|
||||
defaultColors.insert("LogLinkColor", QColor("#00CC00"));
|
||||
defaultColors.insert("LogLinkBackgroundColor", Qt::transparent);
|
||||
|
@ -274,9 +284,9 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
|||
defaultColors.insert("BreakpointSummaryKeywordColor", QColor("#8B671F"));
|
||||
defaultColors.insert("BreakpointSummaryStringColor", QColor("#008000"));
|
||||
defaultColors.insert("PatchRelocatedByteHighlightColor", QColor("#0000DD"));
|
||||
defaultColors.insert("SymbolUserTextColor", QColor("#000000"));
|
||||
defaultColors.insert("SymbolSystemTextColor", QColor("#000000"));
|
||||
defaultColors.insert("SymbolUnloadedTextColor", QColor("#000000"));
|
||||
defaultColors.insert("SymbolUserTextColor", black);
|
||||
defaultColors.insert("SymbolSystemTextColor", black);
|
||||
defaultColors.insert("SymbolUnloadedTextColor", black);
|
||||
defaultColors.insert("SymbolLoadingTextColor", QColor("#8B671F"));
|
||||
defaultColors.insert("SymbolLoadedTextColor", QColor("#008000"));
|
||||
defaultColors.insert("BackgroundFlickerColor", QColor("#ff6961"));
|
||||
|
|
|
@ -22,6 +22,19 @@ class MenuBuilder;
|
|||
class QAction;
|
||||
class QWheelEvent;
|
||||
|
||||
struct ConfigurationPalette
|
||||
{
|
||||
QColor darkGrey = ("#808080"); // separator
|
||||
QColor mediumGrey = ("#717171");
|
||||
QColor lightGrey = ("#C0C0C0"); // header/selection
|
||||
QColor lighterGrey =("#EEEEEE");
|
||||
QColor background =("#FFF8F0");
|
||||
QColor black =("#000000"); // text
|
||||
QColor white =("#FFFFFF");
|
||||
QColor red =("#FF0000");
|
||||
QColor bookmark =("#FEE970");
|
||||
};
|
||||
|
||||
class Configuration : public QObject
|
||||
{
|
||||
Q_OBJECT
|
||||
|
@ -41,7 +54,7 @@ public:
|
|||
};
|
||||
|
||||
//Functions
|
||||
Configuration();
|
||||
explicit Configuration(const ConfigurationPalette& p);
|
||||
static Configuration* instance();
|
||||
void load();
|
||||
void save();
|
||||
|
|
|
@ -1040,7 +1040,7 @@ void HexDump::byteToString(duint rva, uint8_t byte, ByteViewMode mode, RichTextP
|
|||
richText.textBackground = mByteFFBackgroundColor;
|
||||
break;
|
||||
default:
|
||||
if(isprint(byte) || isspace(byte))
|
||||
if((byte >= 0x20 && byte <= 0x7E) || isspace(byte))
|
||||
{
|
||||
richText.textColor = mByteIsPrintColor;
|
||||
richText.textBackground = mByteIsPrintBackgroundColor;
|
||||
|
|
Loading…
Reference in New Issue