diff options
| author | Conway <[email protected]> | 2026-05-13 10:48:08 -0400 |
|---|---|---|
| committer | Conway <[email protected]> | 2026-05-13 10:48:08 -0400 |
| commit | a3f3d19ad6b61e79be4e62a34af4d1912bc940d3 (patch) | |
| tree | 5dd891674e0be28b945c875ab44a54bb8f08f99c /src | |
| parent | 525fb075a42f8ee9e9b04cb82abd4fbbdcdf18bb (diff) | |
KItemListWidget: bump selection alpha and use Active palette grouppixelated-scaling-option
Selection background was 0.32 alpha of QPalette::Highlight resolved
against the widget's current palette group. On dark color schemes the
Inactive group sources Highlight from Colors:Window (per KColorScheme's
ChangeSelectionColor effect), so a near-black Window at 0.32 alpha
leaves the selection nearly invisible. Force the Active group so the
scheme's Selection color is used, and raise the alphas (selected
0.32 → 0.70, selected+hovered 0.40 → 0.85, hover-only 0.06 → 0.12) for
adequate contrast on all-dark themes.
Co-Authored-By: Claude Opus 4.7 <[email protected]>
Diffstat (limited to 'src')
| -rw-r--r-- | src/kitemviews/kitemlistwidget.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/src/kitemviews/kitemlistwidget.cpp b/src/kitemviews/kitemlistwidget.cpp index 32118c569..2d94c4303 100644 --- a/src/kitemviews/kitemlistwidget.cpp +++ b/src/kitemviews/kitemlistwidget.cpp @@ -634,18 +634,18 @@ void KItemListWidget::drawItemStyleOption(QPainter *painter, QWidget *widget, QS // TODO: Remove this check after Plasma 6.8 release // See: https://invent.kde.org/plasma/breeze/-/merge_requests/595 if (style()->name() == QStringLiteral("breeze")) { - QColor backgroundColor{widget->palette().color(QPalette::Highlight)}; + QColor backgroundColor{widget->palette().color(QPalette::Active, QPalette::Highlight)}; backgroundColor.setAlphaF(0.0); if (m_clickHighlighted) { backgroundColor.setAlphaF(1.0); } else { if (m_selected && m_hovered) { - backgroundColor.setAlphaF(0.40); + backgroundColor.setAlphaF(0.85); } else if (m_selected) { - backgroundColor.setAlphaF(0.32); + backgroundColor.setAlphaF(0.70); } else if (m_hovered) { backgroundColor = widget->palette().color(QPalette::Text); - backgroundColor.setAlphaF(0.06); + backgroundColor.setAlphaF(0.12); } } painter->setRenderHint(QPainter::Antialiasing); @@ -658,7 +658,7 @@ void KItemListWidget::drawItemStyleOption(QPainter *painter, QWidget *widget, QS // Focus decoration if (current) { - QColor focusColor{widget->palette().color(QPalette::Highlight)}; + QColor focusColor{widget->palette().color(QPalette::Active, QPalette::Highlight)}; // Set the pen color lighter or darker depending on background color focusColor = m_styleOption.palette.color(QPalette::Base).lightnessF() > 0.5 ? focusColor.darker(110) : focusColor.lighter(110); focusColor.setAlphaF(m_selected || m_hovered ? 1.0 : 0.8); |
