Fixed: Use empty placeholder for background images.

--HG--
branch : html-improvements
hg/feature/html-improvements
Nimetu 5 years ago
parent 26e356723e
commit 30e0018d0a

@ -124,7 +124,7 @@ namespace NLGUI
void endParagraph();
// add image download (used by view_bitmap.cpp to load web images)
void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage);
void addImageDownload(const std::string &url, CViewBase *img, const CStyleParams &style = CStyleParams(), const TImageType type = NormalImage, const std::string &placeholder = "web_del.tga");
// remove image from download list if present
void removeImageDownload(CViewBase *img);
std::string localImageName(const std::string &url);

@ -706,7 +706,7 @@ namespace NLGUI
}
// Add a image download request in the multi_curl
void CGroupHTML::addImageDownload(const string &url, CViewBase *img, const CStyleParams &style, TImageType type)
void CGroupHTML::addImageDownload(const string &url, CViewBase *img, const CStyleParams &style, TImageType type, const std::string &placeholder)
{
std::string finalUrl;
img->setModulateGlobalColor(style.GlobalColor);
@ -732,8 +732,7 @@ namespace NLGUI
std::string temp = dest;
if (!CFile::fileExists(temp))
{
// TODO: placeholder
temp = "web_del.tga";
temp = placeholder;
}
setImage(img, temp, type);
setImageSize(img, style);
@ -3483,7 +3482,7 @@ namespace NLGUI
else
bitmap->setSizeRef("");
addImageDownload(bgtex, view);
addImageDownload(bgtex, view, CStyleParams(), TImageType::NormalImage, "");
}
}
}
@ -6590,7 +6589,7 @@ namespace NLGUI
table->setTextureScale(true);
string image = _Style.getStyle("background-image");
addImageDownload(image, table);
addImageDownload(image, table, CStyleParams(), TImageType::NormalImage, "");
}
table->setMarginLeft(getIndent());
@ -6664,7 +6663,7 @@ namespace NLGUI
if (_Style.hasStyle("background-image"))
{
string image = _Style.getStyle("background-image");
addImageDownload(image, _Cells.back());
addImageDownload(image, _Cells.back(), CStyleParams(), TImageType::NormalImage, "");
}
if (elm.hasNonEmptyAttribute("colspan"))

Loading…
Cancel
Save