Skip to content

Commit

Permalink
Initial commit for mantis 0003808: Add textcolorNoFocus property to l…
Browse files Browse the repository at this point in the history
…ist controls, thanks to ncoH for the patch

- http://forum.team-mediaportal.com/private.php?do=showpm&pmid=229044
  • Loading branch information
SilentException committed Feb 6, 2012
1 parent b016657 commit 006665b
Show file tree
Hide file tree
Showing 4 changed files with 41 additions and 6 deletions.
4 changes: 2 additions & 2 deletions mediaportal/Core/guilib/GUICheckListControl.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ public GUICheckListControl(int dwParentID, int dwControlId, int dwPosX, int dwPo
string strUp, string strDown, string strUp, string strDown,
string strUpFocus, string strDownFocus, string strUpFocus, string strDownFocus,
long dwSpinColor, int dwSpinX, int dwSpinY, 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 strButton, string strButtonFocus,
string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom, string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom,
int dwShadowAngle, int dwShadowDistance, long dwShadowColor) int dwShadowAngle, int dwShadowDistance, long dwShadowColor)
Expand All @@ -80,7 +80,7 @@ public GUICheckListControl(int dwParentID, int dwControlId, int dwPosX, int dwPo
strUp, strDown, strUp, strDown,
strUpFocus, strDownFocus, strUpFocus, strDownFocus,
dwSpinColor, dwSpinX, dwSpinY, dwSpinColor, dwSpinX, dwSpinY,
strFont, dwTextColor, dwSelectedColor, strFont, dwTextColor, dwTextColorNoFocus, dwSelectedColor,
strButton, strButtonFocus, strButton, strButtonFocus,
strScrollbarBackground, strScrollbarTop, strScrollbarBottom, strScrollbarBackground, strScrollbarTop, strScrollbarBottom,
dwShadowAngle, dwShadowDistance, dwShadowColor) dwShadowAngle, dwShadowDistance, dwShadowColor)
Expand Down
36 changes: 35 additions & 1 deletion mediaportal/Core/guilib/GUIListControl.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -108,6 +108,9 @@ public enum SearchType
[XMLSkinElement("textcolor")] protected long _textColor = 0xFFFFFFFF; [XMLSkinElement("textcolor")] protected long _textColor = 0xFFFFFFFF;
[XMLSkinElement("textcolor2")] protected long _textColor2 = 0xFFFFFFFF; [XMLSkinElement("textcolor2")] protected long _textColor2 = 0xFFFFFFFF;
[XMLSkinElement("textcolor3")] protected long _textColor3 = 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("selectedColor")] protected long _selectedColor = 0xFFFFFFFF;
[XMLSkinElement("selectedColor2")] protected long _selectedColor2 = 0xFFFFFFFF; [XMLSkinElement("selectedColor2")] protected long _selectedColor2 = 0xFFFFFFFF;
[XMLSkinElement("selectedColor3")] protected long _selectedColor3 = 0xFFFFFFFF; [XMLSkinElement("selectedColor3")] protected long _selectedColor3 = 0xFFFFFFFF;
Expand Down Expand Up @@ -260,7 +263,7 @@ public GUIListControl(int dwParentID, int dwControlId, int dwPosX, int dwPosY, i
string strUp, string strDown, string strUp, string strDown,
string strUpFocus, string strDownFocus, string strUpFocus, string strDownFocus,
long dwSpinColor, int dwSpinX, int dwSpinY, 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 strButton, string strButtonFocus,
string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom, string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom,
int dwShadowAngle, int dwShadowDistance, long dwShadowColor) int dwShadowAngle, int dwShadowDistance, long dwShadowColor)
Expand All @@ -282,6 +285,9 @@ public GUIListControl(int dwParentID, int dwControlId, int dwPosX, int dwPosY, i
_textColor = dwTextColor; _textColor = dwTextColor;
_textColor2 = dwTextColor; _textColor2 = dwTextColor;
_textColor3 = dwTextColor; _textColor3 = dwTextColor;
_textColorNoFocus = dwTextColorNoFocus;
_textColorNoFocus2 = dwTextColorNoFocus;
_textColorNoFocus3 = dwTextColorNoFocus;
_buttonNonFocusName = strButton; _buttonNonFocusName = strButton;
_buttonFocusName = strButtonFocus; _buttonFocusName = strButtonFocus;
_scrollbarBackgroundName = strScrollbarBackground; _scrollbarBackgroundName = strScrollbarBackground;
Expand Down Expand Up @@ -685,6 +691,7 @@ protected virtual void RenderLabel(float timePassed, int buttonNr, int dwPosX, i
else else
{ {
label2.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb(); label2.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
label2.TextColor = _textColorNoFocus2;
} }


label2.Label = pItem.Label2; label2.Label = pItem.Label2;
Expand Down Expand Up @@ -722,6 +729,7 @@ protected virtual void RenderLabel(float timePassed, int buttonNr, int dwPosX, i
if (!pItem.Selected && !gotFocus) if (!pItem.Selected && !gotFocus)
{ {
dwColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb(); dwColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
dwColor &= _textColorNoFocus;
} }
if (!Focus) if (!Focus)
{ {
Expand Down Expand Up @@ -787,6 +795,7 @@ protected virtual void RenderLabel(float timePassed, int buttonNr, int dwPosX, i
else else
{ {
label2.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb(); label2.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
label2.TextColor &= _textColorNoFocus2;
} }
label2.Label = _textLine; label2.Label = _textLine;
label2.TextAlignment = Alignment.ALIGN_RIGHT; label2.TextAlignment = Alignment.ALIGN_RIGHT;
Expand Down Expand Up @@ -860,6 +869,7 @@ protected virtual void RenderLabel(float timePassed, int buttonNr, int dwPosX, i
else else
{ {
label3.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb(); label3.TextColor = Color.FromArgb(_unfocusedAlpha, Color.FromArgb((int)dwColor)).ToArgb();
label3.TextColor &= _textColorNoFocus3;
} }
label3.Label = pItem.Label3; label3.Label = pItem.Label3;
if (!string.IsNullOrEmpty(_text3Content)) if (!string.IsNullOrEmpty(_text3Content))
Expand Down Expand Up @@ -2975,6 +2985,30 @@ public long TextColor3
get { return _textColor3; } get { return _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> /// <summary>
/// Get the color of the text of the first label of a selected item. /// Get the color of the text of the first label of a selected item.
/// </summary> /// </summary>
Expand Down
3 changes: 2 additions & 1 deletion mediaportal/Core/guilib/GUIPlayListItemListControl.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -161,6 +161,7 @@ public GUIPlayListItemListControl(int dwParentID, int dwControlId, int dwPosX, i
int dwSpinY, int dwSpinY,
string strFont, string strFont,
long dwTextColor, long dwTextColor,
long dwTextColorNoFocus,
long dwSelectedColor, long dwSelectedColor,
string strButton, string strButton,
string strButtonFocus, string strButtonFocus,
Expand All @@ -175,7 +176,7 @@ public GUIPlayListItemListControl(int dwParentID, int dwControlId, int dwPosX, i
strUp, strDown, strUp, strDown,
strUpFocus, strDownFocus, strUpFocus, strDownFocus,
dwSpinColor, dwSpinX, dwSpinY, dwSpinColor, dwSpinX, dwSpinY,
strFont, dwTextColor, dwSelectedColor, strFont, dwTextColor, dwTextColorNoFocus, dwSelectedColor,
strButton, strButtonFocus, strButton, strButtonFocus,
strScrollbarBackground, strScrollbarTop, strScrollbarBottom, strScrollbarBackground, strScrollbarTop, strScrollbarBottom,
dwShadowAngle, dwShadowDistance, dwShadowColor) dwShadowAngle, dwShadowDistance, dwShadowColor)
Expand Down
4 changes: 2 additions & 2 deletions mediaportal/Core/guilib/GUIUpDownListControl.cs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ public GUIUpDownListControl(int dwParentID, int dwControlId, int dwPosX, int dwP
string strUp, string strDown, string strUp, string strDown,
string strUpFocus, string strDownFocus, string strUpFocus, string strDownFocus,
long dwSpinColor, int dwSpinX, int dwSpinY, 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 strButton, string strButtonFocus,
string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom, string strScrollbarBackground, string strScrollbarTop, string strScrollbarBottom,
int dwShadowAngle, int dwShadowDistance, long dwShadowColor) int dwShadowAngle, int dwShadowDistance, long dwShadowColor)
Expand All @@ -82,7 +82,7 @@ public GUIUpDownListControl(int dwParentID, int dwControlId, int dwPosX, int dwP
strUp, strDown, strUp, strDown,
strUpFocus, strDownFocus, strUpFocus, strDownFocus,
dwSpinColor, dwSpinX, dwSpinY, dwSpinColor, dwSpinX, dwSpinY,
strFont, dwTextColor, dwSelectedColor, strFont, dwTextColor, dwTextColorNoFocus, dwSelectedColor,
strButton, strButtonFocus, strButton, strButtonFocus,
strScrollbarBackground, strScrollbarTop, strScrollbarBottom, strScrollbarBackground, strScrollbarTop, strScrollbarBottom,
dwShadowAngle, dwShadowDistance, dwShadowColor) dwShadowAngle, dwShadowDistance, dwShadowColor)
Expand Down

0 comments on commit 006665b

Please sign in to comment.