mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 14:10:11 +01:00
Refactored logo choosing logic
This commit is contained in:
+2
-2
@@ -286,13 +286,13 @@ void ffStart(FFinstance* instance)
|
||||
if(ffDisableLinewrap)
|
||||
fputs("\033[?7l", stdout);
|
||||
|
||||
ffPrintLogo(instance);
|
||||
ffLogoPrint(instance);
|
||||
}
|
||||
|
||||
void ffFinish(FFinstance* instance)
|
||||
{
|
||||
if(instance->config.logoPrintRemaining)
|
||||
ffPrintRemainingLogo(instance);
|
||||
ffLogoPrintRemaining(instance);
|
||||
|
||||
resetConsole();
|
||||
}
|
||||
|
||||
@@ -2,16 +2,12 @@
|
||||
|
||||
void ffPrintLogoAndKey(FFinstance* instance, const char* moduleName, uint8_t moduleIndex, const FFstrbuf* customKeyFormat)
|
||||
{
|
||||
ffPrintLogoLine(instance);
|
||||
ffLogoPrintLine(instance);
|
||||
|
||||
if(!instance->config.pipe)
|
||||
{
|
||||
fputs(FASTFETCH_TEXT_MODIFIER_RESET FASTFETCH_TEXT_MODIFIER_BOLT, stdout);
|
||||
|
||||
//If the main color is not set (e.g. none logo), this would reset in \033[m, which resets everything,
|
||||
//including the wanted bolt from above. So we only print it, if the main color is at least one char.
|
||||
if(instance->config.mainColor.length > 0)
|
||||
ffPrintColor(&instance->config.mainColor);
|
||||
ffPrintColor(&instance->config.mainColor);
|
||||
}
|
||||
|
||||
if(customKeyFormat == NULL || customKeyFormat->length == 0)
|
||||
@@ -91,6 +87,11 @@ void ffPrintFormatString(FFinstance* instance, const char* moduleName, uint8_t m
|
||||
|
||||
void ffPrintColor(const FFstrbuf* colorValue)
|
||||
{
|
||||
//If the color is not set, this would reset in \033[m, which resets everything.
|
||||
//So we only print it, if the main color is at least one char.
|
||||
if(colorValue->length == 0)
|
||||
return;
|
||||
|
||||
fputs("\033[", stdout);
|
||||
ffStrbufWriteTo(colorValue, stdout);
|
||||
fputc('m', stdout);
|
||||
|
||||
Reference in New Issue
Block a user