aboutsummaryrefslogtreecommitdiff
path: root/guilib
diff options
context:
space:
mode:
authorspiff_ <spiff_@svn>2009-10-12 20:28:21 +0000
committerspiff_ <spiff_@svn>2009-10-12 20:28:21 +0000
commit92a98a0392a65c0496f833c15c9f73b7cf5fdbca (patch)
tree83b24d1cc178a29602d2a38e2fe4c46476fab1a0 /guilib
parentb89f8ce621a669ad43079f799950799258d7eea0 (diff)
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
Diffstat (limited to 'guilib')
-rw-r--r--guilib/GUIControlFactory.cpp6
-rw-r--r--guilib/GUIRSSControl.cpp15
-rw-r--r--guilib/GUIRSSControl.h3
3 files changed, 13 insertions, 11 deletions
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<int, std::pair<std::vector<int>,std::vector<string> > >::iterator iter=g_settings.m_mapRssUrls.find(iUrlSet);
+ std::map<int,CSettings::RssSet>::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<string> &vecUrl)
+void CGUIRSSControl::SetUrls(const vector<string> &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<int>& 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<int>& vecIntervals);
- void SetUrls(const std::vector<std::string>& vecUrl);
+ void SetUrls(const std::vector<std::string>& vecUrl, bool rtl);
protected:
virtual void UpdateColors();
@@ -82,6 +82,7 @@ protected:
std::vector<std::string> m_vecUrls;
std::vector<int> m_vecIntervals;
+ bool m_rtl;
CScrollInfo m_scrollInfo;
};
#endif