diff options
author | jmarshallnz <jmarshallnz@svn> | 2010-02-12 22:43:14 +0000 |
---|---|---|
committer | jmarshallnz <jmarshallnz@svn> | 2010-02-12 22:43:14 +0000 |
commit | ad0bbd838448034a03c11b32111cf6766ad2154e (patch) | |
tree | 20f82f410a703ae3e7370fe4c98eefb4e355a73a /guilib/GUISelectButtonControl.cpp | |
parent | 15c326da074ecf62c7d54984b276329f176f3a70 (diff) |
refactor: factored out some more label code and cleaned up a bunch of mess. Skinners please check your skins for any oddness.
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@27702 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUISelectButtonControl.cpp')
-rw-r--r-- | guilib/GUISelectButtonControl.cpp | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/guilib/GUISelectButtonControl.cpp b/guilib/GUISelectButtonControl.cpp index 689ebcde55..30c220af37 100644 --- a/guilib/GUISelectButtonControl.cpp +++ b/guilib/GUISelectButtonControl.cpp @@ -53,6 +53,7 @@ CGUISelectButtonControl::CGUISelectButtonControl(int parentID, int controlID, m_bMovedLeft = false; m_bMovedRight = false; m_ticks = 0; + m_label.SetAlign(m_label.GetLabelInfo().align | XBFONT_CENTER_X); ControlType = GUICONTROL_SELECTBUTTON; } @@ -72,7 +73,7 @@ void CGUISelectButtonControl::Render() // render background, left and right arrow m_imgBackground.Render(); - color_t textColor = m_label.textColor; + CGUILabel::COLOR color = CGUILabel::COLOR_TEXT; // User has moved left... if (m_bMovedLeft) @@ -85,7 +86,7 @@ void CGUISelectButtonControl::Render() } // If we are moving left // render item text as disabled - textColor = m_label.disabledColor; + color = CGUILabel::COLOR_DISABLED; } // Render arrow @@ -105,7 +106,7 @@ void CGUISelectButtonControl::Render() } // If we are moving right // render item text as disabled - textColor = m_label.disabledColor; + color = CGUILabel::COLOR_DISABLED; } // Render arrow @@ -117,12 +118,10 @@ void CGUISelectButtonControl::Render() // Render text if a current item is available if (m_iCurrentItem >= 0 && (unsigned)m_iCurrentItem < m_vecItems.size()) { - m_textLayout.Update(m_vecItems[m_iCurrentItem]); - uint32_t align = m_label.align | XBFONT_CENTER_X; - float fPosY = m_posY + m_label.offsetY; - if (m_label.align & XBFONT_CENTER_Y) - fPosY = m_posY + m_imgBackground.GetHeight()*0.5f; - m_textLayout.Render(m_posX + GetWidth()*0.5f, fPosY, 0, textColor, m_label.shadowColor, align, m_label.width); + m_label.SetMaxRect(m_posX, m_posY, m_width, m_height); + m_label.SetText(m_vecItems[m_iCurrentItem]); + m_label.SetColor(color); + m_label.Render(); } // Select current item, if user doesn't |