From 92a98a0392a65c0496f833c15c9f73b7cf5fdbca Mon Sep 17 00:00:00 2001 From: spiff_ Date: Mon, 12 Oct 2009 20:28:21 +0000 Subject: changed: make right to left a rss set property and remove gui setting git-svn-id: https://xbmc.svn.sourceforge.net/svnroot/xbmc/trunk@23668 568bbfeb-2a22-0410-94d2-cc84cf5bfa90 --- guilib/GUIControlFactory.cpp | 6 +++--- guilib/GUIRSSControl.cpp | 15 ++++++++------- guilib/GUIRSSControl.h | 3 ++- 3 files changed, 13 insertions(+), 11 deletions(-) (limited to 'guilib') diff --git a/guilib/GUIControlFactory.cpp b/guilib/GUIControlFactory.cpp index 75d7f608af..2ffe10a921 100644 --- a/guilib/GUIControlFactory.cpp +++ b/guilib/GUIControlFactory.cpp @@ -1079,11 +1079,11 @@ CGUIControl* CGUIControlFactory::Create(int parentID, const CRect &rect, TiXmlEl parentID, id, posX, posY, width, height, labelInfo, textColor3, labelInfo2.textColor, strRSSTags, scrollSpeed); - std::map,std::vector > >::iterator iter=g_settings.m_mapRssUrls.find(iUrlSet); + std::map::iterator iter=g_settings.m_mapRssUrls.find(iUrlSet); if (iter != g_settings.m_mapRssUrls.end()) { - ((CGUIRSSControl *)control)->SetUrls(iter->second.second); - ((CGUIRSSControl *)control)->SetIntervals(iter->second.first); + ((CGUIRSSControl *)control)->SetUrls(iter->second.url,iter->second.rtl); + ((CGUIRSSControl *)control)->SetIntervals(iter->second.interval); } else CLog::Log(LOGERROR,"invalid rss url set referenced in skin"); diff --git a/guilib/GUIRSSControl.cpp b/guilib/GUIRSSControl.cpp index 9f30312c98..f756ce214d 100644 --- a/guilib/GUIRSSControl.cpp +++ b/guilib/GUIRSSControl.cpp @@ -40,12 +40,8 @@ CGUIRSSControl::CGUIRSSControl(int parentID, int controlID, float posX, float po m_strRSSTags = strRSSTags; m_pReader = NULL; + m_rtl = false; ControlType = GUICONTROL_RSS; - - if (g_guiSettings.GetBool("lookandfeel.rssfeedsrtl")) - { - m_scrollInfo.SetSpeed(-60); - } } CGUIRSSControl::CGUIRSSControl(const CGUIRSSControl &from) @@ -67,9 +63,14 @@ CGUIRSSControl::~CGUIRSSControl(void) m_pReader = NULL; } -void CGUIRSSControl::SetUrls(const vector &vecUrl) +void CGUIRSSControl::SetUrls(const vector &vecUrl, bool rtl) { m_vecUrls = vecUrl; + m_rtl = rtl; + if (m_scrollInfo.pixelSpeed > 0 && rtl) + m_scrollInfo.pixelSpeed *= -1; + else if (m_scrollInfo.pixelSpeed < 0 && !rtl) + m_scrollInfo.pixelSpeed *= -1; } void CGUIRSSControl::SetIntervals(const vector& vecIntervals) @@ -109,7 +110,7 @@ void CGUIRSSControl::Render() } // use half the width of the control as spacing between feeds, and double this between feed sets float spaceWidth = (m_label.font) ? m_label.font->GetCharWidth(L' ') : 15; - m_pReader->Create(this, m_vecUrls, m_vecIntervals, (int)(0.5f*GetWidth() / spaceWidth) + 1); + m_pReader->Create(this, m_vecUrls, m_vecIntervals, (int)(0.5f*GetWidth() / spaceWidth) + 1, m_rtl); } } diff --git a/guilib/GUIRSSControl.h b/guilib/GUIRSSControl.h index 8d3aa4e0db..ff604cfe8c 100644 --- a/guilib/GUIRSSControl.h +++ b/guilib/GUIRSSControl.h @@ -64,7 +64,7 @@ public: virtual bool CanFocus() const { return false; }; void SetIntervals(const std::vector& vecIntervals); - void SetUrls(const std::vector& vecUrl); + void SetUrls(const std::vector& vecUrl, bool rtl); protected: virtual void UpdateColors(); @@ -82,6 +82,7 @@ protected: std::vector m_vecUrls; std::vector m_vecIntervals; + bool m_rtl; CScrollInfo m_scrollInfo; }; #endif -- cgit v1.2.3