Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Modify RSS Ticker to Pause Scroll during Mouseover #1709

Merged
merged 1 commit into from

3 participants

@colfax4

It is likely common for users to either modify a skin or install a particular skin that takes advantage of multiple RSS feed sets. In addition, users may modify their skin to allow multiple RSS feeds to run at various speeds.

At times, a user may wish to momentarily pause the RSS ticker to read a particularly long news headline. This modification allows the user to easily pause the RSS ticker simply by placing the mouse over the ticker itself. When the user wishes for the ticker to start scrolling again, they can simply move the mouse away from the ticker.

[I'm sure there was a way to do this without having to close the original pull request, but I'm still learning git... please forgive me.]

@jmarshallnz
Owner

Scheduled for first merge after Frodo - thanks very much.

Note that next time, you can force push to your repo (it's OK as you own it) and it'll update the the original PR. Note that it's easier to develop features such as this in a separate branch, that way you can go on to other things without disturbing the pull request.

@jmarshallnz jmarshallnz was assigned
@MartijnKaijser MartijnKaijser merged commit b6ecee1 into xbmc:master
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
This page is out of date. Refresh to see the latest.
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
Something went wrong with that request. Please try again.