Add back full paths possibility to custom entries

This commit is contained in:
asava 2020-04-13 14:13:37 +03:00
parent d76962691b
commit 31079aea32
2 changed files with 20 additions and 4 deletions

View File

@ -1851,8 +1851,7 @@ FillinCustomEntry (
Entry->ImagePath = NULL;
}
if (!Entry->Image.isEmpty()) {
XImage EmptyImage;
Entry->Image = EmptyImage;
Entry->Image.setEmpty();
}
if (Prop->type == kTagTypeString) {
Entry->ImagePath = PoolPrint (L"%a", Prop->string);
@ -1874,8 +1873,7 @@ FillinCustomEntry (
Entry->DriveImagePath = NULL;
}
if (!Entry->DriveImage.isEmpty()) {
XImage EmptyImage;
Entry->DriveImage = EmptyImage;
Entry->DriveImage.setEmpty();
}
if (Prop->type == kTagTypeString) {
Entry->DriveImagePath = PoolPrint (L"%a", Prop->string);

View File

@ -1784,6 +1784,15 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
Image.LoadXImage(ThemeX.ThemeDir, Custom->ImagePath);
if (Image.isEmpty()) {
Image.LoadXImage(ThemeX.ThemeDir, XStringW() + L"os_"_XSW + Custom->ImagePath);
if (Image.isEmpty()) {
Image.LoadXImage(SelfDir, Custom->ImagePath);
if (Image.isEmpty()) {
Image.LoadXImage(SelfRootDir, Custom->ImagePath);
if (Image.isEmpty()) {
Image.LoadXImage(Volume->RootDir, Custom->ImagePath);
}
}
}
}
}
@ -1791,6 +1800,15 @@ STATIC VOID AddCustomEntry(IN UINTN CustomIndex,
DriveImage = Custom->DriveImage;
if (DriveImage.isEmpty() && Custom->DriveImagePath) {
DriveImage.LoadXImage(ThemeX.ThemeDir, Custom->DriveImagePath);
if (DriveImage.isEmpty()) {
DriveImage.LoadXImage(SelfDir, Custom->ImagePath);
if (DriveImage.isEmpty()) {
DriveImage.LoadXImage(SelfRootDir, Custom->ImagePath);
if (DriveImage.isEmpty()) {
DriveImage.LoadXImage(Volume->RootDir, Custom->ImagePath);
}
}
}
}
do