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:
parent
8d2f4ed3e1
commit
0a9f1e7391
@ -361,3 +361,8 @@ void InstallNSApplicationSubclass()
|
||||
{
|
||||
[OBSApplication sharedApplication];
|
||||
}
|
||||
|
||||
bool HighContrastEnabled()
|
||||
{
|
||||
return [[NSWorkspace sharedWorkspace] accessibilityDisplayShouldIncreaseContrast];
|
||||
}
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -269,3 +269,9 @@ bool SetDisplayAffinitySupported(void)
|
||||
// Not implemented yet
|
||||
void TaskbarOverlayInit() {}
|
||||
void TaskbarOverlaySetStatus(TaskbarOverlayStatus) {}
|
||||
|
||||
bool HighContrastEnabled()
|
||||
{
|
||||
// Note implemented yet
|
||||
return false;
|
||||
}
|
||||
|
@ -36,6 +36,8 @@ void SetAlwaysOnTop(QWidget *window, bool enable);
|
||||
|
||||
bool SetDisplayAffinitySupported(void);
|
||||
|
||||
bool HighContrastEnabled();
|
||||
|
||||
enum TaskbarOverlayStatus {
|
||||
TaskbarOverlayStatusInactive,
|
||||
TaskbarOverlayStatusActive,
|
||||
|
Loading…
Reference in New Issue
Block a user