Added: transparent, currentcolor values for background-color
--HG-- branch : develop
This commit is contained in:
parent
aede4dbab7
commit
9587e9bcef
1 changed files with 21 additions and 6 deletions
|
@ -95,8 +95,21 @@ namespace NLGUI
|
||||||
TStyle::iterator it;
|
TStyle::iterator it;
|
||||||
|
|
||||||
// first pass: get font-size for 'em' sizes
|
// first pass: get font-size for 'em' sizes
|
||||||
|
// get TextColor value used as 'currentcolor'
|
||||||
for (it=styles.begin(); it != styles.end(); ++it)
|
for (it=styles.begin(); it != styles.end(); ++it)
|
||||||
{
|
{
|
||||||
|
if (it->first == "color")
|
||||||
|
{
|
||||||
|
if (it->second == "inherit")
|
||||||
|
{
|
||||||
|
style.TextColor = current.TextColor;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
scanHTMLColor(it->second.c_str(), style.TextColor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else
|
||||||
if (it->first == "font")
|
if (it->first == "font")
|
||||||
{
|
{
|
||||||
if (it->second == "inherit")
|
if (it->second == "inherit")
|
||||||
|
@ -237,12 +250,6 @@ namespace NLGUI
|
||||||
style.FontWeight = weight;
|
style.FontWeight = weight;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
if (it->first == "color")
|
|
||||||
if (it->second == "inherit")
|
|
||||||
style.TextColor = current.TextColor;
|
|
||||||
else
|
|
||||||
scanHTMLColor(it->second.c_str(), style.TextColor);
|
|
||||||
else
|
|
||||||
if (it->first == "text-decoration" || it->first == "text-decoration-line")
|
if (it->first == "text-decoration" || it->first == "text-decoration-line")
|
||||||
{
|
{
|
||||||
std::string prop(toLower(it->second));
|
std::string prop(toLower(it->second));
|
||||||
|
@ -437,6 +444,10 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
if (it->second == "inherit")
|
if (it->second == "inherit")
|
||||||
style.BackgroundColor = current.BackgroundColor;
|
style.BackgroundColor = current.BackgroundColor;
|
||||||
|
else if (it->second == "transparent")
|
||||||
|
style.BackgroundColor = CRGBA(0, 0, 0, 0);
|
||||||
|
else if (it->second == "currentcolor")
|
||||||
|
style.BackgroundColorOver = style.TextColor;
|
||||||
else
|
else
|
||||||
scanHTMLColor(it->second.c_str(), style.BackgroundColor);
|
scanHTMLColor(it->second.c_str(), style.BackgroundColor);
|
||||||
}
|
}
|
||||||
|
@ -445,6 +456,10 @@ namespace NLGUI
|
||||||
{
|
{
|
||||||
if (it->second == "inherit")
|
if (it->second == "inherit")
|
||||||
style.BackgroundColorOver = current.BackgroundColorOver;
|
style.BackgroundColorOver = current.BackgroundColorOver;
|
||||||
|
else if (it->second == "transparent")
|
||||||
|
style.BackgroundColorOver = CRGBA(0, 0, 0, 0);
|
||||||
|
else if (it->second == "currentcolor")
|
||||||
|
style.BackgroundColorOver = style.TextColor;
|
||||||
else
|
else
|
||||||
scanHTMLColor(it->second.c_str(), style.BackgroundColorOver);
|
scanHTMLColor(it->second.c_str(), style.BackgroundColorOver);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue