mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-09-19 20:32:15 +02:00
UI: Set macOS appearance on theme change
Makes macOS aware that we're using either light or dark theme to adjust native dialog colors accordingly. Co-Authored-By: Patrick Heyer <PatTheMav@users.noreply.github.com>
This commit is contained in:
parent
2272efc91f
commit
11e9291800
@ -1242,6 +1242,10 @@ bool OBSApp::SetTheme(std::string name, std::string path)
|
||||
themeDarkMode = !(color.redF() < 0.5);
|
||||
}
|
||||
|
||||
#ifdef __APPLE__
|
||||
SetMacOSDarkMode(themeDarkMode);
|
||||
#endif
|
||||
|
||||
emit StyleChanged();
|
||||
return true;
|
||||
}
|
||||
|
@ -384,6 +384,17 @@ void OpenMacOSPrivacyPreferences(const char *tab)
|
||||
[[NSWorkspace sharedWorkspace] openURL:url];
|
||||
}
|
||||
|
||||
void SetMacOSDarkMode(bool dark)
|
||||
{
|
||||
if (dark) {
|
||||
NSApp.appearance =
|
||||
[NSAppearance appearanceNamed:NSAppearanceNameDarkAqua];
|
||||
} else {
|
||||
NSApp.appearance =
|
||||
[NSAppearance appearanceNamed:NSAppearanceNameAqua];
|
||||
}
|
||||
}
|
||||
|
||||
void TaskbarOverlayInit() {}
|
||||
void TaskbarOverlaySetStatus(TaskbarOverlayStatus status)
|
||||
{
|
||||
|
@ -101,6 +101,7 @@ bool isInBundle();
|
||||
void InstallNSApplicationSubclass();
|
||||
void InstallNSThreadLocks();
|
||||
void disableColorSpaceConversion(QWidget *window);
|
||||
void SetMacOSDarkMode(bool dark);
|
||||
|
||||
MacPermissionStatus CheckPermissionWithPrompt(MacPermissionType type,
|
||||
bool prompt_for_permission);
|
||||
|
Loading…
Reference in New Issue
Block a user