From 41a1a8615dd48fdd9811b9824c49ceb934c6375e Mon Sep 17 00:00:00 2001 From: "@RandyMcMillan" Date: Thu, 28 Mar 2024 15:39:49 -0400 Subject: [PATCH] gui: Hide peers details Add a close (X) button to the Peers Detail panel. Reuse the same icon used in the Console Tab. The close button deselects the peer highlighted in the PeerTableView and hides the detail panel. This PR addresses issue #485: Co-authored-by: @w0xlt --- src/qt/forms/debugwindow.ui | 147 +++++++++++++++++++++++++++--------- src/qt/rpcconsole.cpp | 2 + 2 files changed, 113 insertions(+), 36 deletions(-) diff --git a/src/qt/forms/debugwindow.ui b/src/qt/forms/debugwindow.ui index 33308cd68c0a4..c8d24d773afd2 100644 --- a/src/qt/forms/debugwindow.ui +++ b/src/qt/forms/debugwindow.ui @@ -984,42 +984,117 @@ - - - - - 0 - 0 - - - - - 0 - 32 - - - - - 10 - - - - IBeamCursor - - - Select a peer to view detailed information. - - - Qt::AlignHCenter|Qt::AlignTop - - - true - - - Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse - - - + + + + 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 a07686ab2b766..96b6ebf134679 100644 --- a/src/qt/rpcconsole.cpp +++ b/src/qt/rpcconsole.cpp @@ -550,6 +550,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty ui->lineEdit->setMaxLength(16 * 1024 * 1024); ui->messagesWidget->installEventFilter(this); + connect(ui->hidePeersDetailButton, &QAbstractButton::clicked, this, &RPCConsole::clearSelectedNode); connect(ui->clearButton, &QAbstractButton::clicked, [this] { clear(); }); connect(ui->fontBiggerButton, &QAbstractButton::clicked, this, &RPCConsole::fontBigger); connect(ui->fontSmallerButton, &QAbstractButton::clicked, this, &RPCConsole::fontSmaller); @@ -1221,6 +1222,7 @@ void RPCConsole::updateDetailWidget() ui->peerRelayTxes->setText(stats->nodeStateStats.m_relay_txs ? ts.yes : ts.no); } + ui->hidePeersDetailButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove"))); ui->peersTabRightPanel->show(); }