Mercurial > minori
comparison src/sys/osx/dark_theme.cc @ 195:975a3f0965e2
locale: only attempt loading locales after QApplication is init'd
also the general application stuff and anime list is separated in settings
| author | Paper <mrpapersonic@gmail.com> |
|---|---|
| date | Thu, 07 Dec 2023 11:14:01 -0500 |
| parents | 8548dc425697 |
| children | f0ff06a45c42 |
comparison
equal
deleted
inserted
replaced
| 194:8548dc425697 | 195:975a3f0965e2 |
|---|---|
| 2 | 2 |
| 3 #include <objc/runtime.h> | 3 #include <objc/runtime.h> |
| 4 #include <objc/message.h> | 4 #include <objc/message.h> |
| 5 | 5 |
| 6 #include <CoreFoundation/CoreFoundation.h> | 6 #include <CoreFoundation/CoreFoundation.h> |
| 7 #include <AvailabilityMacros.h> | |
| 8 | 7 |
| 9 #include <QOperatingSystemVersion> | 8 #include <QOperatingSystemVersion> |
| 10 | 9 |
| 11 namespace osx { | 10 namespace osx { |
| 12 | 11 |
| 17 static const class_message_send cls_send = reinterpret_cast<class_message_send>(objc_msgSend); | 16 static const class_message_send cls_send = reinterpret_cast<class_message_send>(objc_msgSend); |
| 18 | 17 |
| 19 static CFStringRef NSAppearanceNameAqua = nullptr; | 18 static CFStringRef NSAppearanceNameAqua = nullptr; |
| 20 static CFStringRef NSAppearanceNameDarkAqua = nullptr; | 19 static CFStringRef NSAppearanceNameDarkAqua = nullptr; |
| 21 | 20 |
| 22 static const CFStringRef kLaunchServicesBundleID = CFSTR("com.apple.AppKit"); | 21 static const CFStringRef kAppKitBundleID = CFSTR("com.apple.AppKit"); |
| 23 | 22 |
| 24 bool RetrieveAppearanceNames() { | 23 bool RetrieveAppearanceNames() { |
| 25 CFBundleRef appkit_bundle = CFBundleGetBundleWithIdentifier(kLaunchServicesBundleID); | 24 CFBundleRef appkit_bundle = CFBundleGetBundleWithIdentifier(kAppKitBundleID); |
| 26 if (!appkit_bundle) | 25 if (!appkit_bundle) |
| 27 return false; | 26 return false; |
| 28 | 27 |
| 29 NSAppearanceNameAqua = *reinterpret_cast<CFStringRef*>(CFBundleGetDataPointerForName(appkit_bundle, CFSTR("NSAppearanceNameAqua"))); | 28 NSAppearanceNameAqua = *reinterpret_cast<CFStringRef*>(CFBundleGetDataPointerForName(appkit_bundle, CFSTR("NSAppearanceNameAqua"))); |
| 30 if (!NSAppearanceNameAqua) | 29 if (!NSAppearanceNameAqua) |
