1414#include < netbase.h>
1515#include < qt/bantablemodel.h>
1616#include < qt/clientmodel.h>
17+ #include < qt/optionsmodel.h>
1718#include < qt/peertablesortproxy.h>
1819#include < qt/platformstyle.h>
1920#include < qt/walletmodel.h>
@@ -489,6 +490,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
489490
490491 m_peer_widget_header_state = settings.value (" PeersTabPeerHeaderState" ).toByteArray ();
491492 m_banlist_widget_header_state = settings.value (" PeersTabBanlistHeaderState" ).toByteArray ();
493+ m_alternating_row_colors = settings.value (" PeersTabAlternatingRowColors" ).toBool ();
492494
493495 constexpr QChar nonbreaking_hyphen (8209 );
494496 const std::vector<QString> CONNECTION_TYPE_DOC{
@@ -658,6 +660,11 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
658660
659661 connect (model, &ClientModel::mempoolSizeChanged, this , &RPCConsole::setMempoolSize);
660662
663+ connect (model->getOptionsModel (), &OptionsModel::peersTabAlternatingRowColorsChanged, [this ](bool alternating_row_colors) {
664+ ui->peerWidget ->setAlternatingRowColors (alternating_row_colors);
665+ ui->banlistWidget ->setAlternatingRowColors (alternating_row_colors);
666+ });
667+
661668 // set up peer table
662669 ui->peerWidget ->setModel (model->peerTableSortProxy ());
663670 ui->peerWidget ->verticalHeader ()->hide ();
@@ -672,6 +679,7 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
672679 }
673680 ui->peerWidget ->horizontalHeader ()->setStretchLastSection (true );
674681 ui->peerWidget ->setItemDelegateForColumn (PeerTableModel::NetNodeId, new PeerIdViewDelegate (this ));
682+ ui->peerWidget ->setAlternatingRowColors (m_alternating_row_colors);
675683
676684 // create peer table context menu
677685 peersTableContextMenu = new QMenu (this );
@@ -698,6 +706,7 @@ void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_
698706 ui->banlistWidget ->setColumnWidth (BanTableModel::Bantime, BANTIME_COLUMN_WIDTH);
699707 }
700708 ui->banlistWidget ->horizontalHeader ()->setStretchLastSection (true );
709+ ui->banlistWidget ->setAlternatingRowColors (m_alternating_row_colors);
701710
702711 // create ban table context menu
703712 banTableContextMenu = new QMenu (this );
0 commit comments