History list upgrades

+ add icon tooltip
  + fix text alignment
  + add double click for details
This commit is contained in:
Casper 2017-08-05 11:19:29 +03:00
parent 72706f8219
commit 713c3c7460
1 changed files with 10 additions and 0 deletions

View File

@ -92,6 +92,7 @@ class HistoryList(MyTreeWidget):
entry.append(text)
item = QTreeWidgetItem(entry)
item.setIcon(0, icon)
item.setToolTip(0, str(conf) + " confirmation" + ("s" if conf != 1 else ""))
if has_invoice:
item.setIcon(3, QIcon(":icons/seal"))
for i in range(len(entry)):
@ -99,6 +100,7 @@ class HistoryList(MyTreeWidget):
item.setTextAlignment(i, Qt.AlignRight)
if i!=2:
item.setFont(i, QFont(MONOSPACE_FONT))
item.setTextAlignment(i, Qt.AlignVCenter)
if value < 0:
item.setForeground(3, QBrush(QColor("#BC1E1E")))
item.setForeground(4, QBrush(QColor("#BC1E1E")))
@ -108,6 +110,14 @@ class HistoryList(MyTreeWidget):
if current_tx == tx_hash:
self.setCurrentItem(item)
def on_doubleclick(self, item, column):
if self.permit_edit(item, column):
super(HistoryList, self).on_doubleclick(item, column)
else:
tx_hash = str(item.data(0, Qt.UserRole).toString())
tx = self.wallet.transactions.get(tx_hash)
self.parent.show_transaction(tx)
def update_labels(self):
root = self.invisibleRootItem()
child_count = root.childCount()