aboutsummaryrefslogtreecommitdiff
path: root/guilib/GUISpinControlEx.cpp
diff options
context:
space:
mode:
authorjmarshallnz <jmarshallnz@svn>2010-02-23 10:20:09 +0000
committerjmarshallnz <jmarshallnz@svn>2010-02-23 10:20:09 +0000
commit0d72175c5c99cf19a0c4de94019bca72648cfd43 (patch)
treec7b113b8448ab697c31ed77591637e8e0fcc7135 /guilib/GUISpinControlEx.cpp
parent33975c8569eb7128fd94d26a488fa2ebc5913d17 (diff)
fixed: Ensure settings spinners don't cause overlapping text by making the spin labels scroll if necessary
git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@28071 568bbfeb-2a22-0410-94d2-cc84cf5bfa90
Diffstat (limited to 'guilib/GUISpinControlEx.cpp')
-rw-r--r--guilib/GUISpinControlEx.cpp9
1 files changed, 9 insertions, 0 deletions
diff --git a/guilib/GUISpinControlEx.cpp b/guilib/GUISpinControlEx.cpp
index e23bdce45b..4c5f53cebb 100644
--- a/guilib/GUISpinControlEx.cpp
+++ b/guilib/GUISpinControlEx.cpp
@@ -144,3 +144,12 @@ void CGUISpinControlEx::SetSpinPosition(float spinPosX)
m_spinPosX = spinPosX;
SetPosition(m_buttonControl.GetXPosition(), m_buttonControl.GetYPosition());
}
+
+void CGUISpinControlEx::RenderText(float posX, float width)
+{
+ const float spaceWidth = 10;
+ // check our limits from the button control
+ float x = std::max(m_buttonControl.m_label.GetRenderRect().x2 + spaceWidth, posX);
+ m_label.SetScrolling(HasFocus());
+ CGUISpinControl::RenderText(x, width + posX - x);
+}