Fix the struct view text color in dark mode
This commit is contained in:
parent
bc88c85377
commit
63b784f97e
|
@ -226,6 +226,7 @@ StackSelectionColor=#414141
|
||||||
StackTextColor=#E0E0E0
|
StackTextColor=#E0E0E0
|
||||||
StructAlternateBackgroundColor=#313131
|
StructAlternateBackgroundColor=#313131
|
||||||
StructBackgroundColor=#212121
|
StructBackgroundColor=#212121
|
||||||
|
StructTextColor=#E0E0E0
|
||||||
SymbolUserTextColor=#E0E0E0
|
SymbolUserTextColor=#E0E0E0
|
||||||
SymbolSystemTextColor=#E0E0E0
|
SymbolSystemTextColor=#E0E0E0
|
||||||
SymbolLoadedTextColor=#E0E0E0
|
SymbolLoadedTextColor=#E0E0E0
|
||||||
|
|
|
@ -592,6 +592,7 @@ void AppearanceDialog::colorInfoListInit()
|
||||||
colorInfoListAppend(tr("Memory Map Breakpoint"), "MemoryMapBreakpointColor", "MemoryMapBreakpointBackgroundColor");
|
colorInfoListAppend(tr("Memory Map Breakpoint"), "MemoryMapBreakpointColor", "MemoryMapBreakpointBackgroundColor");
|
||||||
colorInfoListAppend(tr("Memory Map %1").arg(ArchValue(tr("EIP"), tr("RIP"))), "MemoryMapCipColor", "MemoryMapCipBackgroundColor");
|
colorInfoListAppend(tr("Memory Map %1").arg(ArchValue(tr("EIP"), tr("RIP"))), "MemoryMapCipColor", "MemoryMapCipBackgroundColor");
|
||||||
colorInfoListAppend(tr("Memory Map Section Text"), "MemoryMapSectionTextColor", "");
|
colorInfoListAppend(tr("Memory Map Section Text"), "MemoryMapSectionTextColor", "");
|
||||||
|
colorInfoListAppend(tr("Struct text"), "StructTextColor", "");
|
||||||
colorInfoListAppend(tr("Struct primary background"), "StructBackgroundColor", "");
|
colorInfoListAppend(tr("Struct primary background"), "StructBackgroundColor", "");
|
||||||
colorInfoListAppend(tr("Struct secondary background"), "StructAlternateBackgroundColor", "");
|
colorInfoListAppend(tr("Struct secondary background"), "StructAlternateBackgroundColor", "");
|
||||||
colorInfoListAppend(tr("Breakpoint Summary Parentheses"), "BreakpointSummaryParenColor", "");
|
colorInfoListAppend(tr("Breakpoint Summary Parentheses"), "BreakpointSummaryParenColor", "");
|
||||||
|
|
|
@ -5,8 +5,9 @@
|
||||||
#include <QAbstractTextDocumentLayout>
|
#include <QAbstractTextDocumentLayout>
|
||||||
#include <QApplication>
|
#include <QApplication>
|
||||||
|
|
||||||
RichTextItemDelegate::RichTextItemDelegate(QObject* parent)
|
RichTextItemDelegate::RichTextItemDelegate(QColor* textColor, QObject* parent)
|
||||||
: QStyledItemDelegate(parent)
|
: QStyledItemDelegate(parent),
|
||||||
|
mTextColor(textColor)
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -32,7 +33,7 @@ void RichTextItemDelegate::paint(QPainter* painter, const QStyleOptionViewItem &
|
||||||
|
|
||||||
QTextDocument doc;
|
QTextDocument doc;
|
||||||
doc.setDefaultTextOption(textOption);
|
doc.setDefaultTextOption(textOption);
|
||||||
doc.setHtml(option.text);
|
doc.setHtml(QString("<font color=\"%1\">%2</font>").arg(mTextColor->name(), option.text));
|
||||||
doc.setDefaultFont(option.font);
|
doc.setDefaultFont(option.font);
|
||||||
doc.setDocumentMargin(0);
|
doc.setDocumentMargin(0);
|
||||||
doc.setTextWidth(option.rect.width());
|
doc.setTextWidth(option.rect.width());
|
||||||
|
|
|
@ -8,10 +8,13 @@ class RichTextItemDelegate : public QStyledItemDelegate
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
public:
|
public:
|
||||||
explicit RichTextItemDelegate(QObject* parent = nullptr);
|
explicit RichTextItemDelegate(QColor* textColor, QObject* parent = nullptr);
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void paint(QPainter* painter, const QStyleOptionViewItem & option, const QModelIndex & index) const override;
|
void paint(QPainter* painter, const QStyleOptionViewItem & option, const QModelIndex & index) const override;
|
||||||
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const override;
|
QSize sizeHint(const QStyleOptionViewItem & option, const QModelIndex & index) const override;
|
||||||
|
|
||||||
|
private:
|
||||||
|
QColor* mTextColor = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -21,8 +21,8 @@ StructWidget::StructWidget(QWidget* parent) :
|
||||||
ui(new Ui::StructWidget)
|
ui(new Ui::StructWidget)
|
||||||
{
|
{
|
||||||
ui->setupUi(this);
|
ui->setupUi(this);
|
||||||
ui->treeWidget->setStyleSheet("QTreeWidget { color: #000000; background-color: #FFF8F0; alternate-background-color: #DCD9CF; }");
|
ui->treeWidget->setStyleSheet("QTreeWidget { background-color: #FFF8F0; alternate-background-color: #DCD9CF; }");
|
||||||
ui->treeWidget->setItemDelegate(new RichTextItemDelegate(ui->treeWidget));
|
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(typeAddNode(void*, const TYPEDESCRIPTOR*)), this, SLOT(typeAddNode(void*, const TYPEDESCRIPTOR*)));
|
||||||
connect(Bridge::getBridge(), SIGNAL(typeClear()), this, SLOT(typeClear()));
|
connect(Bridge::getBridge(), SIGNAL(typeClear()), this, SLOT(typeClear()));
|
||||||
connect(Bridge::getBridge(), SIGNAL(typeUpdateWidget()), this, SLOT(typeUpdateWidget()));
|
connect(Bridge::getBridge(), SIGNAL(typeUpdateWidget()), this, SLOT(typeUpdateWidget()));
|
||||||
|
@ -71,10 +71,10 @@ void StructWidget::loadWindowSettings()
|
||||||
|
|
||||||
void StructWidget::colorsUpdatedSlot()
|
void StructWidget::colorsUpdatedSlot()
|
||||||
{
|
{
|
||||||
auto color = ConfigColor("AbstractTableViewTextColor");
|
mTextColor = ConfigColor("StructTextColor");
|
||||||
auto background = ConfigColor("StructBackgroundColor");
|
auto background = ConfigColor("StructBackgroundColor");
|
||||||
auto altBackground = ConfigColor("StructAlternateBackgroundColor");
|
auto altBackground = ConfigColor("StructAlternateBackgroundColor");
|
||||||
auto style = QString("QTreeWidget { color: %1; background-color: %2; alternate-background-color: %3; }").arg(color.name(), background.name(), altBackground.name());
|
auto style = QString("QTreeWidget { background-color: %1; alternate-background-color: %2; }").arg(background.name(), altBackground.name());
|
||||||
ui->treeWidget->setStyleSheet(style);
|
ui->treeWidget->setStyleSheet(style);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -36,6 +36,7 @@ private:
|
||||||
Ui::StructWidget* ui;
|
Ui::StructWidget* ui;
|
||||||
MenuBuilder* mMenuBuilder;
|
MenuBuilder* mMenuBuilder;
|
||||||
GotoDialog* mGotoDialog = nullptr;
|
GotoDialog* mGotoDialog = nullptr;
|
||||||
|
QColor mTextColor;
|
||||||
|
|
||||||
void setupColumns();
|
void setupColumns();
|
||||||
void setupContextMenu();
|
void setupContextMenu();
|
||||||
|
|
|
@ -232,6 +232,7 @@ Configuration::Configuration() : QObject(), noMoreMsgbox(false)
|
||||||
defaultColors.insert("MemoryMapSectionTextColor", QColor("#8B671F"));
|
defaultColors.insert("MemoryMapSectionTextColor", QColor("#8B671F"));
|
||||||
defaultColors.insert("SearchListViewHighlightColor", QColor("#FF0000"));
|
defaultColors.insert("SearchListViewHighlightColor", QColor("#FF0000"));
|
||||||
defaultColors.insert("SearchListViewHighlightBackgroundColor", Qt::transparent);
|
defaultColors.insert("SearchListViewHighlightBackgroundColor", Qt::transparent);
|
||||||
|
defaultColors.insert("StructTextColor", QColor("#000000"));
|
||||||
defaultColors.insert("StructBackgroundColor", QColor("#FFF8F0"));
|
defaultColors.insert("StructBackgroundColor", QColor("#FFF8F0"));
|
||||||
defaultColors.insert("StructAlternateBackgroundColor", QColor("#DCD9CF"));
|
defaultColors.insert("StructAlternateBackgroundColor", QColor("#DCD9CF"));
|
||||||
defaultColors.insert("LogLinkColor", QColor("#00CC00"));
|
defaultColors.insert("LogLinkColor", QColor("#00CC00"));
|
||||||
|
|
Loading…
Reference in New Issue