summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2020-05-05 07:45:24 +0200
committerUwe Klotz <uklotz@mixxx.org>2020-05-05 07:58:46 +0200
commit8f625158a411255517cc2cf5a070ba4a279b00cb (patch)
tree9ac166da3970f71aff473c1fd9b3b6d2ca916951 /src
parent986bcb394778819ed6797ebe9a2ac49f8e5029ce (diff)
Delete obsolete member variable
Diffstat (limited to 'src')
-rw-r--r--src/widget/wsearchlineedit.cpp20
-rw-r--r--src/widget/wsearchlineedit.h3
2 files changed, 9 insertions, 14 deletions
diff --git a/src/widget/wsearchlineedit.cpp b/src/widget/wsearchlineedit.cpp
index 88a02688a9..ca84547123 100644
--- a/src/widget/wsearchlineedit.cpp
+++ b/src/widget/wsearchlineedit.cpp
@@ -17,7 +17,6 @@ namespace {
const mixxx::Logger kLogger("WSearchLineEdit");
-const QColor kDefaultForegroundColor = QColor(0, 0, 0);
const QColor kDefaultBackgroundColor = QColor(255, 255, 255);
const QString kEmptySearch = QStringLiteral("");
@@ -78,7 +77,6 @@ WSearchLineEdit::WSearchLineEdit(QWidget* pParent)
: QLineEdit(pParent),
WBaseWidget(this),
m_clearButton(new QToolButton(this)),
- m_foregroundColor(kDefaultForegroundColor),
m_state(State::Inactive) {
DEBUG_ASSERT(kEmptySearch.isEmpty());
DEBUG_ASSERT(!kEmptySearch.isNull());
@@ -158,36 +156,36 @@ void WSearchLineEdit::setup(const QDomNode& node, const SkinContext& context) {
<< backgroundColor;
const auto defaultForegroundColor =
- QColor(
+ QColor::fromRgb(
255 - backgroundColor.red(),
255 - backgroundColor.green(),
255 - backgroundColor.blue());
- m_foregroundColor = defaultForegroundColor;
+ auto foregroundColor = defaultForegroundColor;
QString fgColorName;
if (context.hasNodeSelectString(node, "FgColor", &fgColorName)) {
auto namedColor = QColor(fgColorName);
if (namedColor.isValid()) {
- m_foregroundColor = namedColor;
+ foregroundColor = namedColor;
} else {
kLogger.warning()
<< "Failed to parse foreground color"
<< fgColorName;
}
}
- m_foregroundColor = WSkinColor::getCorrectColor(m_foregroundColor);
- VERIFY_OR_DEBUG_ASSERT(m_foregroundColor != backgroundColor) {
+ foregroundColor = WSkinColor::getCorrectColor(foregroundColor);
+ VERIFY_OR_DEBUG_ASSERT(foregroundColor != backgroundColor) {
kLogger.warning()
<< "Invisible foreground color - using default color as fallback";
- m_foregroundColor = defaultForegroundColor;
+ foregroundColor = defaultForegroundColor;
}
kLogger.debug()
<< "Foreground color:"
- << m_foregroundColor;
+ << foregroundColor;
QPalette pal = palette();
- DEBUG_ASSERT(backgroundColor != m_foregroundColor);
+ DEBUG_ASSERT(backgroundColor != foregroundColor);
pal.setBrush(backgroundRole(), backgroundColor);
- pal.setBrush(foregroundRole(), m_foregroundColor);
+ pal.setBrush(foregroundRole(), foregroundColor);
setPalette(pal);
m_clearButton->setToolTip(tr("Clear input") + "\n" +
diff --git a/src/widget/wsearchlineedit.h b/src/widget/wsearchlineedit.h
index b8fd5a820b..b809d9baad 100644
--- a/src/widget/wsearchlineedit.h
+++ b/src/widget/wsearchlineedit.h
@@ -1,6 +1,5 @@
#pragma once
-#include <QColor>
#include <QDomNode>
#include <QEvent>
#include <QLineEdit>
@@ -91,8 +90,6 @@ class WSearchLineEdit : public QLineEdit, public WBaseWidget {
int m_frameWidth;
int m_innerHeight;
- QColor m_foregroundColor;
-
QTimer m_debouncingTimer;
State m_state;