mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-12-25 16:37:42 +01:00
Make LinuxScan use LoadOSIcon
This commit is contained in:
parent
0ecb066a4b
commit
4f5133deeb
@ -1296,7 +1296,7 @@ VOID ScanLoader(VOID)
|
|||||||
}
|
}
|
||||||
XStringW File = SWPrintf("EFI\\%ls\\grubx64.efi", DirEntry->FileName);
|
XStringW File = SWPrintf("EFI\\%ls\\grubx64.efi", DirEntry->FileName);
|
||||||
XStringW OSName = SPrintf("%ls", DirEntry->FileName); // this is folder name, for example "ubuntu"
|
XStringW OSName = SPrintf("%ls", DirEntry->FileName); // this is folder name, for example "ubuntu"
|
||||||
OSName.lowerAscii(); // lowercase for icon name
|
OSName.lowerAscii(); // lowercase for icon name and title (first letter in title will be capitalized later)
|
||||||
if (FileExists(Volume->RootDir, File)) {
|
if (FileExists(Volume->RootDir, File)) {
|
||||||
// check if nonstandard icon mapping is needed
|
// check if nonstandard icon mapping is needed
|
||||||
for (Index = 0; Index < LinuxIconMappingCount; ++Index) {
|
for (Index = 0; Index < LinuxIconMappingCount; ++Index) {
|
||||||
@ -1305,17 +1305,14 @@ VOID ScanLoader(VOID)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
DBG(" found entry %ls,linux\n", OSName.wc_str());
|
XStringW OSIconName = OSName + L",linux"_XSW;
|
||||||
|
DBG(" found entry %ls\n", OSIconName.wc_str());
|
||||||
XStringW LoaderTitle = OSName.subString(0,1); // capitalize first letter for title
|
XStringW LoaderTitle = OSName.subString(0,1); // capitalize first letter for title
|
||||||
LoaderTitle.upperAscii();
|
LoaderTitle.upperAscii();
|
||||||
LoaderTitle += OSName.subString(1, OSName.length()) + L" Linux"_XSW;
|
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?
|
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. -- why not?
|
// load from directory, as we don't have linux icons preloaded
|
||||||
if (ThemeX.TypeSVG) {
|
ImageX = ThemeX.LoadOSIcon(OSIconName);
|
||||||
ImageX = ThemeX.LoadOSIcon(OSName + ",linux"_XS);
|
|
||||||
} else {
|
|
||||||
ImageX.LoadXImage(ThemeX.ThemeDir, (L"os_"_XSW + OSName).wc_str());
|
|
||||||
}
|
|
||||||
AddLoaderEntry(File, NullXStringArray, LoaderTitle, Volume,
|
AddLoaderEntry(File, NullXStringArray, LoaderTitle, Volume,
|
||||||
(ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LINEFI, OSFLAG_NODEFAULTARGS);
|
(ImageX.isEmpty() ? NULL : &ImageX), OSTYPE_LINEFI, OSFLAG_NODEFAULTARGS);
|
||||||
} //anyway continue search other entries
|
} //anyway continue search other entries
|
||||||
|
Loading…
Reference in New Issue
Block a user