0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-19 20:32:15 +02:00

UI: Add HighContrastEnabled() to platform utilities

This commit is contained in:
derrod 2023-09-28 04:43:42 +02:00 committed by Warchamp7
parent 8d2f4ed3e1
commit 0a9f1e7391
4 changed files with 24 additions and 0 deletions

View File

@ -361,3 +361,8 @@ void InstallNSApplicationSubclass()
{
[OBSApplication sharedApplication];
}
bool HighContrastEnabled()
{
return [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldIncreaseContrast];
}

View File

@ -494,3 +494,14 @@ void TaskbarOverlaySetStatus(TaskbarOverlayStatus status)
DestroyIcon(hicon);
taskbarIcon->Release();
}
bool HighContrastEnabled()
{
HIGHCONTRAST hc = {};
hc.cbSize = sizeof(HIGHCONTRAST);
if (SystemParametersInfo(SPI_GETHIGHCONTRAST, hc.cbSize, &hc, 0))
return hc.dwFlags & HCF_HIGHCONTRASTON;
return false;
}

View File

@ -269,3 +269,9 @@ bool SetDisplayAffinitySupported(void)
// Not implemented yet
void TaskbarOverlayInit() {}
void TaskbarOverlaySetStatus(TaskbarOverlayStatus) {}
bool HighContrastEnabled()
{
// Note implemented yet
return false;
}

View File

@ -36,6 +36,8 @@ void SetAlwaysOnTop(QWidget *window, bool enable);
bool SetDisplayAffinitySupported(void);
bool HighContrastEnabled();
enum TaskbarOverlayStatus {
TaskbarOverlayStatusInactive,
TaskbarOverlayStatusActive,