Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
mythuibuttontree: Allow left/right to move focus to previous/next wid…
…get.

This changes the key press handling in the buttontree widget to ignore left and
right keypresses when at the far left and right of the tree. This makes it
easier to move the focus away from the buttontree and is more consistent with
the way other widgets work.
  • Loading branch information
Paul Harrison committed Sep 20, 2011
1 parent 1ecd5d3 commit 6071157
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions mythtv/libs/libmythui/mythuibuttontree.cpp
Expand Up @@ -593,7 +593,7 @@ bool MythUIButtonTree::keyPressEvent(QKeyEvent *event)

if (m_activeList && m_activeList->m_layout == MythUIButtonList::LayoutGrid)
{
if (action == "SELECT" && m_currentNode->childCount() > 0)
if (action == "SELECT" && m_currentNode->visibleChildCount() > 0)
{
SwitchList(true);
}
Expand All @@ -606,11 +606,11 @@ bool MythUIButtonTree::keyPressEvent(QKeyEvent *event)
}
else
{
if (action == "RIGHT")
if (action == "RIGHT" && m_currentNode->visibleChildCount() > 0)
{
SwitchList(true);
}
else if (action == "LEFT")
else if (action == "LEFT" && !(m_currentDepth == 0 && m_activeListID == 0))
{
SwitchList(false);
}
Expand Down

0 comments on commit 6071157

Please sign in to comment.