Skip to content

Commit

Permalink
fix: disable text color hard to read
Browse files Browse the repository at this point in the history
针对QPalette::Text的disable状态在暗色主题下在dialog透明模糊时,如果后面有白色背景的应用几乎看不清文字的修复。修改方法是将原来混合颜色改成降低透明度,disable时透明度未原来的40%(来自设计的建议)

Log: 修复控制中心在白色背景下,开启屏幕的第一个屏幕名称看不清的问题
Bug: https://pms.uniontech.com/zentao/bug-view-53017.html
Change-Id: Id6ce0d4bacaa7755b5d108c484d7707760bd4a72
  • Loading branch information
kegechen committed Nov 10, 2020
1 parent 0e9633f commit 5f6ab73
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/dguiapplicationhelper.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -565,6 +565,12 @@ static void generatePaletteColor_helper(DPalette &base, M role, DGuiApplicationH
const QColor &color = base.color(QPalette::Normal, role);
base.setColor(QPalette::Disabled, role, DGuiApplicationHelper::blendColor(color, disable_mask_color));

QPalette::ColorRole qr = static_cast<QPalette::ColorRole>(role);
if (qr == QPalette::Text) {
// disable text color olny -60% alpha
base.setColor(QPalette::Disabled, role, DGuiApplicationHelper::adjustColor(color, 0, 0, 0, 0, 0, 0, -60));
}

if (DGuiApplicationHelperPrivate::useInactiveColor)
base.setColor(QPalette::Inactive, role, DGuiApplicationHelper::blendColor(color, inactive_mask_color));
else
Expand Down

0 comments on commit 5f6ab73

Please sign in to comment.