Page MenuHome GnuPG

No OneTemporary

diff --git a/patches/kwidgetsaddons/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch b/patches/kwidgetsaddons/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch
index 089c7d02..2b0e8585 100644
--- a/patches/kwidgetsaddons/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch
+++ b/patches/kwidgetsaddons/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch
@@ -1,104 +1,106 @@
#! /bin/sh
patch -p1 -l -f $* < $0
exit $?
+https://invent.kde.org/frameworks/kwidgetsaddons/-/merge_requests/323/
+
From 49989e844d711ffcd59557ed2673c5dffd6c067c Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= <dev@ingo-kloecker.de>
Date: Tue, 17 Jun 2025 14:22:58 +0200
Subject: [PATCH 1/3] Add helper for checking if high-contrast color scheme is
in use
---
src/CMakeLists.txt | 2 ++
src/highcontrasthelper.cpp | 36 ++++++++++++++++++++++++++++++++++++
src/highcontrasthelper_p.h | 21 +++++++++++++++++++++
3 files changed, 59 insertions(+)
create mode 100644 src/highcontrasthelper.cpp
create mode 100644 src/highcontrasthelper_p.h
diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt
index 17872a82..f3950efd 100644
--- a/src/CMakeLists.txt
+++ b/src/CMakeLists.txt
@@ -15,6 +15,8 @@ target_sources(KF6WidgetsAddons PRIVATE
common_helpers.cpp
common_helpers_p.h
fonthelpers_p.h
+ highcontrasthelper.cpp
+ highcontrasthelper_p.h
kacceleratormanager.cpp
kacceleratormanager.h
kacceleratormanager_p.h
diff --git a/src/highcontrasthelper.cpp b/src/highcontrasthelper.cpp
new file mode 100644
index 00000000..7f488813
--- /dev/null
+++ b/src/highcontrasthelper.cpp
@@ -0,0 +1,38 @@
+/*
+ This file is part of the KDE libraries
+ SPDX-FileCopyrightText: 2025 g10 Code GmbH
+ SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
+
+ SPDX-License-Identifier: LGPL-2.0-or-later
+*/
+
+#include <QtCore/qsystemdetection.h>
+
+#ifdef Q_OS_WIN
+#include "highcontrasthelper_p.h"
+
+#include <QApplication>
+
+#include "windows.h"
+
+static bool isDefaultColorSchemeInUse()
+{
+ const QVariant colorSchemePathProperty = qApp->property("KDE_COLOR_SCHEME_PATH");
+ return !colorSchemePathProperty.isValid() || colorSchemePathProperty.toString().isEmpty();
+}
+
+static bool isHighContrastModeActive()
+{
+ HIGHCONTRAST result;
+ result.cbSize = sizeof(HIGHCONTRAST);
+ if (SystemParametersInfo(SPI_GETHIGHCONTRAST, result.cbSize, &result, 0)) {
+ return (result.dwFlags & HCF_HIGHCONTRASTON);
+ }
+ return false;
+}
+
+bool isHighContrastColorSchemeInUse()
+{
+ return isHighContrastModeActive() && isDefaultColorSchemeInUse();
+}
+#endif
diff --git a/src/highcontrasthelper_p.h b/src/highcontrasthelper_p.h
new file mode 100644
index 00000000..ee599911
--- /dev/null
+++ b/src/highcontrasthelper_p.h
@@ -0,0 +1,21 @@
+/*
+ This file is part of the KDE libraries
+ SPDX-FileCopyrightText: 2025 g10 Code GmbH
+ SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
+
+ SPDX-License-Identifier: LGPL-2.0-or-later
+*/
+
+#ifndef HIGHCONTRASTHELPER_P_H
+#define HIGHCONTRASTHELPER_P_H
+
+#ifdef Q_OS_WIN
+bool isHighContrastColorSchemeInUse();
+#else
+constexpr bool isHighContrastColorSchemeInUse()
+{
+ return false;
+}
+#endif
+
+#endif
--
2.49.0
diff --git a/patches/kwidgetsaddons/0003-KPageView-Use-correct-icon-mode-if-high-contrast-col.patch b/patches/kwidgetsaddons/0003-KPageView-Use-correct-icon-mode-if-high-contrast-col.patch
index 3b04d81f..1f61ba37 100644
--- a/patches/kwidgetsaddons/0003-KPageView-Use-correct-icon-mode-if-high-contrast-col.patch
+++ b/patches/kwidgetsaddons/0003-KPageView-Use-correct-icon-mode-if-high-contrast-col.patch
@@ -1,47 +1,49 @@
#! /bin/sh
patch -p1 -l -f $* < $0
exit $?
+https://invent.kde.org/frameworks/kwidgetsaddons/-/merge_requests/323/
+
From 85478fa5e29bdd143b0eba50ca00aa23ce4865fb Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= <dev@ingo-kloecker.de>
Date: Tue, 17 Jun 2025 14:40:49 +0200
Subject: [PATCH 3/3] KPageView: Use correct icon mode if high-contrast color
scheme is in use
If a high-contrast color scheme is in use then we need to use selected
icon mode for selected list view items even if the list view doesn't have
focus. This ensures that the correct color is used for icon recoloring
to avoid bad contrast to the background used for selected items.
This is only done for high-contrast color schemes because Breeze Light
uses a light text color for selected list view items that have focus
and a dark text color for selected list view items that don't have focus.
---
src/kpageview_p.cpp | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/src/kpageview_p.cpp b/src/kpageview_p.cpp
index a49b04ee..644e85b1 100644
--- a/src/kpageview_p.cpp
+++ b/src/kpageview_p.cpp
@@ -15,6 +15,7 @@
#include <QTextLayout>
#include <QVBoxLayout>
+#include "highcontrasthelper_p.h"
#include "kpagemodel.h"
#include "loggingcategory.h"
@@ -391,7 +392,9 @@ void KPageListViewDelegate::paint(QPainter *painter, const QStyleOptionViewItem
opt.showDecorationSelected = true;
QStyle *style = opt.widget ? opt.widget->style() : QApplication::style();
- const QIcon::Mode iconMode = (option.state & QStyle::State_Selected) && (option.state & QStyle::State_Active) ? QIcon::Selected : QIcon::Normal;
+ const QIcon::Mode iconMode = (option.state & QStyle::State_Selected) && ((option.state & QStyle::State_Active) || isHighContrastColorSchemeInUse())
+ ? QIcon::Selected
+ : QIcon::Normal;
int iconSize = style->pixelMetric(QStyle::PM_IconViewIconSize);
const QString text = index.model()->data(index, Qt::DisplayRole).toString();
const QIcon icon = index.model()->data(index, Qt::DecorationRole).value<QIcon>();
--
2.49.0
diff --git a/patches/kwidgetsaddons/0004-Don-t-draw-some-days-in-dark-red-if-high-contrast-co.patch b/patches/kwidgetsaddons/0004-Don-t-draw-some-days-in-dark-red-if-high-contrast-co.patch
index e6067459..80f086cb 100644
--- a/patches/kwidgetsaddons/0004-Don-t-draw-some-days-in-dark-red-if-high-contrast-co.patch
+++ b/patches/kwidgetsaddons/0004-Don-t-draw-some-days-in-dark-red-if-high-contrast-co.patch
@@ -1,54 +1,56 @@
#! /bin/sh
patch -p1 -l -f $* < $0
exit $?
+https://invent.kde.org/frameworks/kwidgetsaddons/-/merge_requests/323/
+
From 071d11cb7bfc1518d19bab8649dedc3a9b65a208 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= <dev@ingo-kloecker.de>
Date: Mon, 10 Nov 2025 16:56:29 +0100
Subject: [PATCH 4/4] Don't draw some days in dark red if high-contrast colors
are in use
Dark red has very bad contrast for many high-contrast color schemes on
Windows.
---
src/kdatetable.cpp | 10 ++++++----
1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/src/kdatetable.cpp b/src/kdatetable.cpp
index d7345cb9..3a90752e 100644
--- a/src/kdatetable.cpp
+++ b/src/kdatetable.cpp
@@ -9,6 +9,8 @@
#include "kdatetable_p.h"
+#include "highcontrasthelper_p.h"
+
#include <QAction>
#include <QActionEvent>
#include <QApplication>
@@ -276,10 +278,10 @@ void KDateTable::paintCell(QPainter *painter, int row, int col)
// We are drawing a header cell
// If not a normal working day, then use "do not work today" color
- if (workingDay) {
- cellTextColor = palette().color(QPalette::WindowText);
- } else {
+ if (!workingDay && !isHighContrastColorSchemeInUse()) {
cellTextColor = Qt::darkRed;
+ } else {
+ cellTextColor = palette().color(QPalette::WindowText);
}
cellBackgroundColor = palette().color(QPalette::Window);
@@ -364,7 +366,7 @@ void KDateTable::paintCell(QPainter *painter, int row, int col)
}
// If the cell day is the day of religious observance, then always color text red unless Custom overrides
- if (!customDay && dayOfPray) {
+ if (!customDay && dayOfPray && !isHighContrastColorSchemeInUse()) {
cellTextColor = Qt::darkRed;
}
}
--
2.51.1

File Metadata

Mime Type
text/x-diff
Expires
Tue, Dec 30, 5:44 PM (13 h, 50 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
ef/fa/36241b195b7bca15f9540eb2c3c6

Event Timeline