Merge remote-tracking branch 'ryzomcore/develop' into core4

merge/2021-11-19
kaetemi 3 years ago
commit 1c035401c6
No known key found for this signature in database
GPG Key ID: 9873C4D40BB479BC

@ -63,6 +63,7 @@ namespace NLGUI
Underlined=false; Underlined=false;
StrikeThrough=false; StrikeThrough=false;
GlobalColor=false; GlobalColor=false;
GlobalColorText=false;
DisplayBlock=false; DisplayBlock=false;
Width=-1; Width=-1;
Height=-1; Height=-1;
@ -93,6 +94,7 @@ namespace NLGUI
NLMISC::CRGBA TextColor; NLMISC::CRGBA TextColor;
STextShadow TextShadow; STextShadow TextShadow;
bool GlobalColor; bool GlobalColor;
bool GlobalColorText;
bool Underlined; bool Underlined;
bool StrikeThrough; bool StrikeThrough;
bool DisplayBlock; bool DisplayBlock;
@ -215,6 +217,7 @@ namespace NLGUI
_StyleStack.push_back(Current); _StyleStack.push_back(Current);
Current.GlobalColor = false; Current.GlobalColor = false;
// inherit GlobalColorText
Current.DisplayBlock = false; Current.DisplayBlock = false;
Current.Width=-1; Current.Width=-1;
Current.Height=-1; Current.Height=-1;

@ -936,6 +936,16 @@ namespace NLGUI
style.GlobalColor = b; style.GlobalColor = b;
} }
else else
if (it->first == "-ryzom-modulate-text-color")
{
bool b;
if (it->second == "inherit")
style.GlobalColorText = current.GlobalColorText;
else
if (fromString(it->second, b))
style.GlobalColorText = b;
}
else
if (it->first == "background-color") if (it->first == "background-color")
{ {
if (it->second == "inherit") if (it->second == "inherit")

@ -350,7 +350,7 @@ namespace NLGUI
void CGroupHTML::TextureDownloadCB::finish() void CGroupHTML::TextureDownloadCB::finish()
{ {
// tmpdest file does not exist if download skipped (ie cache was used) // tmpdest file does not exist if download skipped (ie cache was used)
if (CFile::fileExists(tmpdest) && CFile::getFileSize(tmpdest) == 0) if (CFile::fileExists(tmpdest) && CFile::getFileSize(tmpdest) > 0)
{ {
if (CFile::fileExists(dest)) if (CFile::fileExists(dest))
CFile::deleteFile(dest); CFile::deleteFile(dest);
@ -2554,7 +2554,7 @@ namespace NLGUI
(embolden == text->getEmbolden()) && (embolden == text->getEmbolden()) &&
(style.FontOblique == text->getOblique()) && (style.FontOblique == text->getOblique()) &&
(getLink() == text->Link) && (getLink() == text->Link) &&
(style.GlobalColor == text->getModulateGlobalColor()); (style.GlobalColorText == text->getModulateGlobalColor());
} }
// *************************************************************************** // ***************************************************************************
@ -2591,7 +2591,10 @@ namespace NLGUI
nlinfo("Text button template '%s' is missing :button or :b text element", tpl.c_str()); nlinfo("Text button template '%s' is missing :button or :b text element", tpl.c_str());
return; return;
} }
ctrlButton->setModulateGlobalColorAll(false); ctrlButton->setModulateGlobalColorAll(_Style.Current.GlobalColor);
ctrlButton->setTextModulateGlobalColorNormal(_Style.Current.GlobalColorText);
ctrlButton->setTextModulateGlobalColorOver(_Style.Current.GlobalColorText);
ctrlButton->setTextModulateGlobalColorPushed(_Style.Current.GlobalColorText);
// Translate the tooltip // Translate the tooltip
ctrlButton->setText(text); ctrlButton->setText(text);
@ -2622,7 +2625,7 @@ namespace NLGUI
newLink->setText(text); newLink->setText(text);
newLink->setMultiLineSpace((uint)((float)(_Style.Current.FontSize)*LineSpaceFontFactor)); newLink->setMultiLineSpace((uint)((float)(_Style.Current.FontSize)*LineSpaceFontFactor));
newLink->setMultiLine(true); newLink->setMultiLine(true);
newLink->setModulateGlobalColor(_Style.Current.GlobalColor); newLink->setModulateGlobalColor(_Style.Current.GlobalColorText);
setTextStyle(newLink, _Style.Current); setTextStyle(newLink, _Style.Current);
registerAnchor(newLink); registerAnchor(newLink);
@ -4130,6 +4133,22 @@ namespace NLGUI
void CGroupHTML::draw () void CGroupHTML::draw ()
{ {
uint8 CurrentAlpha = 255;
// search a parent container
CInterfaceGroup *gr = getParent();
while (gr)
{
if (gr->isGroupContainer())
{
CGroupContainer *gc = static_cast<CGroupContainer *>(gr);
CurrentAlpha = gc->getCurrentContainerAlpha();
break;
}
gr = gr->getParent();
}
m_HtmlBackground.CurrentAlpha = CurrentAlpha;
m_BodyBackground.CurrentAlpha = CurrentAlpha;
m_HtmlBackground.draw(); m_HtmlBackground.draw();
m_BodyBackground.draw(); m_BodyBackground.draw();
CGroupScrollText::draw (); CGroupScrollText::draw ();
@ -5260,6 +5279,9 @@ namespace NLGUI
if (ctrlButton) if (ctrlButton)
{ {
ctrlButton->setModulateGlobalColorAll (_Style.Current.GlobalColor); ctrlButton->setModulateGlobalColorAll (_Style.Current.GlobalColor);
ctrlButton->setTextModulateGlobalColorNormal(_Style.Current.GlobalColorText);
ctrlButton->setTextModulateGlobalColorOver(_Style.Current.GlobalColorText);
ctrlButton->setTextModulateGlobalColorPushed(_Style.Current.GlobalColorText);
// Translate the tooltip // Translate the tooltip
if (!tooltip.empty()) if (!tooltip.empty())

Loading…
Cancel
Save