Libkleo
11#include <config-libkleo.h>
13#include "systeminfo.h"
16#include <QtSystemDetection>
27bool win_isHighContrastModeActive()
30 result.cbSize =
sizeof(HIGHCONTRAST);
31 if (SystemParametersInfo(SPI_GETHIGHCONTRAST, result.cbSize, &result, 0)) {
32 return (result.dwFlags & HCF_HIGHCONTRASTON);
37bool win_isDarkModeActive()
44 DWORD color = GetSysColor(COLOR_WINDOW);
45 if (color == 0xFFFFFF) {
50 if (win_isHighContrastModeActive()) {
60 char *val = read_w32_registry_string (
"HKEY_CURRENT_USER",
61 "Software\\Microsoft\\Windows\\CurrentVersion\\Themes\\Personalize",
65 ret = !((DWORD) *val);
76bool Kleo::SystemInfo::isHighContrastModeActive()
78 static bool forceHighContrastMode = qgetenv(
"KLEO_HIGH_CONTRAST_MODE").toInt();
80 static bool highContrastModeActive = forceHighContrastMode || win_isHighContrastModeActive();
81 return highContrastModeActive;
83 return forceHighContrastMode;
87bool Kleo::SystemInfo::isDarkModeActive()
90 return win_isDarkModeActive();
93 return isHighContrastModeActive();
This file is part of the KDE documentation.
Documentation copyright © 1996-2024 The KDE developers.
Generated on Tue Mar 26 2024 11:14:12 by
doxygen 1.10.0 written
by
Dimitri van Heesch, © 1997-2006
KDE's Doxygen guidelines are available online.