Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Fix the keypress handling in MythUIButtonTree when using a grid layou…

…t in the

buttonlist.

This change allow you to use a <buttontree> widget to navigate a tree like the
gallery view in MythVideo. The main advantage is you can use the same code for
both a tree view and gallery view the only difference is in the theme.
  • Loading branch information...
commit b2b6633ffb51df1ef134d9b4b6fed841655d0600 1 parent fcd5054
Paul Harrison authored
Showing with 22 additions and 7 deletions.
  1. +22 −7 mythtv/libs/libmythui/mythuibuttontree.cpp
View
29 mythtv/libs/libmythui/mythuibuttontree.cpp
@@ -533,17 +533,32 @@ bool MythUIButtonTree::keyPressEvent(QKeyEvent *event)
{
QString action = actions[i];
handled = true;
-
- if (action == "RIGHT")
+ if (m_activeList && m_activeList->m_layout == MythUIButtonList::LayoutGrid)
{
- SwitchList(true);
+ if (action == "SELECT" && m_currentNode->childCount() > 0)
+ {
+ SwitchList(true);
+ }
+ else if (action == "ESCAPE" && m_currentDepth > 1)
+ {
+ SwitchList(false);
+ }
+ else
+ handled = false;
}
- else if (action == "LEFT")
+ else
{
- SwitchList(false);
+ if (action == "RIGHT")
+ {
+ SwitchList(true);
+ }
+ else if (action == "LEFT")
+ {
+ SwitchList(false);
+ }
+ else
+ handled = false;
}
- else
- handled = false;
}
if (!handled && m_activeList)
Please sign in to comment.
Something went wrong with that request. Please try again.