Page MenuHome GnuPG

No OneTemporary

diff --git a/src/utils/systeminfo.cpp b/src/utils/systeminfo.cpp
index 66b2aca5..965ee6be 100644
--- a/src/utils/systeminfo.cpp
+++ b/src/utils/systeminfo.cpp
@@ -1,45 +1,53 @@
/* -*- mode: c++; c-basic-offset:4 -*-
utils/systeminfo.cpp
This file is part of libkleopatra
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#include <config-libkleo.h>
#include "systeminfo.h"
+#include <KColorSchemeManager>
+
#include <QByteArray>
// #include "libkleo_debug.h"
#ifdef Q_OS_WIN
#include "windows.h"
#endif
#ifdef Q_OS_WIN
namespace
{
bool win_isHighContrastModeActive()
{
HIGHCONTRAST result;
result.cbSize = sizeof(HIGHCONTRAST);
if (SystemParametersInfo(SPI_GETHIGHCONTRAST, result.cbSize, &result, 0)) {
return (result.dwFlags & HCF_HIGHCONTRASTON);
}
return false;
}
}
#endif
bool Kleo::SystemInfo::isHighContrastModeActive()
{
static bool forceHighContrastMode = qgetenv("KLEO_HIGH_CONTRAST_MODE").toInt();
#ifdef Q_OS_WIN
return forceHighContrastMode || win_isHighContrastModeActive();
#else
return forceHighContrastMode;
#endif
}
+
+bool Kleo::SystemInfo::isHighContrastColorSchemeInUse()
+{
+ return KColorSchemeManager::instance()->activeSchemeId().isEmpty() // the default scheme is in use
+ && isHighContrastModeActive();
+}
diff --git a/src/utils/systeminfo.h b/src/utils/systeminfo.h
index d7b45f12..164e9446 100644
--- a/src/utils/systeminfo.h
+++ b/src/utils/systeminfo.h
@@ -1,19 +1,21 @@
/* -*- mode: c++; c-basic-offset:4 -*-
utils/systeminfo.h
This file is part of libkleopatra
SPDX-FileCopyrightText: 2022 g10 Code GmbH
SPDX-FileContributor: Ingo Klöcker <dev@ingo-kloecker.de>
SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "kleo_export.h"
namespace Kleo::SystemInfo
{
KLEO_EXPORT bool isHighContrastModeActive();
+
+KLEO_EXPORT bool isHighContrastColorSchemeInUse();
}

File Metadata

Mime Type
text/x-diff
Expires
Thu, Jul 17, 1:26 AM (21 h, 26 m)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
dc/b2/bf94cc0069909042b2bdec4d0c79

Event Timeline