FancyLineEdit: Fix placeholder text color

Amends 3dcdbe9069

Using the theme's PalettePlaceholderText only works for themes that
explicitly set it. Grab it from the application palette instead, which
is correct for all themes.

Observable by typing something into Locator and removing the typed text
again.

Change-Id: Iee7f900275ab7bcb37d87a2f7acddfee55fe9f79
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Christian Stenger <christian.stenger@qt.io>
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
This commit is contained in:
Eike Ziller
2023-05-26 15:13:41 +02:00
parent 88fd4d7e7f
commit 361eb17fbf

View File

@@ -11,6 +11,7 @@
#include "utilsicons.h"
#include "utilstr.h"
#include <QApplication>
#include <QKeyEvent>
#include <QKeySequence>
#include <QMenu>
@@ -126,7 +127,7 @@ FancyLineEditPrivate::FancyLineEditPrivate(FancyLineEdit *parent) :
m_completionShortcut(completionShortcut()->key(), parent),
m_okTextColor(creatorTheme()->color(Theme::TextColorNormal)),
m_errorTextColor(creatorTheme()->color(Theme::TextColorError)),
m_placeholderTextColor(creatorTheme()->color(Theme::PalettePlaceholderText))
m_placeholderTextColor(QApplication::palette().color(QPalette::PlaceholderText))
{
m_completionShortcut.setContext(Qt::WidgetShortcut);