File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1010#include < QFontDialog>
1111#include < QDragEnterEvent>
1212#include < QDropEvent>
13+ #include < QStyleFactory>
1314
1415#include " mainwindow.h"
1516
@@ -206,6 +207,7 @@ void MainWindow::showSearchDialog()
206207/* ****************************************************************************/
207208void MainWindow::init ()
208209{
210+ QApplication::setStyle (QStyleFactory::create (" Fusion" ));
209211 hexEdit = new QHexEdit (this );
210212 setCentralWidget (hexEdit);
211213 readSettings ();
@@ -388,6 +390,8 @@ void MainWindow::readSettings()
388390 move (pos);
389391 resize (size);
390392
393+ // Note: theme settings is not stored in hexedit, Optionsdialog handles this directly
394+
391395 if (settings.contains (" AddressArea" ))
392396 hexEdit->setAddressArea (settings.value (" AddressArea" ).toBool ());
393397 if (settings.contains (" AsciiArea" ))
@@ -463,6 +467,8 @@ QString MainWindow::strippedName(const QString &fullFileName)
463467
464468void MainWindow::writeSettings ()
465469{
470+ // Note: theme settings is not stored in hexedit, Optionsdialog handles this directly
471+
466472 QSettings settings;
467473 settings.setValue (" pos" , pos ());
468474 settings.setValue (" size" , size ());
Original file line number Diff line number Diff line change @@ -41,6 +41,9 @@ OptionsDialog::OptionsDialog(QWidget *parent) :
4141 _darkMode = palette;
4242 _defaultMode = QApplication::palette ();
4343
44+ QSettings settings;
45+ if (settings.contains (" Theme" ))
46+ this ->ui ->cbPalette ->setCurrentIndex (settings.value (" Theme" ).toInt ());
4447}
4548
4649void OptionsDialog::accept ()
@@ -105,6 +108,9 @@ void OptionsDialog::on_pbWidgetFont_clicked()
105108
106109void OptionsDialog::on_cbPalette_currentIndexChanged (int index)
107110{
111+ QSettings settings;
112+ settings.setValue (" Theme" , index);
113+
108114 switch (index)
109115 {
110116 case 1 :
You can’t perform that action at this time.
0 commit comments