Use color theme in Hexdump

This commit is contained in:
Florian Märkl 2017-11-20 17:38:10 +01:00
parent 0195806cfe
commit ec4d11f9c0
2 changed files with 14 additions and 0 deletions

View File

@ -44,6 +44,7 @@ HexdumpWidget::HexdumpWidget(QWidget *parent, Qt::WindowFlags flags) :
ui->asciiHeaderLabel->setContentsMargins(margin, 0, margin, 0);
setupFonts();
colorsUpdatedSlot();
updateHeaders();
// Set hexdump context menu
@ -60,6 +61,7 @@ HexdumpWidget::HexdumpWidget(QWidget *parent, Qt::WindowFlags flags) :
connectScroll(false);
connect(Config(), SIGNAL(fontsUpdated()), this, SLOT(fontsUpdated()));
connect(Config(), SIGNAL(colorsUpdated()), this, SLOT(colorsUpdatedSlot()));
connect(Core(), SIGNAL(seekChanged(RVA)), this, SLOT(on_seekChanged(RVA)));
connect(Core(), SIGNAL(raisePrioritizedMemoryWidget(CutterCore::MemoryWidgetType)), this, SLOT(raisePrioritizedMemoryWidget(CutterCore::MemoryWidgetType)));
@ -716,6 +718,17 @@ void HexdumpWidget::fontsUpdated()
adjustHexdumpLines();
}
void HexdumpWidget::colorsUpdatedSlot()
{
QString styleSheet = QString("QPlainTextEdit { background-color: %1; color: %2; }")
.arg(ConfigColor("gui.background").name())
.arg(ConfigColor("btext").name());
ui->hexOffsetText->setStyleSheet(styleSheet);
ui->hexHexText->setStyleSheet(styleSheet);
ui->hexASCIIText->setStyleSheet(styleSheet);
}
/*
* Actions callback functions

View File

@ -106,6 +106,7 @@ private slots:
void adjustHexdumpLines();
void fontsUpdated();
void colorsUpdatedSlot();
void on_codeCombo_2_currentTextChanged(const QString &arg1);
void on_hexSideTab_2_currentChanged(int index);