Page Menu
Home
GnuPG
Search
Configure Global Search
Log In
Files
F34123472
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Size
28 KB
Subscribers
None
View Options
diff --git a/Makefile.am b/Makefile.am
index d82a0c29..7c5c9ce8 100644
--- a/Makefile.am
+++ b/Makefile.am
@@ -1,210 +1,211 @@
# Makefile.am - Installer for GnuPG 4 Windows Makefile.
# Copyright (C) 2005, 2008, 2012 g10 Code GmbH
#
# This file is part of GPG4Win.
#
# GPG4Win is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
# the Free Software Foundation; either version 2 of the License, or
# (at your option) any later version.
#
# GPG4Win is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, see <http://www.gnu.org/licenses/>.
ACLOCAL_AMFLAGS = -I m4
AUTOMAKE_OPTIONS = dist-xz no-dist-gzip
DISTCHECK_CONFIGURE_FLAGS = --host=i686-w64-mingw32
if BUILD_GPG4WIN
po = po
else
po =
endif
if BUILD_GPG4WIN
doc = doc
else
doc =
endif
SUBDIRS = ${po} packages ${doc} src
# git ls-files patches | sed 's/$/ \\/' | sed 's/^/ /'
# git ls-files patches-appimage | sed 's/$/ \\/' | sed 's/^/ /'
EXTRA_DIST = build.sh autogen.rc autogen.sh VERSION README.GIT ONEWS \
doc/license-page doc/GPLv3 build.sh \
build-aux/git-log-footer build-aux/git-log-fix \
build-aux/gpg-authcode-sign.sh \
docker/appimage/Dockerfile \
docker/appimage/Dockerfile-CentOS7 \
docker/gpg4win-bookworm/Dockerfile \
patches/breeze-icons/0001-Add-16x16-variant-of-data-success.patch \
patches/breeze-icons/0002-Add-nicer-16x16-variant-of-dialog-question.patch \
patches/breeze-icons/0003-Add-data-question-status-icon-similar-to-other-data-.patch \
patches/breeze-icons/0004-Add-symbolic-variants-of-status-icons-for-usage-with.patch \
patches/breeze-icons/0005-Disable-recoloring-of-status-icons.patch \
patches/breeze-icons/0001-Allow-to-disable-building-of-the-icon-library-native.patch \
patches/breeze-icons/0001-Draft-Handle-cross-compiling-for-tools.patch \
patches/breeze-icons/remove-kleopatra-icons.patch \
+ patches/breeze/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch \
patches/breeze/0001-Do-not-alias-QtOpenGL-and-QtNetwork.patch \
patches/breeze/0001-Do-not-pass-QIcon-Selected-mode-to-icon-painter.patch \
+ patches/breeze/0001-Don-t-use-mixed-colors-for-frames-if-high-contrast-i.patch \
patches/breeze/0001-Fix-toolbar-colors-in-high-contrast-mode.patch \
patches/breeze/0002-fix-ifdef-windows-qmenu.patch \
patches/breeze/0002-kstyle-Support-registering-QMainWindow-in-tools-area.patch \
- patches/breeze/0003-Add-helper-for-checking-if-high-contrast-color-schem.patch \
patches/breeze/0004-For-high-contrast-draw-hovered-menu-bar-items-like-s.patch \
patches/breeze/0005-For-high-contrast-draw-hovered-menu-items-like-selec.patch \
patches/extra-cmake-modules/0001-Do-not-abort-without-QML-native.patch \
patches/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \
patches/extra-cmake-modules/0001-Use-preferred-display-language-instead-of-locale-on-.patch \
patches/jpeg/fix-redefine.patch \
patches/kcalendarcore/0001-Add-option-to-build-without-QML.patch \
patches/kcolorscheme/0001-Add-support-for-high-contrast-color-themes-on-Window.patch \
patches/kcolorscheme/0002-Initialize-color-scheme-from-system-palette-if-high-.patch \
patches/kcolorscheme/0003-Remove-assert-in-createApplicationPalette.patch \
patches/kconfig-6.11.0/0001-Fix-double-unescaping-of-config-keys.patch \
patches/kconfig-6.11.0/0002-Fix-reading-of-localized-config-values-on-Windows-an.patch \
patches/kconfigwidgets/0001-Use-highlight-text-color-and-omit-custom-text-colori.patch \
patches/kconfigwidgets/0002-Draw-text-between-shortcut-keys-with-normal-highligh.patch \
patches/kcoreaddons/0001-Fix-MINGW-build.patch \
patches/kguiaddons/0001-Add-support-for-high-contrast-mode-on-Windows.patch \
patches/kguiaddons/0002-DRAFT-There-is-no-dark-mode-on-old-Windows.patch \
patches/ki18n/0001-Undef-snprintf-for-windows.patch \
patches/ki18n/0001-gpg4win-fix-language-issues.patch \
patches/kiconthemes/0001-Remove-code-for-Qt-older-than-6.8.patch \
patches/kiconthemes/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch \
patches/kiconthemes/0002-Use-symbolic-icons-if-high-contrast-color-scheme-is-.patch \
patches/kjobwidgets/0001-Remove-knotification.patch \
patches/kleopatra/0001-Experimental-Optionally-don-t-start-gpg-agent-on-sta.patch \
patches/kleopatra/0002-Experimental-Optionally-don-t-use-file-system-watche.patch \
patches/knotifications/0001-Fix-build-wihout-QDbus.patch \
patches/kwidgetsaddons-6.11.0/0001-Fix-bug-510055-When-we-press-enter-in-search-line-we.patch \
patches/kwidgetsaddons/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch \
patches/kwidgetsaddons/0002-KMessageWidget-Don-t-draw-background-if-high-contras.patch \
patches/kwidgetsaddons/0003-KPageView-Use-correct-icon-mode-if-high-contrast-col.patch \
patches/kwidgetsaddons/0004-Don-t-draw-some-days-in-dark-red-if-high-contrast-co.patch \
patches/libical/workaround-weird-mingw-10.0.0-issue.patch \
patches/libkleo/0001-Revert-Explicitly-use-Boost-s-cmake-config-file-for-.patch \
patches/mimetreeparser-25.04.2/fix-multiple-connect.patch \
patches/okular/0001-Add-GnuPG-specific-manifest-to-okular.patch \
patches/okular/0001-Add-support-to-customize-about-data.sik \
patches/okular/lower-cmake-requirement.patch \
patches/okular/pgp-default-true.patch \
patches/pcre2/cross-build-cmake.patch \
patches/qtbase-6.7.3/0001-QIcon-enable-icon-engine-plugins-to-implement-themes.patch \
patches/qtbase-6.7.3/0001-a11y-Remember-QTreeView-s-a11y-child-interfaces.patch \
patches/qtbase/0001-Don-t-report-active-windows-as-having-focus-unless-t.patch \
patches/qtbase/0001-Gpg4win-qstandardpaths-patch.patch \
patches/qtbase/0001-Make-queryHighContrast-a-file-static.patch \
patches/qtbase/0001-Notify-a11y-tools-if-check-state-changes.patch \
patches/qtbase/0001-Raise-UIA-event-for-toggled-tree-view-item.patch \
patches/qtbase/0002-Use-correct-tool-tip-colors-for-high-contrast-modes.patch \
patches/qtbase/0003-Use-system-colors-if-high-contrast-mode-is-active.patch \
patches/qtbase/0004-Fix-a11y-window-activation-events.patch \
patches/qtbase/0005-a11y-Return-correct-string-information-for-item-view.patch \
patches/qtbase/CVE-2025-30348-qtbase-6.5.diff.patch \
patches/qtbase/CVE-2025-4211-qtbase-6.8.diff.patch \
patches/qtbase/CVE-2025-5455-qtbase-6.8.patch \
patches/qtbase/add-kleopatras-mime-types.patch \
patches/qtbase/configurable-windowstheme.patch \
patches/qtbase/qt_use_share_instead_of_data.patch \
patches/qthttpserver/originAuthenticationRequired.patch \
patches/qtsvg/CVE-2025-10728-qtsvg-6.8.diff.patch \
patches/qtsvg/CVE-2025-10729-qtsvg-6.8.diff.patch \
patches-appimage/breeze/0001-Do-not-alias-QtOpenGL-and-QtNetwork.patch \
patches-appimage/breeze/0002-fix-ifdef-windows-qmenu.patch \
patches-appimage/extra-cmake-modules/0001-Do-not-abort-without-QML-native.patch \
patches-appimage/extra-cmake-modules/0001-Use-BIN_INSTALL_DIR-data-for-DATAROOTDIR-on-Windows.patch \
patches-appimage/kcalendarcore/0001-Add-option-to-build-without-QML.patch \
patches-appimage/kcrash/0001-Add-option-to-disable-OpenGL-support.patch \
patches-appimage/kjobwidgets/0001-Remove-knotification.patch \
patches-appimage/okular/0001-Make-KF6Pty-dependency-optional.patch \
patches-appimage/okular/lower-cmake-requirement.patch \
patches-appimage/qtbase/0001-Gpg4win-qstandardpaths-patch.patch \
patches-appimage/qtbase/add-kleopatras-mime-types.patch \
patches-appimage/qtbase/configurable-windowstheme.patch \
patches-appimage/qtbase/qt_use_share_instead_of_data.patch
dist-hook: gen-ChangeLog pack_packages_tarballs
if BUILD_W64_COND
w64_extraargs=" --w64"
endif
distcheck-hook:
set -e; ( \
pref="#+macro: gpg4win_" ;\
reldate="$$(date -u +%Y-%m-%d)" ;\
echo "$${pref}ver $(PACKAGE_VERSION)" ;\
echo "$${pref}date $${reldate}" ;\
list='$(DIST_ARCHIVES)'; for i in $$list; do \
case "$$i" in *.tar.bz2) \
echo "$${pref}size $$(wc -c <$$i|awk '{print int($$1/1024)}')k" ;\
echo "$${pref}sha1 $$(sha1sum <$$i|cut -d' ' -f1)" ;\
echo "$${pref}sha2 $$(sha256sum <$$i|cut -d' ' -f1)" ;;\
esac;\
done ) | tee $(distdir).swdb
# Names of to help the release target.
RELEASE_NAME = $(PACKAGE_TARNAME)-$(PACKAGE_VERSION)
gen_start_date = 2012-03-26T00:00:00
.PHONY: gen-ChangeLog
gen-ChangeLog:
set -e; \
if test -d $(top_srcdir)/.git; then \
(cd $(top_srcdir) && \
$(GITLOG_TO_CHANGELOG) --append-dot --tear-off \
--amend=build-aux/git-log-fix \
--since=$(gen_start_date) ) > $(distdir)/cl-t; \
cat $(top_srcdir)/build-aux/git-log-footer >> $(distdir)/cl-t;\
rm -f $(distdir)/ChangeLog; \
mv $(distdir)/cl-t $(distdir)/ChangeLog; \
fi
# We also need to package all tarballs. Actually it would be better
# to pack only those which are listed in packages.current but for this
# wen need to extend the script and also handle the package list for
# appimages. Note further that we can't use ln(1) because /src and
# /build are on different partitions inside docker.
.PHONY: pack_packages_tarballs
pack_packages_tarballs:
(find $(top_srcdir)/packages -type f \
\( -name '*.tar.gz' -o -name '*.tar.bz2' \
-o -name '*.tar.xz' -o -name '*.zip' \
-o -name '*.exe' -o -name '*.wixlib' \
\) -print | xargs cp -t $(distdir)/packages/ )
download: packages/packages.list
(cd packages; ./download.sh)
vsd-versions: src/stamps/stamp-versions-all-signed
rebuild:
./build.sh --update-img --inplace $(w64_extraargs)
clean-local:
-rm -rf artifacts
-rm -f $(RELEASE_NAME).tar.xz files-to-commit.lst
distclean-local:
-rm -f $(RELEASE_NAME).swdb
msi:
$(MAKE) $(AM_MAKEFLAGS) -C src \
TOPSRCDIR=/src PLAYGROUND=/build msi
msi-signed:
$(MAKE) $(AM_MAKEFLAGS) -C src \
TOPSRCDIR=/src PLAYGROUND=/build msi-signed
msi-upload:
$(MAKE) $(AM_MAKEFLAGS) -C src \
TOPSRCDIR=/src PLAYGROUND=/build msi-upload
diff --git a/patches/breeze/0003-Add-helper-for-checking-if-high-contrast-color-schem.patch b/patches/breeze/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch
similarity index 79%
rename from patches/breeze/0003-Add-helper-for-checking-if-high-contrast-color-schem.patch
rename to patches/breeze/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch
index d491b9c5..9cea8f60 100644
--- a/patches/breeze/0003-Add-helper-for-checking-if-high-contrast-color-schem.patch
+++ b/patches/breeze/0001-Add-helper-for-checking-if-high-contrast-color-schem.patch
@@ -1,98 +1,122 @@
#! /bin/sh
patch -p1 -l -f $* < $0
exit $?
From 00406d0c8d0886fcae746a0f9f2dcf8038d1b2dc Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= <dev@ingo-kloecker.de>
Date: Tue, 17 Jun 2025 15:42:08 +0200
Subject: [PATCH 3/5] Add helper for checking if high-contrast color scheme is
in use
---
kstyle/CMakeLists.txt | 1 +
kstyle/highcontrasthelper.cpp | 37 +++++++++++++++++++++++++++++++++++
kstyle/highcontrasthelper.h | 17 ++++++++++++++++
3 files changed, 55 insertions(+)
create mode 100644 kstyle/highcontrasthelper.cpp
create mode 100644 kstyle/highcontrasthelper.h
diff --git a/kstyle/CMakeLists.txt b/kstyle/CMakeLists.txt
index af7a9a15..f30ac9a2 100644
--- a/kstyle/CMakeLists.txt
+++ b/kstyle/CMakeLists.txt
@@ -52,6 +52,7 @@ set(breeze_PART_SRCS
breezetileset.cpp
breezewindowmanager.cpp
breezetoolsareamanager.cpp
+ highcontrasthelper.cpp
)
kconfig_add_kcfg_files(breeze_PART_SRCS ../kdecoration/breezesettings.kcfgc)
+diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp
+index d3992ded..001aaa49 100644
+--- a/kstyle/breezehelper.cpp
++++ b/kstyle/breezehelper.cpp
+@@ -8,6 +8,7 @@
+
+ #include "breeze.h"
+ #include "breezepropertynames.h"
++#include "highcontrasthelper.h"
+
+ #include <KColorScheme>
+ #include <KColorUtils>
+diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
+index a2523913..7d0a6a3a 100644
+--- a/kstyle/breezestyle.cpp
++++ b/kstyle/breezestyle.cpp
+@@ -20,6 +20,7 @@
+ #include "breezetoolsareamanager.h"
+ #include "breezewidgetexplorer.h"
+ #include "breezewindowmanager.h"
++#include "highcontrasthelper.h"
+
+ #include <KColorUtils>
+ #include <KIconLoader>
diff --git a/kstyle/highcontrasthelper.cpp b/kstyle/highcontrasthelper.cpp
new file mode 100644
index 00000000..551f7e7d
--- /dev/null
+++ b/kstyle/highcontrasthelper.cpp
@@ -0,0 +1,37 @@
+/*
+ * 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.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/kstyle/highcontrasthelper.h b/kstyle/highcontrasthelper.h
new file mode 100644
index 00000000..163b7011
--- /dev/null
+++ b/kstyle/highcontrasthelper.h
@@ -0,0 +1,17 @@
+/*
+ * SPDX-FileCopyrightText: 2025 g10 Code GmbH
+ * SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
+ *
+ * SPDX-License-Identifier: LGPL-2.0-or-later
+ */
+
+#pragma once
+
+#ifdef Q_OS_WIN
+bool isHighContrastColorSchemeInUse();
+#else
+constexpr bool isHighContrastColorSchemeInUse()
+{
+ return false;
+}
+#endif
--
2.49.0
diff --git a/patches/breeze/0001-Don-t-use-mixed-colors-for-frames-if-high-contrast-i.patch b/patches/breeze/0001-Don-t-use-mixed-colors-for-frames-if-high-contrast-i.patch
new file mode 100644
index 00000000..62724d14
--- /dev/null
+++ b/patches/breeze/0001-Don-t-use-mixed-colors-for-frames-if-high-contrast-i.patch
@@ -0,0 +1,180 @@
+#! /bin/sh
+patch -p1 -l -f $* < $0
+exit $?
+
+From b672214469eb7873c69567918dbcaf227a2a58b9 Mon Sep 17 00:00:00 2001
+From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= <dev@ingo-kloecker.de>
+Date: Tue, 11 Nov 2025 11:53:13 +0100
+Subject: [PATCH] Don't use mixed colors for frames if high-contrast is in use
+
+Otherwise, the borders of checkboxes, etc. have way too low contrast.
+---
+ kstyle/breezehelper.cpp | 46 +++++++++++++++++++++++++++--------------
+ kstyle/breezestyle.cpp | 15 ++++++++++----
+ 2 files changed, 42 insertions(+), 19 deletions(-)
+
+diff --git a/kstyle/breezehelper.cpp b/kstyle/breezehelper.cpp
+index d3992ded..fb524034 100644
+--- a/kstyle/breezehelper.cpp
++++ b/kstyle/breezehelper.cpp
+@@ -145,7 +145,9 @@ QColor transparentize(const QColor &color, qreal amount)
+ //____________________________________________________________________
+ QColor Helper::frameOutlineColor(const QPalette &palette, bool mouseOver, bool hasFocus, qreal opacity, AnimationMode mode) const
+ {
+- QColor outline(KColorUtils::mix(palette.color(QPalette::Window), palette.color(QPalette::WindowText), Metrics::Bias_Default));
++ QColor outline(isHighContrastColorSchemeInUse() //
++ ? palette.color(QPalette::WindowText)
++ : KColorUtils::mix(palette.color(QPalette::Window), palette.color(QPalette::WindowText), Metrics::Bias_Default));
+
+ // focus takes precedence over hover
+ if (mode == AnimationFocus) {
+@@ -263,7 +265,9 @@ QColor Helper::arrowColor(const QPalette &palette, bool mouseOver, bool hasFocus
+ //____________________________________________________________________
+ QColor Helper::sliderOutlineColor(const QPalette &palette, bool mouseOver, bool hasFocus, qreal opacity, AnimationMode mode) const
+ {
+- QColor outline(KColorUtils::mix(palette.color(QPalette::Button), palette.color(QPalette::ButtonText), Metrics::Bias_Default));
++ QColor outline(isHighContrastColorSchemeInUse() //
++ ? palette.color(QPalette::ButtonText)
++ : KColorUtils::mix(palette.color(QPalette::Button), palette.color(QPalette::ButtonText), Metrics::Bias_Default));
+
+ // hover takes precedence over focus
+ if (mode == AnimationHover) {
+@@ -292,7 +296,9 @@ QColor Helper::sliderOutlineColor(const QPalette &palette, bool mouseOver, bool
+ //____________________________________________________________________
+ QColor Helper::scrollBarHandleColor(const QPalette &palette, bool mouseOver, bool hasFocus, qreal opacity, AnimationMode mode) const
+ {
+- QColor color(alphaColor(palette.color(QPalette::WindowText), 0.5));
++ QColor color(isHighContrastColorSchemeInUse() //
++ ? palette.color(QPalette::WindowText)
++ : alphaColor(palette.color(QPalette::WindowText), 0.5));
+
+ // hover takes precedence over focus
+ if (mode == AnimationHover) {
+@@ -344,7 +350,11 @@ QColor Helper::checkBoxIndicatorColor(const QPalette &palette, bool mouseOver, b
+ //______________________________________________________________________________
+ QColor Helper::separatorColor(const QPalette &palette) const
+ {
+- return KColorUtils::mix(palette.color(QPalette::Window), palette.color(QPalette::WindowText), Metrics::Bias_Default);
++ if (isHighContrastColorSchemeInUse()) {
++ return palette.color(QPalette::ButtonText);
++ } else {
++ return KColorUtils::mix(palette.color(QPalette::Window), palette.color(QPalette::WindowText), Metrics::Bias_Default);
++ }
+ }
+
+ //______________________________________________________________________________
+@@ -693,6 +703,9 @@ void Helper::renderButtonFrame(QPainter *painter,
+ const QColor &highlightColor = palette.color(!enabled ? QPalette::Disabled : QPalette::Active, QPalette::Highlight);
+ QBrush bgBrush;
+ QBrush penBrush;
++ const QColor basePenColor = (isHighContrastColorSchemeInUse() //
++ ? palette.buttonText().color()
++ : KColorUtils::mix(palette.button().color(), palette.buttonText().color(), Metrics::Bias_Default));
+
+ // Colors
+ if (flat) {
+@@ -700,11 +713,10 @@ void Helper::renderButtonFrame(QPainter *painter,
+ bgBrush = alphaColor(highlightColor, highlightBackgroundAlpha);
+ } else if (checked) {
+ bgBrush = hasNeutralHighlight ? alphaColor(neutralText(palette), highlightBackgroundAlpha) : alphaColor(palette.buttonText().color(), 0.125);
+- penBrush =
+- hasNeutralHighlight ? neutralText(palette) : KColorUtils::mix(palette.button().color(), palette.buttonText().color(), Metrics::Bias_Default);
++ penBrush = hasNeutralHighlight ? neutralText(palette) : basePenColor;
+ } else if (isActiveWindow && defaultButton) {
+ bgBrush = alphaColor(highlightColor, 0.125);
+- penBrush = KColorUtils::mix(highlightColor, KColorUtils::mix(palette.button().color(), palette.buttonText().color(), Metrics::Bias_Default), 0.5);
++ penBrush = KColorUtils::mix(highlightColor, basePenColor, 0.5);
+ } else {
+ bgBrush = alphaColor(highlightColor, 0);
+ penBrush = hasNeutralHighlight ? neutralText(palette) : bgBrush;
+@@ -715,15 +727,13 @@ void Helper::renderButtonFrame(QPainter *painter,
+ } else if (checked) {
+ bgBrush = hasNeutralHighlight ? KColorUtils::mix(palette.button().color(), neutralText(palette), 0.333)
+ : KColorUtils::mix(palette.button().color(), palette.buttonText().color(), 0.125);
+- penBrush =
+- hasNeutralHighlight ? neutralText(palette) : KColorUtils::mix(palette.button().color(), palette.buttonText().color(), Metrics::Bias_Default);
++ penBrush = hasNeutralHighlight ? neutralText(palette) : basePenColor;
+ } else if (isActiveWindow && defaultButton) {
+ bgBrush = KColorUtils::mix(palette.button().color(), highlightColor, 0.2);
+- penBrush = KColorUtils::mix(highlightColor, KColorUtils::mix(palette.button().color(), palette.buttonText().color(), Metrics::Bias_Default), 0.5);
++ penBrush = KColorUtils::mix(highlightColor, basePenColor, 0.5);
+ } else {
+ bgBrush = palette.button().color();
+- penBrush =
+- hasNeutralHighlight ? neutralText(palette) : KColorUtils::mix(palette.button().color(), palette.buttonText().color(), Metrics::Bias_Default);
++ penBrush = hasNeutralHighlight ? neutralText(palette) : basePenColor;
+ }
+ }
+
+@@ -1321,7 +1331,11 @@ void Helper::renderScrollBarHandle(QPainter *painter, const QRectF &rect, const
+ const qreal radius(0.5 * std::min({baseRect.width(), baseRect.height(), (qreal)Metrics::ScrollBar_SliderWidth}));
+
+ painter->setPen(Qt::NoPen);
+- painter->setPen(QPen(transparentize(fg, Metrics::Bias_Default), 1.001));
++ if (isHighContrastColorSchemeInUse()) {
++ painter->setPen(QPen(fg, 1.001));
++ } else {
++ painter->setPen(QPen(transparentize(fg, Metrics::Bias_Default), 1.001));
++ }
+ painter->setBrush(KColorUtils::overlayColors(bg, alphaColor(fg, 0.5)));
+ painter->drawRoundedRect(strokedRect(baseRect), radius, radius);
+ }
+@@ -1510,7 +1525,8 @@ void Helper::renderTabBarTab(QPainter *painter,
+ } else {
+ bgBrush = frameBackgroundColor(palette);
+ }
+- QColor penBrush = KColorUtils::mix(bgBrush, palette.color(QPalette::WindowText), Metrics::Bias_Default);
++ QColor penBrush = isHighContrastColorSchemeInUse() ? palette.windowText().color()
++ : KColorUtils::mix(bgBrush, palette.color(QPalette::WindowText), Metrics::Bias_Default);
+ painter->setBrush(bgBrush);
+ painter->setPen(QPen(penBrush, PenWidth::Frame));
+ QRectF highlightRect = frameRect;
+diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
+index a2523913..4779db7b 100644
+--- a/kstyle/breezestyle.cpp
++++ b/kstyle/breezestyle.cpp
+@@ -4651,7 +4651,9 @@ bool Style::drawPanelTipLabelPrimitive(const QStyleOption *option, QPainter *pai
+
+ const auto &palette(option->palette);
+ const auto &background = palette.color(QPalette::ToolTipBase);
+- const auto outline(KColorUtils::mix(palette.color(QPalette::ToolTipBase), palette.color(QPalette::ToolTipText), 0.25));
++ const auto outline(isHighContrastColorSchemeInUse() //
++ ? palette.buttonText().color()
++ : KColorUtils::mix(palette.color(QPalette::ToolTipBase), palette.color(QPalette::ToolTipText), 0.25));
+ const bool hasAlpha(_helper->hasAlphaChannel(widget));
+
+ _helper->renderMenuFrame(painter, option->rect, background, outline, hasAlpha);
+@@ -6692,7 +6694,8 @@ bool Style::drawHeaderSectionControl(const QStyleOption *option, QPainter *paint
+
+ // outline
+ painter->setBrush(Qt::NoBrush);
+- painter->setPen(_helper->alphaColor(palette.color(QPalette::WindowText), Metrics::Bias_Default));
++ painter->setPen(isHighContrastColorSchemeInUse() ? palette.windowText().color()
++ : _helper->alphaColor(palette.color(QPalette::WindowText), Metrics::Bias_Default));
+
+ if (isCorner) {
+ if (reverseLayout) {
+@@ -6713,7 +6716,8 @@ bool Style::drawHeaderSectionControl(const QStyleOption *option, QPainter *paint
+ }
+
+ // separators
+- painter->setPen(_helper->alphaColor(palette.color(QPalette::WindowText), Metrics::Bias_Default));
++ painter->setPen(isHighContrastColorSchemeInUse() ? palette.windowText().color()
++ : _helper->alphaColor(palette.color(QPalette::WindowText), Metrics::Bias_Default));
+
+ // If the separator is next to a "HeaderEmptyArea", skip it and let that draw
+ // the separator instead. This means that those separators are only visible when necessary.
+@@ -8070,7 +8074,10 @@ bool Style::drawScrollBarComplexControl(const QStyleOptionComplex *option, QPain
+ separatorRect = alignedRect(option->direction, Qt::AlignLeft, QSize(PenWidth::Frame, option->rect.height()), option->rect);
+ }
+
+- _helper->renderScrollBarBorder(painter, separatorRect, _helper->alphaColor(option->palette.color(QPalette::Text), Metrics::Bias_Default));
++ _helper->renderScrollBarBorder(painter,
++ separatorRect,
++ isHighContrastColorSchemeInUse() ? option->palette.text().color()
++ : _helper->alphaColor(option->palette.color(QPalette::Text), Metrics::Bias_Default));
+
+ // call base class primitive
+ ParentStyleClass::drawComplexControl(CC_ScrollBar, option, painter, widget);
+--
+2.51.1
diff --git a/patches/breeze/0004-For-high-contrast-draw-hovered-menu-bar-items-like-s.patch b/patches/breeze/0004-For-high-contrast-draw-hovered-menu-bar-items-like-s.patch
index bcd38ead..7a616688 100644
--- a/patches/breeze/0004-For-high-contrast-draw-hovered-menu-bar-items-like-s.patch
+++ b/patches/breeze/0004-For-high-contrast-draw-hovered-menu-bar-items-like-s.patch
@@ -1,42 +1,34 @@
#! /bin/sh
patch -p1 -l -f $* < $0
exit $?
From ef269e067e486cf97b60c5a7740222bba93e8a56 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Ingo=20Kl=C3=B6cker?= <dev@ingo-kloecker.de>
Date: Mon, 16 Jun 2025 17:03:50 +0200
Subject: [PATCH 4/5] For high-contrast, draw hovered menu bar items like
selected items
This avoids problems with some high-contrast color schemes where hovered
menu bar items had really bad contrast.
GnuPG-bug-id: 7415
---
kstyle/breezestyle.cpp | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)
diff --git a/kstyle/breezestyle.cpp b/kstyle/breezestyle.cpp
index f76b0c9b..7a4de4e1 100644
--- a/kstyle/breezestyle.cpp
+++ b/kstyle/breezestyle.cpp
-@@ -20,6 +20,7 @@
- #include "breezetoolsareamanager.h"
- #include "breezewidgetexplorer.h"
- #include "breezewindowmanager.h"
-+#include "highcontrasthelper.h"
-
- #include <KColorUtils>
- #include <KIconLoader>
@@ -5682,7 +5683,8 @@ bool Style::drawMenuBarItemControl(const QStyleOption *option, QPainter *painter
const auto textRect = option->fontMetrics.boundingRect(rect, textFlags, menuItemOption->text);
// render text
- const QPalette::ColorRole role = (useStrongFocus && sunken) ? QPalette::HighlightedText : QPalette::WindowText;
+ const QPalette::ColorRole role =
+ (useStrongFocus && (sunken || (selected && isHighContrastColorSchemeInUse()))) ? QPalette::HighlightedText : QPalette::WindowText;
drawItemText(painter, textRect, textFlags, palette, enabled, menuItemOption->text, role);
// render outline
--
2.49.0
File Metadata
Details
Attached
Mime Type
text/x-diff
Expires
Sat, Dec 6, 10:43 PM (1 d, 18 h)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
75/1a/1e3b7692fdfcb00eb286ce3f7c57
Attached To
rW Gpg4win
Event Timeline
Log In to Comment