Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Fix the button tree widget not reacting to loosing focus properly.

  • Loading branch information...
commit 971df9544ce1fa6657cca99a5cdaeca8d0d31a6e 1 parent 7a75237
Paul Harrison authored
View
15 mythtv/libs/libmythui/mythuibuttontree.cpp
@@ -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()
@@ -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
*
@@ -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();
View
2  mythtv/libs/libmythui/mythuibuttontree.h
@@ -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);
Please sign in to comment.
Something went wrong with that request. Please try again.