Skip to content

Commit c034cfd

Browse files
committed
Added background color customization
1 parent 81ca380 commit c034cfd

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/fhex.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -219,7 +219,13 @@ Fhex::Fhex(QWidget *parent, QApplication *app, QString filepath)
219219

220220
qhex = new QHexEdit(this);
221221
qhex->setMinimumWidth(600);
222-
qhex->setStyleSheet("QHexEdit { background-color: #17120f; color: #ebe5e1; }");
222+
this->bgcolor = "#17120f";
223+
if (this->jconfig.contains("Apparence")) {
224+
if (this->jconfig["Apparence"].contains("background-color")) {
225+
this->bgcolor = this->jconfig["Apparence"]["background-color"];
226+
}
227+
}
228+
qhex->setStyleSheet("QHexEdit { background-color: "+QString(bgcolor.c_str())+";}");
223229
qhex->setAddressAreaColor(color_dark_gray);
224230
qhex->setSelectionColor(color_dark_yellow);
225231
qhex->setHighlightingColor(color_dark_violet);
@@ -1207,6 +1213,7 @@ void Fhex::saveSettings(string filePath){
12071213
jsettings["FileSizeLimit"] = this->file_size_limit;
12081214
jsettings["Font"]["Size"] = this->fontSize;
12091215
jsettings["Font"]["Name"] = this->fontName.toStdString();
1216+
jsettings["Apparence"]["background-color"] = this->bgcolor;
12101217

12111218
// Merge changes
12121219
jconfig.merge_patch(jsettings);

0 commit comments

Comments
 (0)