Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
Handle mouse in mythuibuttontree.
  • Loading branch information
stuartm committed Jun 2, 2012
1 parent 6e490cd commit e763a6a
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 1 deletion.
24 changes: 24 additions & 0 deletions mythtv/libs/libmythui/mythuibuttontree.cpp
Expand Up @@ -633,6 +633,30 @@ bool MythUIButtonTree::keyPressEvent(QKeyEvent *event)
return handled;
}

bool MythUIButtonTree::gestureEvent(MythGestureEvent *event)
{
bool handled = false;

if (event->gesture() == MythGestureEvent::Click)
{
// We want the relative position of the click
QPoint position = event->GetPosition() -
m_Parent->GetArea().topLeft();

MythUIType *type = GetChildAt(position, false, false);

if (!type)
return false;

MythUIButtonList *list = dynamic_cast<MythUIButtonList *>(type);

if (list)
handled = list->gestureEvent(event);
}

return handled;
}

/*!
* \copydoc MythUIType::ParseElement()
*/
Expand Down
2 changes: 1 addition & 1 deletion mythtv/libs/libmythui/mythuibuttontree.h
Expand Up @@ -21,7 +21,7 @@ class MUI_PUBLIC MythUIButtonTree : public MythUIType
~MythUIButtonTree();

virtual bool keyPressEvent(QKeyEvent *);
//virtual void gestureEvent(MythUIType *uitype, MythGestureEvent *event);
virtual bool gestureEvent(MythGestureEvent *event);

bool AssignTree(MythGenericTree *tree);
void Reset(void);
Expand Down

0 comments on commit e763a6a

Please sign in to comment.