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:
BIN
electrum/gui/icons/chevron-right.png
Normal file
BIN
electrum/gui/icons/chevron-right.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 1.0 KiB |
@@ -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)
|
||||
|
||||
Reference in New Issue
Block a user