[pim/kleopatra/gpg4win/vsd-3.4] src: Don't color status bar labels if high contrast mode is active
Ingo Klöcker <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 2148567a18f0dc4222e7d70eac4073260141da58 by Ingo Klöcker, on behalf of Ingo Klöcker.
Committed on 18/08/2026 at 09:59.
Pushed by kloecker into branch 'gpg4win/vsd-3.4'.
Don't color status bar labels if high contrast mode is active
With Qt 5/KF5 this is still necessary because the application palette is
not adjusted to the high contrast palette if high contrast mode is
enabled.
GnuPG-bug-id: 8406
M +7 -5 src/mainwindow.cpp
https://invent.kde.org/pim/kleopatra/-/commit/2148567a18f0dc4222e7d70eac4073260141da58
diff --git a/src/mainwindow.cpp b/src/mainwindow.cpp
index 619404cf6..c4158d29c 100644
--- a/src/mainwindow.cpp
+++ b/src/mainwindow.cpp
@@ -270,7 +270,7 @@ public:
}
if (DeVSCompliance::isActive()) {
auto statusLbl = std::make_unique<QLabel>(DeVSCompliance::name());
- {
+ if (!SystemInfo::isHighContrastModeActive()) {
auto statusPalette = qApp->palette();
KColorScheme::adjustForeground(statusPalette,
DeVSCompliance::isCompliant() ? KColorScheme::NormalText : KColorScheme::NegativeText,
@@ -289,10 +289,12 @@ public:
statusBar->insertWidget(0, new QLabel{KAboutData::applicationData().version()});
auto statusLbl = std::make_unique<QLabel>(i18nc("@info:status", "Corrupt installation"));
statusLbl->setToolTip(distributionData->detailedError);
- statusLbl->setAutoFillBackground(true);
- auto statusPalette = qApp->palette();
- KColorScheme::adjustBackground(statusPalette, KColorScheme::NegativeBackground, QPalette::Window, KColorScheme::View);
- statusLbl->setPalette(statusPalette);
+ if (!SystemInfo::isHighContrastModeActive()) {
+ statusLbl->setAutoFillBackground(true);
+ auto statusPalette = qApp->palette();
+ KColorScheme::adjustBackground(statusPalette, KColorScheme::NegativeBackground, QPalette::Window, KColorScheme::View);
+ statusLbl->setPalette(statusPalette);
+ }
statusBar->insertPermanentWidget(0, statusLbl.release());
}
q->setStatusBar(statusBar.release()); // QMainWindow takes ownership