1
0

qt network dialog: use icon for selected server, instead of "*"

Previously we added a " *" suffix to distinguish the selected/main server
in the list. However in case of an .onion address, anything we put as a
suffix inline is elided/truncated - as the address itself does not fit.
Hence we could instead use a prefix - and then why not use an icon.
This commit is contained in:
SomberNight
2023-03-30 14:56:33 +00:00
parent 0a3e286f1d
commit 31fde2484f
2 changed files with 3 additions and 2 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.0 KiB

View File

@@ -157,11 +157,12 @@ class NodesListWidget(QTreeWidget):
else:
x = connected_servers_item
for i in interfaces:
star = ' *' if i == network.interface else ''
item = QTreeWidgetItem([f"{i.server.to_friendly_name()}" + star, '%d'%i.tip])
item = QTreeWidgetItem([f"{i.server.to_friendly_name()}", '%d'%i.tip])
item.setData(0, self.ITEMTYPE_ROLE, self.ItemType.CONNECTED_SERVER)
item.setData(0, self.SERVER_ADDR_ROLE, i.server)
item.setToolTip(0, str(i.server))
if i == network.interface:
item.setIcon(0, read_QIcon("chevron-right.png"))
x.addChild(item)
if n_chains > 1:
connected_servers_item.addChild(x)