fix: Theme detection issues on all OSes

This commit is contained in:
WerWolv
2022-06-30 15:09:57 +02:00
parent 19f99bab0c
commit bb429aae62
5 changed files with 20 additions and 3 deletions

View File

@@ -38,7 +38,7 @@ namespace hex {
auto exitCode = WEXITSTATUS(pclose(pipe));
if (exitCode != 0) return;
EventManager::post<RequestChangeTheme>(hex::containsIgnoreCase(result, "dark") ? 1 : 2);
EventManager::post<RequestChangeTheme>(hex::containsIgnoreCase(result, "light") ? 2 : 1);
});
if (themeFollowSystem)

View File

@@ -5,6 +5,7 @@
#include <hex/api/content_registry.hpp>
#include <hex/api/event.hpp>
#include <hex/helpers/utils_macos.hpp>
#include <hex/helpers/logger.hpp>
#include <nlohmann/json.hpp>
@@ -23,8 +24,10 @@ namespace hex {
EventManager::subscribe<EventOSThemeChanged>(this, [themeFollowSystem] {
if (!themeFollowSystem) return;
// TODO: Implement this when MacOS build is working again
EventManager::post<RequestChangeTheme>(1);
if (!isMacosSystemDarkModeEnabled())
EventManager::post<RequestChangeTheme>(2);
else
EventManager::post<RequestChangeTheme>(1);
});
if (themeFollowSystem)