Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Allow OnJumpLetter() to skip to the next item on a miss.

In addition to the old behavior we can cycle, eg all items starting with
an 'a' by repeatedly typing 'A'.
  • Loading branch information...
commit b07d4c3f29fea9d01d041835fba1471e7162093f 1 parent 58d3e4d
t-nelson authored
View
6 xbmc/guilib/GUIBaseContainer.cpp
@@ -518,7 +518,7 @@ void CGUIBaseContainer::OnPrevLetter()
}
}
-void CGUIBaseContainer::OnJumpLetter(char letter)
+void CGUIBaseContainer::OnJumpLetter(char letter, bool skip /*=false*/)
{
if (m_matchTimer.GetElapsedMilliseconds() < letter_match_timeout)
m_match.push_back(letter);
@@ -533,7 +533,7 @@ void CGUIBaseContainer::OnJumpLetter(char letter)
// find the current letter we're focused on
unsigned int offset = CorrectOffset(GetOffset(), GetCursor());
- unsigned int i = offset;
+ unsigned int i = (offset + ((skip) ? 1 : 0)) % m_items.size();
do
{
CGUIListItemPtr item = m_items[i];
@@ -548,7 +548,7 @@ void CGUIBaseContainer::OnJumpLetter(char letter)
if (m_match.size() > 1)
{
m_match.clear();
- OnJumpLetter(letter);
+ OnJumpLetter(letter, true);
}
}
View
2  xbmc/guilib/GUIBaseContainer.h
@@ -178,7 +178,7 @@ class CGUIBaseContainer : public CGUIControl
bool ScrollingUp() const { return m_scroller.IsScrollingUp(); };
void OnNextLetter();
void OnPrevLetter();
- void OnJumpLetter(char letter);
+ void OnJumpLetter(char letter, bool skip = false);
void OnJumpSMS(int letter);
std::vector< std::pair<int, CStdString> > m_letterOffsets;
Please sign in to comment.
Something went wrong with that request. Please try again.