mirror of
https://github.com/fastfetch-cli/fastfetch.git
synced 2026-11-08 14:10:11 +01:00
Icons: make it possible to shorten the icons name
This commit is contained in:
@@ -2,4 +2,11 @@
|
||||
|
||||
#include "fastfetch.h"
|
||||
|
||||
const char* ffDetectIcons(FFstrbuf* result);
|
||||
typedef struct FFIconsResult
|
||||
{
|
||||
FFstrbuf icons1;
|
||||
FFstrbuf icons2;
|
||||
} FFIconsResult;
|
||||
|
||||
|
||||
const char* ffDetectIcons(FFIconsResult* result);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
#include "detection/gtk_qt/gtk_qt.h"
|
||||
#include "detection/displayserver/displayserver.h"
|
||||
|
||||
const char* ffDetectIcons(FFstrbuf* result)
|
||||
const char* ffDetectIcons(FFIconsResult* result)
|
||||
{
|
||||
const FFDisplayServerResult* wmde = ffConnectDisplayServer();
|
||||
|
||||
@@ -18,18 +18,13 @@ const char* ffDetectIcons(FFstrbuf* result)
|
||||
if(plasma->length == 0 && gtk2->length == 0 && gtk3->length == 0 && gtk4->length == 0)
|
||||
return "No icons could be found";
|
||||
|
||||
FF_STRBUF_AUTO_DESTROY gtkPretty = ffStrbufCreate();
|
||||
ffParseGTK(>kPretty, gtk2, gtk3, gtk4);
|
||||
ffParseGTK(&result->icons2, gtk2, gtk3, gtk4);
|
||||
|
||||
if(plasma->length > 0)
|
||||
{
|
||||
ffStrbufAppend(result, plasma);
|
||||
ffStrbufAppendS(result, " [QT]");
|
||||
|
||||
if(gtkPretty.length > 0)
|
||||
ffStrbufAppendS(result, ", ");
|
||||
ffStrbufAppend(&result->icons1, plasma);
|
||||
ffStrbufAppendS(&result->icons1, " [QT]");
|
||||
}
|
||||
ffStrbufAppend(result, >kPretty);
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
#include "icons.h"
|
||||
|
||||
const char* ffDetectIcons(FF_MAYBE_UNUSED FFstrbuf* result)
|
||||
const char* ffDetectIcons(FF_MAYBE_UNUSED FFIconsResult* result)
|
||||
{
|
||||
return "Not supported on this platform";
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#include "icons.h"
|
||||
#include "util/windows/registry.h"
|
||||
|
||||
const char* ffDetectIcons(FFstrbuf* result)
|
||||
const char* ffDetectIcons(FFIconsResult* result)
|
||||
{
|
||||
FF_HKEY_AUTO_DESTROY hKey = NULL;
|
||||
if(!ffRegOpenKeyForRead(HKEY_CURRENT_USER, L"Software\\Microsoft\\Windows\\CurrentVersion\\Explorer\\HideDesktopIcons\\NewStartPanel", &hKey, NULL) &&
|
||||
@@ -17,18 +17,20 @@ const char* ffDetectIcons(FFstrbuf* result)
|
||||
ffRegReadUint(hKey, L"{5399E694-6CE5-4D6C-8FCE-1D8870FDCBA0}", &ControlPanel, NULL);
|
||||
|
||||
if (!ThisPC)
|
||||
ffStrbufAppendS(result, "This PC, ");
|
||||
ffStrbufAppendS(&result->icons1, "This PC, ");
|
||||
if (!UsersFiles)
|
||||
ffStrbufAppendS(result, "User's Files, ");
|
||||
if (!RemoteNetwork)
|
||||
ffStrbufAppendS(result, "Remote Network, ");
|
||||
if (!RecycleBin)
|
||||
ffStrbufAppendS(result, "Recycle Bin, ");
|
||||
if (!ControlPanel)
|
||||
ffStrbufAppendS(result, "Control Panel");
|
||||
ffStrbufAppendS(&result->icons1, "User's Files");
|
||||
ffStrbufTrimRight(&result->icons1, ' ');
|
||||
ffStrbufTrimRight(&result->icons1, ',');
|
||||
|
||||
ffStrbufTrimRight(result, ' ');
|
||||
ffStrbufTrimRight(result, ',');
|
||||
if (!RemoteNetwork)
|
||||
ffStrbufAppendS(&result->icons2, "Remote Network, ");
|
||||
if (!RecycleBin)
|
||||
ffStrbufAppendS(&result->icons2, "Recycle Bin, ");
|
||||
if (!ControlPanel)
|
||||
ffStrbufAppendS(&result->icons2, "Control Panel");
|
||||
ffStrbufTrimRight(&result->icons2, ' ');
|
||||
ffStrbufTrimRight(&result->icons2, ',');
|
||||
|
||||
return NULL;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user