mirror of
https://github.com/LBRYFoundation/LBRY-Vault.git
synced 2025-08-31 09:21:39 +00:00
highlight current item only when we have the focus
This commit is contained in:
parent
a4da0866f3
commit
b0a1f48900
1 changed files with 13 additions and 2 deletions
|
@ -97,13 +97,24 @@ class MyTreeWidget(QTreeWidget):
|
||||||
break
|
break
|
||||||
else:
|
else:
|
||||||
return
|
return
|
||||||
|
|
||||||
for j in range(0,30):
|
for j in range(0,30):
|
||||||
if self.itemAt(QPoint(0,i*5 + j)) != item:
|
if self.itemAt(QPoint(0,i*5 + j)) != item:
|
||||||
break
|
break
|
||||||
|
|
||||||
self.emit(SIGNAL('customContextMenuRequested(const QPoint&)'), QPoint(50, i*5 + j - 1))
|
self.emit(SIGNAL('customContextMenuRequested(const QPoint&)'), QPoint(50, i*5 + j - 1))
|
||||||
|
|
||||||
self.connect(self, SIGNAL('itemActivated(QTreeWidgetItem*, int)'), ddfr)
|
self.connect(self, SIGNAL('itemActivated(QTreeWidgetItem*, int)'), ddfr)
|
||||||
|
self.my_item = None
|
||||||
|
|
||||||
|
def focusInEvent(self, e):
|
||||||
|
# we use column 1 because column 0 may be hidden
|
||||||
|
self.setCurrentItem(self.my_item,1)
|
||||||
|
|
||||||
|
def focusOutEvent(self, e):
|
||||||
|
self.my_item = self.currentItem()
|
||||||
|
self.setCurrentItem(None)
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
class StatusBarButton(QPushButton):
|
class StatusBarButton(QPushButton):
|
||||||
def __init__(self, icon, tooltip, func):
|
def __init__(self, icon, tooltip, func):
|
||||||
|
|
Loading…
Add table
Reference in a new issue