Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #1709 from colfax4/master

Modify RSS Ticker to Pause Scroll during Mouseover
  • Loading branch information...
commit b6ecee10907bea6d7476b7ef5099e85ea1ba8fb3 2 parents 0f42c97 + e470fb5
@MartijnKaijser MartijnKaijser authored
Showing with 23 additions and 1 deletion.
  1. +18 −0 xbmc/guilib/GUIRSSControl.cpp
  2. +5 −1 xbmc/guilib/GUIRSSControl.h
View
18 xbmc/guilib/GUIRSSControl.cpp
@@ -40,6 +40,7 @@ CGUIRSSControl::CGUIRSSControl(int parentID, int controlID, float posX, float po
m_pReader = NULL;
m_rtl = false;
+ m_stopped = false;
ControlType = GUICONTROL_RSS;
}
@@ -52,6 +53,7 @@ CGUIRSSControl::CGUIRSSControl(const CGUIRSSControl &from)
m_strRSSTags = from.m_strRSSTags;
m_pReader = NULL;
m_rtl = from.m_rtl;
+ m_stopped = from.m_stopped;
ControlType = GUICONTROL_RSS;
}
@@ -73,6 +75,16 @@ void CGUIRSSControl::SetUrls(const vector<string> &vecUrl, bool rtl)
m_scrollInfo.pixelSpeed *= -1;
}
+void CGUIRSSControl::OnFocus()
+{
+ m_stopped = true;
+}
+
+void CGUIRSSControl::OnUnFocus()
+{
+ m_stopped = false;
+}
+
void CGUIRSSControl::SetIntervals(const vector<int>& vecIntervals)
{
m_vecIntervals = vecIntervals;
@@ -130,6 +142,12 @@ void CGUIRSSControl::Render()
colors.push_back(m_label.textColor);
colors.push_back(m_headlineColor);
colors.push_back(m_channelColor);
+
+ if ( m_stopped )
+ m_scrollInfo.SetSpeed(0);
+ else
+ m_scrollInfo.SetSpeed(m_label.scrollSpeed);
+
m_label.font->DrawScrollingText(m_posX, m_posY, colors, m_label.shadowColor, m_feed, 0, m_width, m_scrollInfo);
}
View
6 xbmc/guilib/GUIRSSControl.h
@@ -62,12 +62,15 @@ class CGUIRSSControl : public CGUIControl, public IRssObserver
virtual void Render();
virtual void OnFeedUpdate(const vecText &feed);
virtual void OnFeedRelease();
- virtual bool CanFocus() const { return false; };
+ virtual bool CanFocus() const { return true; };
virtual CRect CalcRenderRegion() const;
void SetIntervals(const std::vector<int>& vecIntervals);
void SetUrls(const std::vector<std::string>& vecUrl, bool rtl);
+ virtual void OnFocus();
+ virtual void OnUnFocus();
+
protected:
virtual bool UpdateColors();
@@ -86,5 +89,6 @@ class CGUIRSSControl : public CGUIControl, public IRssObserver
std::vector<int> m_vecIntervals;
bool m_rtl;
CScrollInfo m_scrollInfo;
+ bool m_stopped;
};
#endif
Please sign in to comment.
Something went wrong with that request. Please try again.