Added hex editor fore and back ground color options to config file. Options are now also saved when using the editor color picker.
This commit is contained in:
parent
e6369e142e
commit
0349bb3a86
|
@ -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);
|
||||
|
|
|
@ -255,6 +255,10 @@ InitConfig()
|
|||
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);
|
||||
|
||||
|
|
Loading…
Reference in New Issue