mirror of
https://github.com/CloverHackyColor/CloverBootloader.git
synced 2024-11-10 09:40:53 +01:00
Revert commit a9cb69 : remove workaround and fix operator = in XIcon.
This commit is contained in:
parent
1af86d0e9c
commit
82ba60a90a
@ -99,7 +99,10 @@ ImageNight.FromPNG(ACCESS_EMB_DATA(dark), ACCESS_EMB_SIZE(dark)); \
|
||||
}
|
||||
|
||||
|
||||
XIcon::~XIcon() {}
|
||||
XIcon::~XIcon()
|
||||
{
|
||||
// memory leak : we can't free (yet?) ImageSVG and ImageSVGnight because operator might have copied it
|
||||
}
|
||||
|
||||
XIcon::XIcon(INTN Index, bool TakeEmbedded) : Id(Index), Name(), Image(), ImageNight(), Native(false),
|
||||
ImageSVG(nullptr), ImageSVGnight(nullptr), Empty(0)
|
||||
@ -121,16 +124,13 @@ XIcon& XIcon::operator=(const XIcon& src)
|
||||
{
|
||||
Id = src.Id;
|
||||
Name = src.Name;
|
||||
if (!src.isEmpty()) {
|
||||
Image = src.Image;
|
||||
if (!src.ImageNight.isEmpty()) {
|
||||
ImageNight = src.ImageNight;
|
||||
}
|
||||
setFilled();
|
||||
//this moment we copy pointers. Later it will be class variables
|
||||
ImageSVG = src.ImageSVG;
|
||||
ImageSVGnight = src.ImageSVGnight;
|
||||
}
|
||||
Image = src.Image;
|
||||
ImageNight = src.ImageNight;
|
||||
Native = src.Native;
|
||||
Empty = src.Empty;
|
||||
//this moment we copy pointers. Later it will be class variables
|
||||
ImageSVG = src.ImageSVG;
|
||||
ImageSVGnight = src.ImageSVGnight;
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
@ -3179,7 +3179,7 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
#endif // ENABLE_SECURE_BOOT
|
||||
}
|
||||
}
|
||||
MenuEntryOptions.Image.ImageNight.setEmpty();
|
||||
|
||||
MenuEntryOptions.Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_OPTIONS);
|
||||
// DBG("Options: IconID=%lld name=%s empty=%s\n", MenuEntryOptions.Image.Id, MenuEntryOptions.Image.Name.c_str(),
|
||||
// MenuEntryOptions.Image.isEmpty()?"пусто":"нет");
|
||||
@ -3187,7 +3187,6 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
MenuEntryOptions.ShortcutLetter = 0x00;
|
||||
MainMenu.AddMenuEntry(&MenuEntryOptions, false);
|
||||
|
||||
MenuEntryAbout.Image.ImageNight.setEmpty();
|
||||
MenuEntryAbout.Image = ThemeX.GetIcon((INTN)BUILTIN_ICON_FUNC_ABOUT);
|
||||
// DBG("About: IconID=%lld name=%s empty=%s\n", MenuEntryAbout.Image.Id, MenuEntryAbout.Image.Name.c_str(),
|
||||
// MenuEntryAbout.Image.isEmpty()?"пусто":"нет");
|
||||
@ -3198,12 +3197,10 @@ RefitMain (IN EFI_HANDLE ImageHandle,
|
||||
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_FUNCS) || MainMenu.Entries.size() == 0) {
|
||||
if (gSettings.Boot.DisableCloverHotkeys)
|
||||
MenuEntryReset.ShortcutLetter = 0x00;
|
||||
MenuEntryReset.Image.ImageNight.setEmpty();
|
||||
MenuEntryReset.Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_RESET);
|
||||
MainMenu.AddMenuEntry(&MenuEntryReset, false);
|
||||
if (gSettings.Boot.DisableCloverHotkeys)
|
||||
MenuEntryShutdown.ShortcutLetter = 0x00;
|
||||
MenuEntryShutdown.Image.ImageNight.setEmpty();
|
||||
MenuEntryShutdown.Image = ThemeX.GetIcon(BUILTIN_ICON_FUNC_EXIT);
|
||||
MainMenu.AddMenuEntry(&MenuEntryShutdown, false);
|
||||
}
|
||||
|
@ -1080,7 +1080,6 @@ void AboutRefit(void)
|
||||
if (AboutMenu.Entries.size() == 0) {
|
||||
AboutMenu.Daylight = ThemeX.Daylight;
|
||||
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) {
|
||||
AboutMenu.TitleImage.ImageNight.setEmpty();
|
||||
AboutMenu.TitleImage = ThemeX.GetIcon(BUILTIN_ICON_FUNC_ABOUT);
|
||||
}
|
||||
// else {
|
||||
@ -1139,7 +1138,6 @@ void HelpRefit(void)
|
||||
if (HelpMenu.Entries.size() == 0) {
|
||||
HelpMenu.Daylight = ThemeX.Daylight;
|
||||
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) {
|
||||
HelpMenu.TitleImage.ImageNight.setEmpty();
|
||||
HelpMenu.TitleImage = ThemeX.GetIcon(BUILTIN_ICON_FUNC_HELP);
|
||||
}
|
||||
//else {
|
||||
@ -2604,7 +2602,6 @@ void OptionsMenu(OUT REFIT_ABSTRACT_MENU_ENTRY **ChosenEntry)
|
||||
if (OptionMenu.Entries.size() == 0) {
|
||||
OptionMenu.Daylight = ThemeX.Daylight;
|
||||
if (!(ThemeX.HideUIFlags & HIDEUI_FLAG_MENU_TITLE_IMAGE)) {
|
||||
OptionMenu.TitleImage.ImageNight.setEmpty();
|
||||
OptionMenu.TitleImage = ThemeX.GetIcon(BUILTIN_ICON_FUNC_OPTIONS);
|
||||
}
|
||||
gThemeOptionsChanged = TRUE;
|
||||
|
Loading…
Reference in New Issue
Block a user