Navigation Menu

Skip to content

Commit

Permalink
Fix the button tree widget not reacting to loosing focus properly.
Browse files Browse the repository at this point in the history
  • Loading branch information
Paul Harrison committed Dec 31, 2010
1 parent 7a75237 commit 971df95
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
15 changes: 15 additions & 0 deletions mythtv/libs/libmythui/mythuibuttontree.cpp
Expand Up @@ -30,6 +30,9 @@ MythUIButtonTree::MythUIButtonTree(MythUIType *parent, const QString &name)

m_listTemplate = NULL;
SetCanTakeFocus(true);

connect(this, SIGNAL(TakingFocus()), this, SLOT(Select()));
connect(this, SIGNAL(LosingFocus()), this, SLOT(Deselect()));
}

MythUIButtonTree::~MythUIButtonTree()
Expand Down Expand Up @@ -405,6 +408,17 @@ void MythUIButtonTree::SetActive(bool active)
SetTreeState();
}

void MythUIButtonTree::Select()
{
SetActive(true);
}

void MythUIButtonTree::Deselect()
{
SetActive(false);
}


/*!
* \brief Move from list, or one level of the tree, to another
*
Expand Down Expand Up @@ -474,6 +488,7 @@ void MythUIButtonTree::handleSelect(MythUIButtonListItem *item)
m_activeListID = name.section(' ',2,2).toInt();
m_activeList = list;


MythGenericTree *node = qVariantValue<MythGenericTree*> (item->GetData());
SetCurrentNode(node);
SetTreeState();
Expand Down
2 changes: 2 additions & 0 deletions mythtv/libs/libmythui/mythuibuttontree.h
Expand Up @@ -40,6 +40,8 @@ class MPUBLIC MythUIButtonTree : public MythUIType
void handleSelect(MythUIButtonListItem* item);
void handleClick(MythUIButtonListItem* item);
void handleVisible(MythUIButtonListItem* item);
void Select();
void Deselect();

signals:
void itemSelected(MythUIButtonListItem* item);
Expand Down

0 comments on commit 971df95

Please sign in to comment.