mirror of
https://github.com/celisej567/abaddon.git
synced 2026-02-25 14:32:37 +03:00
Merge branch 'master' of https://github.com/uowuo/abaddon
This commit is contained in:
@@ -50,7 +50,7 @@ file(GLOB_RECURSE ABADDON_SOURCES
|
||||
"src/*.h"
|
||||
"src/*.hpp"
|
||||
"src/*.cpp"
|
||||
)
|
||||
)
|
||||
|
||||
list(FILTER ABADDON_SOURCES EXCLUDE REGEX ".*notifier_gio\\.cpp$")
|
||||
list(FILTER ABADDON_SOURCES EXCLUDE REGEX ".*notifier_fallback\\.cpp$")
|
||||
@@ -148,6 +148,12 @@ endif ()
|
||||
|
||||
set(USE_MINIAUDIO FALSE)
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(abaddon "-framework CoreFoundation")
|
||||
target_link_libraries(abaddon "-framework CoreAudio")
|
||||
target_link_libraries(abaddon "-framework AudioToolbox")
|
||||
endif ()
|
||||
|
||||
if (ENABLE_VOICE)
|
||||
target_compile_definitions(abaddon PRIVATE WITH_VOICE)
|
||||
|
||||
@@ -194,12 +200,6 @@ if (ENABLE_VOICE)
|
||||
target_link_libraries(abaddon rnnoise::rnnoise)
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(abaddon "-framework CoreFoundation")
|
||||
target_link_libraries(abaddon "-framework CoreAudio")
|
||||
target_link_libraries(abaddon "-framework AudioToolbox")
|
||||
endif ()
|
||||
endif ()
|
||||
|
||||
if (${ENABLE_NOTIFICATION_SOUNDS})
|
||||
@@ -214,12 +214,11 @@ if (USE_MINIAUDIO)
|
||||
PATH_SUFFIXES miniaudio
|
||||
REQUIRED)
|
||||
|
||||
if (APPLE)
|
||||
target_link_libraries(abaddon "-framework CoreFoundation")
|
||||
target_link_libraries(abaddon "-framework CoreAudio")
|
||||
target_link_libraries(abaddon "-framework AudioToolbox")
|
||||
endif ()
|
||||
|
||||
target_include_directories(abaddon PUBLIC ${MINIAUDIO_INCLUDE_DIR})
|
||||
target_compile_definitions(abaddon PRIVATE WITH_MINIAUDIO)
|
||||
endif ()
|
||||
|
||||
set(ABADDON_COMPILER_DEFS "" CACHE STRING "Additional compiler definitions")
|
||||
foreach (COMPILER_DEF IN LISTS ABADDON_COMPILER_DEFS)
|
||||
target_compile_definitions(abaddon PRIVATE "${COMPILER_DEF}")
|
||||
endforeach ()
|
||||
|
||||
@@ -25,6 +25,23 @@
|
||||
#include "remoteauth/remoteauthdialog.hpp"
|
||||
#include "util.hpp"
|
||||
|
||||
#if defined(__APPLE__)
|
||||
#include <CoreFoundation/CoreFoundation.h>
|
||||
|
||||
void macOSThemeChanged() {
|
||||
CFPropertyListRef appearanceName = CFPreferencesCopyAppValue(CFSTR("AppleInterfaceStyle"), kCFPreferencesAnyApplication);
|
||||
if (appearanceName != NULL && CFGetTypeID(appearanceName) == CFStringGetTypeID() && CFStringCompare((CFStringRef)appearanceName, CFSTR("Dark"), 0) == kCFCompareEqualTo) {
|
||||
Gtk::Settings::get_default()->set_property("gtk-application-prefer-dark-theme", true);
|
||||
} else {
|
||||
Gtk::Settings::get_default()->set_property("gtk-application-prefer-dark-theme", false);
|
||||
}
|
||||
}
|
||||
|
||||
void macOSThemeChangedCallback(CFNotificationCenterRef center, void *observer, CFStringRef name, const void *object, CFDictionaryRef userInfo) {
|
||||
macOSThemeChanged();
|
||||
}
|
||||
#endif
|
||||
|
||||
#ifdef WITH_LIBHANDY
|
||||
#include <handy.h>
|
||||
#endif
|
||||
@@ -332,6 +349,17 @@ int Abaddon::StartGTK() {
|
||||
m_gtk_app->hold();
|
||||
m_main_window->show();
|
||||
|
||||
#if defined(__APPLE__)
|
||||
CFNotificationCenterAddObserver(CFNotificationCenterGetDistributedCenter(),
|
||||
NULL,
|
||||
macOSThemeChangedCallback,
|
||||
CFSTR("AppleInterfaceThemeChangedNotification"),
|
||||
NULL,
|
||||
CFNotificationSuspensionBehaviorCoalesce);
|
||||
|
||||
macOSThemeChanged();
|
||||
#endif
|
||||
|
||||
RunFirstTimeDiscordStartup();
|
||||
|
||||
return m_gtk_app->run(*m_main_window);
|
||||
|
||||
Reference in New Issue
Block a user