Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

CGUILabel: introduce <invalidcolor> support

  • Loading branch information...
commit 745b57883d44d1ccd45ed1394d3be932e529e129 1 parent c53b46d
Sascha Montellese Montellese authored
2  xbmc/guilib/GUIButtonControl.h
View
@@ -86,7 +86,7 @@ class CGUIButtonControl : public CGUIControl
void OnUnFocus();
virtual void ProcessText(unsigned int currentTime);
virtual void RenderText();
- CGUILabel::COLOR GetTextColor() const;
+ virtual CGUILabel::COLOR GetTextColor() const;
CGUITexture m_imgFocus;
CGUITexture m_imgNoFocus;
1  xbmc/guilib/GUIControlFactory.cpp
View
@@ -757,6 +757,7 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl
GetInfoColor(pControlNode, "disabledcolor", labelInfo.disabledColor, parentID);
GetInfoColor(pControlNode, "shadowcolor", labelInfo.shadowColor, parentID);
GetInfoColor(pControlNode, "selectedcolor", labelInfo.selectedColor, parentID);
+ GetInfoColor(pControlNode, "invalidcolor", labelInfo.invalidColor, parentID);
XMLUtils::GetFloat(pControlNode, "textoffsetx", labelInfo.offsetX);
XMLUtils::GetFloat(pControlNode, "textoffsety", labelInfo.offsetY);
int angle = 0; // use the negative angle to compensate for our vertically flipped cartesian plane
9 xbmc/guilib/GUIEditControl.cpp
View
@@ -476,6 +476,15 @@ void CGUIEditControl::RenderText()
}
}
+CGUILabel::COLOR CGUIEditControl::GetTextColor() const
+{
+ CGUILabel::COLOR color = CGUIButtonControl::GetTextColor();
+ if (color != CGUILabel::COLOR_DISABLED && HasInvalidInput())
+ return CGUILabel::COLOR_INVALID;
+
+ return color;
+}
+
void CGUIEditControl::SetHint(const CGUIInfoLabel& hint)
{
m_hintInfo = hint;
1  xbmc/guilib/GUIEditControl.h
View
@@ -87,6 +87,7 @@ class CGUIEditControl : public CGUIButtonControl
protected:
virtual void ProcessText(unsigned int currentTime);
virtual void RenderText();
+ virtual CGUILabel::COLOR GetTextColor() const;
CStdStringW GetDisplayedText() const;
void RecalcLabelPosition();
void ValidateCursor();
2  xbmc/guilib/GUILabel.cpp
View
@@ -78,6 +78,8 @@ color_t CGUILabel::GetColor() const
return m_label.disabledColor;
case COLOR_FOCUSED:
return m_label.focusedColor ? m_label.focusedColor : m_label.textColor;
+ case COLOR_INVALID:
+ return m_label.invalidColor ? m_label.invalidColor : m_label.textColor;
default:
break;
}
5 xbmc/guilib/GUILabel.h
View
@@ -52,6 +52,7 @@ class CLabelInfo
changed |= selectedColor.Update();
changed |= disabledColor.Update();
changed |= focusedColor.Update();
+ changed |= invalidColor.Update();
return changed;
};
@@ -61,6 +62,7 @@ class CLabelInfo
CGUIInfoColor selectedColor;
CGUIInfoColor disabledColor;
CGUIInfoColor focusedColor;
+ CGUIInfoColor invalidColor;
uint32_t align;
float offsetX;
float offsetY;
@@ -83,7 +85,8 @@ class CGUILabel
enum COLOR { COLOR_TEXT = 0,
COLOR_SELECTED,
COLOR_FOCUSED,
- COLOR_DISABLED };
+ COLOR_DISABLED,
+ COLOR_INVALID };
/*! \brief allowed overflow handling techniques for labels, as defined by the skin
*/
Please sign in to comment.
Something went wrong with that request. Please try again.