Permalink
Browse files

Initial commit for mantis 0003808: Add textcolorNoFocus property to l…

…ist controls, thanks to ncoH for the patch

- http://forum.team-mediaportal.com/private.php?do=showpm&pmid=229044
  • Loading branch information...
1 parent b016657 commit 006665bdbe64ce8014b08ca3054e3ef0ef719e39 @SilentException SilentException committed Feb 6, 2012
View
4 mediaportal/Core/guilib/GUICheckListControl.cs
@@ -71,7 +71,7 @@ public class GUICheckListControl : GUIListControl
string strUp, string strDown,
string strUpFocus, string strDownFocus,
long dwSpinColor, int dwSpinX, int dwSpinY,
- string strFont, long dwTextColor, long dwSelectedColor,
+ string strFont, long dwTextColor, long dwTextColorNoFocus, long dwSelectedColor,
string strButton, string strButtonFocus,
string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom,
int dwShadowAngle, int dwShadowDistance, long dwShadowColor)
@@ -80,7 +80,7 @@ public class GUICheckListControl : GUIListControl
strUp, strDown,
strUpFocus, strDownFocus,
dwSpinColor, dwSpinX, dwSpinY,
- strFont, dwTextColor, dwSelectedColor,
+ strFont, dwTextColor, dwTextColorNoFocus, dwSelectedColor,
strButton, strButtonFocus,
strScrollbarBackground, strScrollbarTop, strScrollbarBottom,
dwShadowAngle, dwShadowDistance, dwShadowColor)
View
36 mediaportal/Core/guilib/GUIListControl.cs
@@ -108,6 +108,9 @@ public enum SearchType
[XMLSkinElement("textcolor")] protected long _textColor = 0xFFFFFFFF;
[XMLSkinElement("textcolor2")] protected long _textColor2 = 0xFFFFFFFF;
[XMLSkinElement("textcolor3")] protected long _textColor3 = 0xFFFFFFFF;
+ [XMLSkinElement("textcolorNoFocus")] protected long _textColorNoFocus = 0xFFFFFFFF;
+ [XMLSkinElement("textcolorNoFocus2")] protected long _textColorNoFocus2 = 0xFFFFFFFF;
+ [XMLSkinElement("textcolorNoFocus3")] protected long _textColorNoFocus3 = 0xFFFFFFFF;
[XMLSkinElement("selectedColor")] protected long _selectedColor = 0xFFFFFFFF;
[XMLSkinElement("selectedColor2")] protected long _selectedColor2 = 0xFFFFFFFF;
[XMLSkinElement("selectedColor3")] protected long _selectedColor3 = 0xFFFFFFFF;
@@ -260,7 +263,7 @@ public GUIListControl(int dwParentID)
string strUp, string strDown,
string strUpFocus, string strDownFocus,
long dwSpinColor, int dwSpinX, int dwSpinY,
- string strFont, long dwTextColor, long dwSelectedColor,
+ string strFont, long dwTextColor, long dwTextColorNoFocus, long dwSelectedColor,
string strButton, string strButtonFocus,
string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom,
int dwShadowAngle, int dwShadowDistance, long dwShadowColor)
@@ -282,6 +285,9 @@ public GUIListControl(int dwParentID)
_textColor = dwTextColor;
_textColor2 = dwTextColor;
_textColor3 = dwTextColor;
+ _textColorNoFocus = dwTextColorNoFocus;
+ _textColorNoFocus2 = dwTextColorNoFocus;
+ _textColorNoFocus3 = dwTextColorNoFocus;
_buttonNonFocusName = strButton;
_buttonFocusName = strButtonFocus;
_scrollbarBackgroundName = strScrollbarBackground;
@@ -685,6 +691,7 @@ protected virtual void RenderLabel(float timePassed, int buttonNr, int dwPosX, i
else
{
label2.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
+ label2.TextColor = _textColorNoFocus2;
}
label2.Label = pItem.Label2;
@@ -722,6 +729,7 @@ protected virtual void RenderLabel(float timePassed, int buttonNr, int dwPosX, i
if (!pItem.Selected && !gotFocus)
{
dwColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
+ dwColor &= _textColorNoFocus;
}
if (!Focus)
{
@@ -787,6 +795,7 @@ protected virtual void RenderLabel(float timePassed, int buttonNr, int dwPosX, i
else
{
label2.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
+ label2.TextColor &= _textColorNoFocus2;
}
label2.Label = _textLine;
label2.TextAlignment = Alignment.ALIGN_RIGHT;
@@ -860,6 +869,7 @@ protected virtual void RenderLabel(float timePassed, int buttonNr, int dwPosX, i
else
{
label3.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
+ label3.TextColor &= _textColorNoFocus3;
}
label3.Label = pItem.Label3;
if (!string.IsNullOrEmpty(_text3Content))
@@ -2976,6 +2986,30 @@ public long TextColor3
}
/// <summary>
+ /// Get the color of the first not focused label.
+ /// </summary>
+ public long TextColorNoFocus
+ {
+ get { return _textColorNoFocus; }
+ }
+
+ /// <summary>
+ /// Get the color of the second not focused label.
+ /// </summary>
+ public long TextColorNoFocus2
+ {
+ get { return _textColorNoFocus2; }
+ }
+
+ /// <summary>
+ /// Get the color of the third not focused label.
+ /// </summary>
+ public long TextColorNoFocus3
+ {
+ get { return _textColorNoFocus3; }
+ }
+
+ /// <summary>
/// Get the color of the text of the first label of a selected item.
/// </summary>
public long SelectedColor
View
3 mediaportal/Core/guilib/GUIPlayListItemListControl.cs
@@ -161,6 +161,7 @@ public GUIPlayListItemListControl(int dwParentID)
int dwSpinY,
string strFont,
long dwTextColor,
+ long dwTextColorNoFocus,
long dwSelectedColor,
string strButton,
string strButtonFocus,
@@ -175,7 +176,7 @@ public GUIPlayListItemListControl(int dwParentID)
strUp, strDown,
strUpFocus, strDownFocus,
dwSpinColor, dwSpinX, dwSpinY,
- strFont, dwTextColor, dwSelectedColor,
+ strFont, dwTextColor, dwTextColorNoFocus, dwSelectedColor,
strButton, strButtonFocus,
strScrollbarBackground, strScrollbarTop, strScrollbarBottom,
dwShadowAngle, dwShadowDistance, dwShadowColor)
View
4 mediaportal/Core/guilib/GUIUpDownListControl.cs
@@ -73,7 +73,7 @@ private enum Selection
string strUp, string strDown,
string strUpFocus, string strDownFocus,
long dwSpinColor, int dwSpinX, int dwSpinY,
- string strFont, long dwTextColor, long dwSelectedColor,
+ string strFont, long dwTextColor, long dwTextColorNoFocus, long dwSelectedColor,
string strButton, string strButtonFocus,
string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom,
int dwShadowAngle, int dwShadowDistance, long dwShadowColor)
@@ -82,7 +82,7 @@ private enum Selection
strUp, strDown,
strUpFocus, strDownFocus,
dwSpinColor, dwSpinX, dwSpinY,
- strFont, dwTextColor, dwSelectedColor,
+ strFont, dwTextColor, dwTextColorNoFocus, dwSelectedColor,
strButton, strButtonFocus,
strScrollbarBackground, strScrollbarTop, strScrollbarBottom,
dwShadowAngle, dwShadowDistance, dwShadowColor)

0 comments on commit 006665b

Please sign in to comment.