Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Modify RSS Ticker to Pause Scroll during Mouseover #1709

Merged
merged 1 commit into from Jan 30, 2013
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
18 changes: 18 additions & 0 deletions xbmc/guilib/GUIRSSControl.cpp
Expand Up @@ -40,6 +40,7 @@ CGUIRSSControl::CGUIRSSControl(int parentID, int controlID, float posX, float po


m_pReader = NULL; m_pReader = NULL;
m_rtl = false; m_rtl = false;
m_stopped = false;
ControlType = GUICONTROL_RSS; ControlType = GUICONTROL_RSS;
} }


Expand All @@ -52,6 +53,7 @@ CGUIRSSControl::CGUIRSSControl(const CGUIRSSControl &from)
m_strRSSTags = from.m_strRSSTags; m_strRSSTags = from.m_strRSSTags;
m_pReader = NULL; m_pReader = NULL;
m_rtl = from.m_rtl; m_rtl = from.m_rtl;
m_stopped = from.m_stopped;
ControlType = GUICONTROL_RSS; ControlType = GUICONTROL_RSS;
} }


Expand All @@ -73,6 +75,16 @@ void CGUIRSSControl::SetUrls(const vector<string> &vecUrl, bool rtl)
m_scrollInfo.pixelSpeed *= -1; m_scrollInfo.pixelSpeed *= -1;
} }


void CGUIRSSControl::OnFocus()
{
m_stopped = true;
}

void CGUIRSSControl::OnUnFocus()
{
m_stopped = false;
}

void CGUIRSSControl::SetIntervals(const vector<int>& vecIntervals) void CGUIRSSControl::SetIntervals(const vector<int>& vecIntervals)
{ {
m_vecIntervals = vecIntervals; m_vecIntervals = vecIntervals;
Expand Down Expand Up @@ -130,6 +142,12 @@ void CGUIRSSControl::Render()
colors.push_back(m_label.textColor); colors.push_back(m_label.textColor);
colors.push_back(m_headlineColor); colors.push_back(m_headlineColor);
colors.push_back(m_channelColor); 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); m_label.font->DrawScrollingText(m_posX, m_posY, colors, m_label.shadowColor, m_feed, 0, m_width, m_scrollInfo);
} }


Expand Down
6 changes: 5 additions & 1 deletion xbmc/guilib/GUIRSSControl.h
Expand Up @@ -62,12 +62,15 @@ class CGUIRSSControl : public CGUIControl, public IRssObserver
virtual void Render(); virtual void Render();
virtual void OnFeedUpdate(const vecText &feed); virtual void OnFeedUpdate(const vecText &feed);
virtual void OnFeedRelease(); virtual void OnFeedRelease();
virtual bool CanFocus() const { return false; }; virtual bool CanFocus() const { return true; };
virtual CRect CalcRenderRegion() const; virtual CRect CalcRenderRegion() const;


void SetIntervals(const std::vector<int>& vecIntervals); void SetIntervals(const std::vector<int>& vecIntervals);
void SetUrls(const std::vector<std::string>& vecUrl, bool rtl); void SetUrls(const std::vector<std::string>& vecUrl, bool rtl);


virtual void OnFocus();
virtual void OnUnFocus();

protected: protected:
virtual bool UpdateColors(); virtual bool UpdateColors();


Expand All @@ -86,5 +89,6 @@ class CGUIRSSControl : public CGUIControl, public IRssObserver
std::vector<int> m_vecIntervals; std::vector<int> m_vecIntervals;
bool m_rtl; bool m_rtl;
CScrollInfo m_scrollInfo; CScrollInfo m_scrollInfo;
bool m_stopped;
}; };
#endif #endif