allow triple os name like chrome,grub,linux

Signed-off-by: Sergey Isakov <isakov-sl@bk.ru>
This commit is contained in:
Sergey Isakov 2020-04-09 06:32:57 +03:00
parent ea3058f867
commit 13588fb67c
4 changed files with 17 additions and 3 deletions

View File

@ -2138,7 +2138,7 @@ if ((Image == NULL) && Custom->ImagePath) {
if (Guid) {
SubScreen->AddMenuInfoLine_f("UUID: %s", strguid(Guid));
}
SubScreen->AddMenuInfoLine_f("Options: %s", Entry->LoadOptions.c_str());
SubScreen->AddMenuInfoLine_f("Options: %s", Entry->LoadOptions.c_str());
DBG("Create sub entries\n");
for (CustomSubEntry = Custom->SubEntries; CustomSubEntry; CustomSubEntry = CustomSubEntry->Next) {
if (!CustomSubEntry->Settings) {

View File

@ -100,6 +100,7 @@ public:
UINTN FrameTime; //ms
EG_RECT FilmPlace;
EG_IMAGE **Film;
ACTION mAction;
UINTN mItemID;
SCROLL_STATE ScrollState;

View File

@ -368,6 +368,7 @@ const XImage& XTheme::LoadOSIcon(const XString& Full)
// input value can be L"win", L"ubuntu,linux", L"moja,mac" set by GetOSIconName (OSVersion)
XString First;
XString Second;
XString Third;
const XImage *ReturnImage;
UINTN Comma = Full.IdxOf(',');
UINTN Size = Full.size();
@ -379,7 +380,19 @@ const XImage& XTheme::LoadOSIcon(const XString& Full)
if (!ReturnImage->isEmpty()) return *ReturnImage;
//else search second name
Second = "os_"_XS + Full.SubString(Comma+1, Size - Comma - 1);
ReturnImage = &GetIcon(Second);
//moreover names can be triple L"chrome,grub,linux"
UINTN SecondComma = Second.IdxOf(',');
if (Comma == MAX_XSIZE) {
ReturnImage = &GetIcon(Second);
if (!ReturnImage->isEmpty()) return *ReturnImage;
} else {
First = Second.SubString(0, SecondComma);
ReturnImage = &GetIcon(First);
if (!ReturnImage->isEmpty()) return *ReturnImage;
Third = "os_"_XS + Second.SubString(SecondComma + 1, Size - SecondComma - 1);
ReturnImage = &GetIcon(Third);
if (!ReturnImage->isEmpty()) return *ReturnImage;
}
// DBG(" Second=%s\n", Second.c_str());
if (!ReturnImage->isEmpty()) return *ReturnImage;
} else {

View File

@ -1041,7 +1041,7 @@ VOID REFIT_MENU_SCREEN::InitAnime()
p = LoadSvgFrame(i);
// DBG("frame %d loaded\n", i);
} else {
snwprintf(FileName, 512, "%ls\\%ls_%03llu.png", Path, Path, i);
snwprintf(FileName, 512, "%ls\\%ls_%03llu.png", Path, Path, i);
p = egLoadImage(ThemeX.ThemeDir, FileName, TRUE);
}
if (!p) {