summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorUwe Klotz <uklotz@mixxx.org>2020-05-05 07:56:21 +0200
committerUwe Klotz <uklotz@mixxx.org>2020-05-05 07:58:46 +0200
commitee57f018c212f936af357f6e7d7f972177cdc2bb (patch)
tree04938be184f6ba225f5d6ba64a6f83fcd478059e /src
parentda2affdd4d67bfc1bf3f4aeb79476b4ecc05e04e (diff)
Use a custom color for the placeholder text (Qt >= 5.12)
Diffstat (limited to 'src')
-rw-r--r--src/widget/wsearchlineedit.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/widget/wsearchlineedit.cpp b/src/widget/wsearchlineedit.cpp
index f0bca8433f..a57396d6de 100644
--- a/src/widget/wsearchlineedit.cpp
+++ b/src/widget/wsearchlineedit.cpp
@@ -186,6 +186,13 @@ void WSearchLineEdit::setup(const QDomNode& node, const SkinContext& context) {
DEBUG_ASSERT(backgroundColor != foregroundColor);
pal.setBrush(backgroundRole(), backgroundColor);
pal.setBrush(foregroundRole(), foregroundColor);
+#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0)
+ // Use only 25% instead of 50% transparency for the placeholder text color
+ auto placeholderColor = foregroundColor;
+ placeholderColor.setAlpha(
+ placeholderColor.alpha() - placeholderColor.alpha() / 4);
+ pal.setBrush(QPalette::PlaceholderText, placeholderColor);
+#endif
setPalette(pal);
m_clearButton->setToolTip(tr("Clear input") + "\n" +