diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 576b872f2558..16abf85c4b56 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -889,6 +889,9 @@ &Peers + + 0 + @@ -911,6 +914,9 @@ + + 22 + @@ -934,190 +940,235 @@ - - - - 0 - 0 - - - - - 0 - 32 - - - - - 16777215 - 32 - - - - - 12 - - - - IBeamCursor - - - Banned peers - - - Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - - - true - - - Qt::NoTextInteraction - - - - - - - false - - - true - - - true - - - false - - - - - - - - - 0 - 0 - - - - - 300 - 0 - - - - - - - 0 - - - 0 + + + + 0 + + + + + 8 - + - + 0 0 - + - + 0 32 - + - - 10 - + + 12 + - IBeamCursor + IBeamCursor - Select a peer to view detailed information. + Banned peers - Qt::AlignHCenter|Qt::AlignTop + Qt::AlignBottom|Qt::AlignLeading|Qt::AlignLeft - true + true - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + Qt::NoTextInteraction + + + + + + + + 0 + 0 + + + + + 60 + 0 + + + + PointingHandCursor + + + Hide - + - - - true - - - - 32 - 32 - - - - - 32 - 32 - - - - - - 0 - 0 - 32 - 32 - - - - - 32 - 32 - - - - - 32 - 32 - - - - Hide Peers Detail - - - Qt::LeftToRight - - - - - - - :/icons/remove - :/icons/remove - - - - - 22 - 22 - - - - Ctrl+X - - - + + + Qt::Horizontal + + + + 40 + 20 + + + - - + + + + + + false + + + true + + + true + + + false + + + + + + + + + + + + 0 + 0 + + + + + 300 + 0 + + + + + + + 0 + + + 0 + + + + + + 0 + 0 + + + + + 0 + 32 + + + + + 10 + + + + IBeamCursor + + + Select a peer to view detailed information. + + + Qt::AlignHCenter|Qt::AlignTop + + + true + + + Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse + + + + + + + true + + + + 32 + 32 + + + + + 32 + 32 + + + + + + 0 + 0 + 32 + 32 + + + + + 32 + 32 + + + + + 32 + 32 + + + + Hide Peers Detail + + + Qt::LeftToRight + + + + + + + :/icons/remove + :/icons/remove + + + + + 22 + 22 + + + + Ctrl+X + + + + + + diff --git a/src/qt/rpcconsole.cpp b/src/qt/rpcconsole.cpp index 62fcfaf3c70a..c50da657904e 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -524,6 +524,10 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty m_peer_widget_header_state = settings.value("PeersTabPeerHeaderState_Knots23").toByteArray(); m_banlist_widget_header_state = settings.value("PeersTabBanlistHeaderState").toByteArray(); m_alternating_row_colors = settings.value("PeersTabAlternatingRowColors").toBool(); + + // Set up ban list toggle button + m_banlist_visible = settings.value("PeersTabBanlistVisible", true).toBool(); + connect(ui->banToggleButton, &QPushButton::clicked, this, &RPCConsole::toggleBanlistVisibility); { // Move everything down a row to make room @@ -1514,8 +1518,25 @@ void RPCConsole::showOrHideBanTableIfRequired() return; bool visible = clientModel->getBanTableModel()->shouldShow(); - ui->banlistWidget->setVisible(visible); - ui->banHeading->setVisible(visible); + ui->banSectionContainer->setVisible(visible); + // Show table only if criteria says we should and user has selected to see it + ui->banlistWidget->setVisible(visible && m_banlist_visible); + + // Update button text based on current state + if (visible) { + ui->banToggleButton->setText(m_banlist_visible ? tr("Hide") : tr("Show")); + } +} + +void RPCConsole::toggleBanlistVisibility() +{ + m_banlist_visible = !m_banlist_visible; + + // Save state to settings + QSettings settings; + settings.setValue("PeersTabBanlistVisible", m_banlist_visible); + + showOrHideBanTableIfRequired(); } std::vector RPCConsole::tabs() const diff --git a/src/qt/rpcconsole.h b/src/qt/rpcconsole.h index 0be4923bcf9f..ac0e5651748a 100644 --- a/src/qt/rpcconsole.h +++ b/src/qt/rpcconsole.h @@ -123,6 +123,8 @@ private Q_SLOTS: void resetDetailWidget(); /** show detailed information on ui about selected node */ void updateDetailWidget(); + /** toggle visibility of ban list table */ + void toggleBanlistVisibility(); public Q_SLOTS: void clear(bool keep_prompt = false); @@ -201,6 +203,7 @@ public Q_SLOTS: QByteArray m_peer_widget_header_state; QByteArray m_banlist_widget_header_state; bool m_alternating_row_colors{false}; + bool m_banlist_visible{true}; // Theme Colors const ThemeColors *m_theme_colors;