mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-10 09:40:53 +01:00
get preloaded linux icons for the case of svg theme
Signed-off-by: SergeySlice <sergey.slice@gmail.com>
This commit is contained in:
parent
e26fe8ba0c
commit
0ecb066a4b
@ -2459,7 +2459,7 @@ EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT)
|
||||
if (Rsdt != NULL && Rsdt->Header.Signature != EFI_ACPI_2_0_ROOT_SYSTEM_DESCRIPTION_TABLE_SIGNATURE) {
|
||||
Rsdt = NULL;
|
||||
}
|
||||
DBG("RSDT at %p\n", Rsdt);
|
||||
DBG("RSDT at 0x%llX\n", (UINTN)Rsdt);
|
||||
|
||||
// check for XSDT
|
||||
Xsdt = NULL;
|
||||
@ -2469,7 +2469,7 @@ EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT)
|
||||
Xsdt = NULL;
|
||||
}
|
||||
}
|
||||
DBG("XSDT at %p\n", Xsdt);
|
||||
DBG("XSDT at 0x%llX\n", (UINTN)Xsdt);
|
||||
|
||||
// if RSDT and XSDT not found - quit
|
||||
if (Rsdt == NULL && Xsdt == NULL) {
|
||||
@ -2485,7 +2485,7 @@ EFI_STATUS PatchACPI_OtherOS(CONST CHAR16* OsSubdir, BOOLEAN DropSSDT)
|
||||
} else if (Rsdt) {
|
||||
FadtPointer = (EFI_ACPI_2_0_FIXED_ACPI_DESCRIPTION_TABLE*)(UINTN)(Rsdt->Entry);
|
||||
}
|
||||
DBG("FADT pointer = %p\n", FadtPointer);
|
||||
DBG("FADT pointer = 0x%llX\n", (UINTN)FadtPointer);
|
||||
|
||||
// if not found - quit
|
||||
if(FadtPointer == NULL) {
|
||||
|
@ -456,7 +456,7 @@ STATIC LOADER_ENTRY *CreateLoaderEntry(IN CONST XStringW& LoaderPath,
|
||||
IN KERNEL_AND_KEXT_PATCHES *Patches,
|
||||
IN BOOLEAN CustomEntry)
|
||||
{
|
||||
EFI_DEVICE_PATH *LoaderDevicePath;
|
||||
EFI_DEVICE_PATH *LoaderDevicePath;
|
||||
CONST CHAR16 *LoaderDevicePathString;
|
||||
CONST CHAR16 *FilePathAsString;
|
||||
// CONST CHAR16 *OSIconName = NULL;
|
||||
@ -1310,8 +1310,12 @@ VOID ScanLoader(VOID)
|
||||
LoaderTitle.upperAscii();
|
||||
LoaderTitle += OSName.subString(1, OSName.length()) + L" Linux"_XSW;
|
||||
XImage ImageX; //will the image be destroyed or rewritten by next image after the cycle end?
|
||||
// load from directory, as we don't have linux icons preloaded
|
||||
ImageX.LoadXImage(ThemeX.ThemeDir, (L"os_"_XSW + OSName).wc_str());
|
||||
// load from directory, as we don't have linux icons preloaded. -- why not?
|
||||
if (ThemeX.TypeSVG) {
|
||||
ImageX = ThemeX.LoadOSIcon(OSName + ",linux"_XS);
|
||||
} else {
|
||||
ImageX.LoadXImage(ThemeX.ThemeDir, (L"os_"_XSW + OSName).wc_str());
|
||||
}
|
||||
AddLoaderEntry(File, NullXStringArray, LoaderTitle, Volume,
|
||||
(ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LINEFI, OSFLAG_NODEFAULTARGS);
|
||||
} //anyway continue search other entries
|
||||
|
@ -397,11 +397,11 @@ const XImage& XTheme::LoadOSIcon(const XString& Full)
|
||||
const XImage *ReturnImage;
|
||||
UINTN Comma = Full.indexOf(',');
|
||||
UINTN Size = Full.length();
|
||||
// DBG("IconName=%ls comma=%lld size=%lld\n", OSIconName, Comma, Size);
|
||||
DBG("IconName=%s comma=%lld size=%lld\n", Full.c_str(), Comma, Size);
|
||||
if (Comma != MAX_XSIZE) { //Comma
|
||||
First = "os_"_XS + Full.subString(0, Comma);
|
||||
ReturnImage = &GetIcon(First);
|
||||
// DBG(" first=%s\n", First.c_str());
|
||||
DBG(" first=%s\n", First.c_str());
|
||||
if (!ReturnImage->isEmpty()) return *ReturnImage;
|
||||
//else search second name
|
||||
Second = "os_"_XS + Full.subString(Comma + 1, Size - Comma - 1);
|
||||
@ -418,11 +418,11 @@ const XImage& XTheme::LoadOSIcon(const XString& Full)
|
||||
ReturnImage = &GetIcon(Third);
|
||||
if (!ReturnImage->isEmpty()) return *ReturnImage;
|
||||
}
|
||||
// DBG(" Second=%s\n", Second.c_str());
|
||||
DBG(" Second=%s\n", Second.c_str());
|
||||
if (!ReturnImage->isEmpty()) return *ReturnImage;
|
||||
} else {
|
||||
ReturnImage = &GetIcon("os_"_XS + Full);
|
||||
// DBG(" Full=%s\n", Full.c_str());
|
||||
DBG(" Full=%s\n", Full.c_str());
|
||||
if (!ReturnImage->isEmpty()) return *ReturnImage;
|
||||
}
|
||||
// else something
|
||||
|
Loading…
Reference in New Issue
Block a user