Skip to content

Commit 6e63ad0

Browse files
committedJun 1, 2015
Use palette colors instead of inventing new colors if possible
1 parent 44bd299 commit 6e63ad0

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
 

‎example/optionsdialog.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ void OptionsDialog::readSettings()
4343
ui->cbReadOnly->setChecked(settings.value("ReadOnly").toBool());
4444

4545
setColor(ui->lbHighlightingColor, settings.value("HighlightingColor", QColor(0xff, 0xff, 0x99, 0xff)).value<QColor>());
46-
setColor(ui->lbAddressAreaColor, settings.value("AddressAreaColor", QColor(0xd4, 0xd4, 0xd4, 0xff)).value<QColor>());
47-
setColor(ui->lbSelectionColor, settings.value("SelectionColor", QColor(0x6d, 0x9e, 0xff, 0xff)).value<QColor>());
46+
setColor(ui->lbAddressAreaColor, settings.value("AddressAreaColor", this->palette().alternateBase().color()).value<QColor>());
47+
setColor(ui->lbSelectionColor, settings.value("SelectionColor", this->palette().highlight().color()).value<QColor>());
4848
#ifdef Q_OS_WIN32
4949
ui->leWidgetFont->setFont(settings.value("WidgetFont", QFont("Courier", 10)).value<QFont>());
5050
#else

‎src/qhexedit.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -21,9 +21,9 @@ QHexEdit::QHexEdit(QWidget *parent) : QAbstractScrollArea(parent)
2121
#else
2222
setFont(QFont("Monospace", 10));
2323
#endif
24-
setAddressAreaColor(QColor(0xd4, 0xd4, 0xd4, 0xff));
24+
setAddressAreaColor(this->palette().alternateBase().color());
2525
setHighlightingColor(QColor(0xff, 0xff, 0x99, 0xff));
26-
setSelectionColor(QColor(0x6d, 0x9e, 0xff, 0xff));
26+
setSelectionColor(this->palette().highlight().color());
2727

2828
connect(&_cursorTimer, SIGNAL(timeout()), this, SLOT(updateCursor()));
2929
connect(verticalScrollBar(), SIGNAL(valueChanged(int)), this, SLOT(adjust()));

0 commit comments

Comments
 (0)
Please sign in to comment.