Permalink
Browse files

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...
1 parent 1ecd5d3 commit 6071157ff71005fdbc229a8e287e353b5b21afd1 Paul Harrison committed Sep 20, 2011
Showing with 3 additions and 3 deletions.
  1. +3 −3 mythtv/libs/libmythui/mythuibuttontree.cpp
@@ -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);
}
@@ -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);
}

0 comments on commit 6071157

Please sign in to comment.