diff --git a/src/drivers/Qt/HexEditor.cpp b/src/drivers/Qt/HexEditor.cpp index 3cfab1dc..f822b40c 100644 --- a/src/drivers/Qt/HexEditor.cpp +++ b/src/drivers/Qt/HexEditor.cpp @@ -815,6 +815,10 @@ void HexEditorDialog_t::pickForeGroundColor(void) if ( ret == QDialog::Accepted ) { + QString colorText; + colorText = dialog.selectedColor().name(); + //printf("FG Color string '%s'\n", colorText.toStdString().c_str() ); + g_config->setOption("SDL.HexEditFgColor", colorText.toStdString().c_str() ); editor->setForeGroundColor( dialog.selectedColor() ); } } @@ -830,6 +834,10 @@ void HexEditorDialog_t::pickBackGroundColor(void) if ( ret == QDialog::Accepted ) { + QString colorText; + colorText = dialog.selectedColor().name(); + //printf("BG Color string '%s'\n", colorText.toStdString().c_str() ); + g_config->setOption("SDL.HexEditBgColor", colorText.toStdString().c_str() ); editor->setBackGroundColor( dialog.selectedColor() ); } } @@ -954,6 +962,8 @@ QHexEdit::QHexEdit(QWidget *parent) : QWidget( parent ) { QPalette pal; + QColor bg, fg; + std::string colorString; this->parent = (HexEditorDialog_t*)parent; this->setFocusPolicy(Qt::StrongFocus); @@ -962,10 +972,15 @@ QHexEdit::QHexEdit(QWidget *parent) font.setStyle( QFont::StyleNormal ); font.setStyleHint( QFont::Monospace ); + g_config->getOption("SDL.HexEditBgColor", &colorString); + bg.setNamedColor( colorString.c_str() ); + g_config->getOption("SDL.HexEditFgColor", &colorString); + fg.setNamedColor( colorString.c_str() ); + pal = this->palette(); - pal.setColor(QPalette::Base , Qt::black); - pal.setColor(QPalette::Background, Qt::black); - pal.setColor(QPalette::WindowText, Qt::white); + pal.setColor(QPalette::Base , bg ); + pal.setColor(QPalette::Background, bg ); + pal.setColor(QPalette::WindowText, fg ); //editor->setAutoFillBackground(true); this->setPalette(pal); diff --git a/src/drivers/Qt/config.cpp b/src/drivers/Qt/config.cpp index f0d54880..a161701c 100644 --- a/src/drivers/Qt/config.cpp +++ b/src/drivers/Qt/config.cpp @@ -254,6 +254,10 @@ InitConfig() config->addOption("pauseframe", "SDL.PauseFrame", 0); config->addOption("recordhud", "SDL.RecordHUD", 1); config->addOption("moviemsg", "SDL.MovieMsg", 1); + + // Hex Editor Options + config->addOption("hexEditBgColor", "SDL.HexEditBgColor", "#000000"); + config->addOption("hexEditFgColor", "SDL.HexEditFgColor", "#FFFFFF"); // overwrite the config file? config->addOption("no-config", "SDL.NoConfig", 0);