More corrections to Custom Entries

This commit is contained in:
asava 2020-04-13 01:28:01 +03:00
parent 4bed728157
commit 5eadae5eb8
2 changed files with 19 additions and 2 deletions

View File

@ -1850,7 +1850,14 @@ FillinCustomEntry (
FreePool (Entry->ImagePath);
Entry->ImagePath = NULL;
}
Entry->Image.LoadXImage(ThemeX.ThemeDir, Prop->string);
if (!Entry->Image.isEmpty()) {
XImage EmptyImage;
Entry->Image = EmptyImage;
}
if (Prop->type == kTagTypeString) {
Entry->ImagePath = PoolPrint (L"%a", Prop->string);
}
// we can't load the file yet, as ThemeDir is not initialized
} else {
UINTN DataLen = 0;
UINT8 *TmpData = GetDataSetting (DictPointer, "ImageData", &DataLen);
@ -1866,7 +1873,14 @@ FillinCustomEntry (
FreePool (Entry->DriveImagePath);
Entry->DriveImagePath = NULL;
}
Entry->DriveImage.LoadXImage(ThemeX.ThemeDir, Prop->string);
if (!Entry->DriveImage.isEmpty()) {
XImage EmptyImage;
Entry->DriveImage = EmptyImage;
}
if (Prop->type == kTagTypeString) {
Entry->DriveImagePath = PoolPrint (L"%a", Prop->string);
}
// we can't load the file yet, as ThemeDir is not initialized
} else {
UINTN DataLen = 0;
UINT8 *TmpData = GetDataSetting (DictPointer, "ImageData", &DataLen);

View File

@ -1782,6 +1782,9 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
Image = Custom->Image;
if (Image.isEmpty() && Custom->ImagePath) {
Image.LoadXImage(ThemeX.ThemeDir, Custom->ImagePath);
if (Image.isEmpty()) {
Image.LoadXImage(ThemeX.ThemeDir, XStringW() + L"os_"_XSW + Custom->ImagePath);
}
}
// Change to custom drive image if needed