Theme (macOS): moves macOS theme detection logic from DE to dedicated module

The old behavior was inherited from neofetch. However `Aqua` and `Liquid Glass` are actually design language, not a DE. There is no DE on macOS.
This commit is contained in:
李通洲
2025-09-29 09:25:24 +08:00
parent bd9744c27c
commit 093f56a03d
3 changed files with 25 additions and 17 deletions
+1 -1
View File
@@ -974,7 +974,7 @@ elseif(APPLE)
src/detection/terminalfont/terminalfont_apple.m
src/detection/terminalshell/terminalshell_linux.c
src/detection/terminalsize/terminalsize_linux.c
src/detection/theme/theme_nosupport.c
src/detection/theme/theme_apple.c
src/detection/tpm/tpm_apple.c
src/detection/uptime/uptime_bsd.c
src/detection/users/users_linux.c
@@ -196,21 +196,5 @@ void ffConnectDisplayServerImpl(FFDisplayServerResult* ds)
}
}
const FFOSResult* os = ffDetectOS();
char* str_end;
const char* version = os->version.chars;
unsigned long osNum = strtoul(version, &str_end, 10);
if (str_end != version)
{
if (osNum > 15) { // Tahoe
ffStrbufSetStatic(&ds->dePrettyName, "Liquid Glass");
} else if (osNum < 10) {
ffStrbufSetStatic(&ds->dePrettyName, "Platinum");
} else {
ffStrbufSetStatic(&ds->dePrettyName, "Aqua");
}
}
detectDisplays(ds);
}
+24
View File
@@ -0,0 +1,24 @@
#include "theme.h"
#include "detection/os/os.h"
const char* ffDetectTheme(FFThemeResult* result)
{
const FFOSResult* os = ffDetectOS();
char* str_end;
const char* version = os->version.chars;
unsigned long osNum = strtoul(version, &str_end, 10);
if (str_end != version)
{
if (osNum > 15) { // Tahoe
ffStrbufSetStatic(&result->theme1, "Liquid Glass");
} else if (osNum < 10) {
ffStrbufSetStatic(&result->theme1, "Platinum");
} else {
ffStrbufSetStatic(&result->theme1, "Aqua");
}
}
return NULL;
}