From c0f2e1ee54b6bbd0a4ce927629282476cc2bf37c Mon Sep 17 00:00:00 2001 From: Chen Bin Date: Fri, 19 Mar 2021 17:47:45 +0800 Subject: [PATCH] =?UTF-8?q?feat:=20=E9=80=82=E9=85=8D=E7=A4=BE=E5=8C=BA?= =?UTF-8?q?=E7=89=885.15=E7=8E=AF=E5=A2=83=E4=B8=8B=E8=B0=83=E8=89=B2?= =?UTF-8?q?=E6=9D=BF=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit qt5.12中新增了PlaceholderText颜色,添加与5.11 颜色一致的对应颜色到此调色板中。使风格保持一致 Log: Bug: https://pms.uniontech.com/zentao/bug-view-66654.html Change-Id: I247d1619b9ec24582c09945bb2b3f4cd913fd4f5 (cherry picked from commit b27f4898127133017c14b793c27f452958c7eff2) --- src/kernel/dguiapplicationhelper.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/kernel/dguiapplicationhelper.cpp b/src/kernel/dguiapplicationhelper.cpp index b727b789..a7a4224b 100644 --- a/src/kernel/dguiapplicationhelper.cpp +++ b/src/kernel/dguiapplicationhelper.cpp @@ -491,6 +491,13 @@ DPalette DGuiApplicationHelper::standardPalette(DGuiApplicationHelper::ColorType QPalette::ColorRole role = static_cast(i); QColor color = qcolor_list[i]; +#if QT_VERSION >= QT_VERSION_CHECK(5, 12, 0) + if (role == QPalette::PlaceholderText) { + // 5.15新添加此颜色 这里使用5.11的颜色保证效果与5.11对齐 + color = dcolor_list[DPalette::PlaceholderText]; + continue; + } +#endif // 处理半透明色 if (DGuiApplicationHelperPrivate::compositingColor) { switch (role) {