Utils: Fix missing DetailsWidget outline

On some systems, QPalette::Midlight can have the same color as the
background color. So instead of using QPalette::Midlight on non-macOS,
mix our own color with 15% text color intensity, to visually match what
Qt Creator < 9.0 did.

Change-Id: I40848b5e16344c07f42c20415194f893641d5f70
Reviewed-by: hjk <hjk@qt.io>
This commit is contained in:
Alessandro Portale
2022-10-13 13:03:01 +02:00
parent d47a72e26c
commit 54f7ebf001
3 changed files with 14 additions and 10 deletions

View File

@@ -227,11 +227,8 @@ void DetailsWidget::paintEvent(QPaintEvent *paintEvent)
: palette().color(QPalette::Window);
p.fillRect(rect(), bgColor);
}
if (!creatorTheme()->flag(Theme::FlatProjectsMode)) {
const QColor outlineColor = palette().color(HostOsInfo::isMacHost() ? QPalette::Mid
: QPalette::Midlight);
qDrawPlainRect(&p, rect(), outlineColor);
}
if (!creatorTheme()->flag(Theme::FlatProjectsMode))
qDrawPlainRect(&p, rect(), DetailsButton::outlineColor());
}
void DetailsWidget::enterEvent(QEnterEvent *event)