Skip to content

Commit

Permalink
fix: Button background lightness display error
Browse files Browse the repository at this point in the history
  Adjust color's lightness by ColorType.

Issue: linuxdeepin/dtk#82
  • Loading branch information
18202781743 committed Jun 26, 2023
1 parent 53ee4fb commit 05b122c
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/widgets/dstyle.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2334,9 +2334,11 @@ QBrush DStyle::generatedBrush(StateFlags flags, const QBrush &base, QPalette::Co
switch (role) {
case QPalette::Button:
case QPalette::Light:
case QPalette::Dark:
colorNew = adjustColor(colorNew, 0, 0, -10, 0, 0, 0, 0);
case QPalette::Dark: {
DGuiApplicationHelper::ColorType type = DGuiApplicationHelper::toColorType(option->palette);
colorNew = adjustColor(colorNew, 0, 0, type == DGuiApplicationHelper::DarkType ? 10 : -10, 0, 0, 0, 0);
break;
}
case QPalette::Highlight:
colorNew = adjustColor(colorNew, 0, 0, +20);
break;
Expand Down

0 comments on commit 05b122c

Please sign in to comment.