Skip to content

Commit 41a1a86

Browse files
RandyMcMillanw0xlt
andcommitted
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 <[email protected]>
1 parent 48174c0 commit 41a1a86

File tree

2 files changed

+113
-36
lines changed

2 files changed

+113
-36
lines changed

src/qt/forms/debugwindow.ui

Lines changed: 111 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -984,42 +984,117 @@
984984
</size>
985985
</property>
986986
<layout class="QVBoxLayout" name="verticalLayout_8">
987-
<item>
988-
<widget class="QLabel" name="peerHeading">
989-
<property name="sizePolicy">
990-
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
991-
<horstretch>0</horstretch>
992-
<verstretch>0</verstretch>
993-
</sizepolicy>
994-
</property>
995-
<property name="minimumSize">
996-
<size>
997-
<width>0</width>
998-
<height>32</height>
999-
</size>
1000-
</property>
1001-
<property name="font">
1002-
<font>
1003-
<pointsize>10</pointsize>
1004-
</font>
1005-
</property>
1006-
<property name="cursor">
1007-
<cursorShape>IBeamCursor</cursorShape>
1008-
</property>
1009-
<property name="text">
1010-
<string>Select a peer to view detailed information.</string>
1011-
</property>
1012-
<property name="alignment">
1013-
<set>Qt::AlignHCenter|Qt::AlignTop</set>
1014-
</property>
1015-
<property name="wordWrap">
1016-
<bool>true</bool>
1017-
</property>
1018-
<property name="textInteractionFlags">
1019-
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
1020-
</property>
1021-
</widget>
1022-
</item>
987+
<item>
988+
<layout class="QHBoxLayout" name="horizontalLayout_8">
989+
<property name="topMargin">
990+
<number>0</number>
991+
</property>
992+
<property name="bottomMargin">
993+
<number>0</number>
994+
</property>
995+
<item>
996+
<widget class="QLabel" name="peerHeading">
997+
<property name="sizePolicy">
998+
<sizepolicy hsizetype="Preferred" vsizetype="Minimum">
999+
<horstretch>0</horstretch>
1000+
<verstretch>0</verstretch>
1001+
</sizepolicy>
1002+
</property>
1003+
<property name="minimumSize">
1004+
<size>
1005+
<width>0</width>
1006+
<height>32</height>
1007+
</size>
1008+
</property>
1009+
<property name="font">
1010+
<font>
1011+
<pointsize>10</pointsize>
1012+
</font>
1013+
</property>
1014+
<property name="cursor">
1015+
<cursorShape>IBeamCursor</cursorShape>
1016+
</property>
1017+
<property name="text">
1018+
<string>Select a peer to view detailed information.</string>
1019+
</property>
1020+
<property name="alignment">
1021+
<set>Qt::AlignHCenter|Qt::AlignTop</set>
1022+
</property>
1023+
<property name="wordWrap">
1024+
<bool>true</bool>
1025+
</property>
1026+
<property name="textInteractionFlags">
1027+
<set>Qt::LinksAccessibleByMouse|Qt::TextSelectableByKeyboard|Qt::TextSelectableByMouse</set>
1028+
</property>
1029+
</widget>
1030+
</item>
1031+
<item>
1032+
<widget class="QWidget" name="hidePeersDetail" native="true">
1033+
<property name="enabled">
1034+
<bool>true</bool>
1035+
</property>
1036+
<property name="minimumSize">
1037+
<size>
1038+
<width>32</width>
1039+
<height>32</height>
1040+
</size>
1041+
</property>
1042+
<property name="maximumSize">
1043+
<size>
1044+
<width>32</width>
1045+
<height>32</height>
1046+
</size>
1047+
</property>
1048+
<widget class="QToolButton" name="hidePeersDetailButton">
1049+
<property name="geometry">
1050+
<rect>
1051+
<x>0</x>
1052+
<y>0</y>
1053+
<width>32</width>
1054+
<height>32</height>
1055+
</rect>
1056+
</property>
1057+
<property name="minimumSize">
1058+
<size>
1059+
<width>32</width>
1060+
<height>32</height>
1061+
</size>
1062+
</property>
1063+
<property name="baseSize">
1064+
<size>
1065+
<width>32</width>
1066+
<height>32</height>
1067+
</size>
1068+
</property>
1069+
<property name="toolTip">
1070+
<string>Hide Peers Detail</string>
1071+
</property>
1072+
<property name="layoutDirection">
1073+
<enum>Qt::LeftToRight</enum>
1074+
</property>
1075+
<property name="text">
1076+
<string />
1077+
</property>
1078+
<property name="icon">
1079+
<iconset resource="../bitcoin.qrc">
1080+
<normaloff>:/icons/remove</normaloff>
1081+
:/icons/remove
1082+
</iconset>
1083+
</property>
1084+
<property name="iconSize">
1085+
<size>
1086+
<width>22</width>
1087+
<height>22</height>
1088+
</size>
1089+
</property>
1090+
<property name="shortcut">
1091+
<string>Ctrl+X</string>
1092+
</property>
1093+
</widget>
1094+
</widget>
1095+
</item>
1096+
</layout>
1097+
</item>
10231098
<item>
10241099
<widget class="QScrollArea" name="scrollArea">
10251100
<property name="widgetResizable">

src/qt/rpcconsole.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -550,6 +550,7 @@ RPCConsole::RPCConsole(interfaces::Node& node, const PlatformStyle *_platformSty
550550
ui->lineEdit->setMaxLength(16 * 1024 * 1024);
551551
ui->messagesWidget->installEventFilter(this);
552552

553+
connect(ui->hidePeersDetailButton, &QAbstractButton::clicked, this, &RPCConsole::clearSelectedNode);
553554
connect(ui->clearButton, &QAbstractButton::clicked, [this] { clear(); });
554555
connect(ui->fontBiggerButton, &QAbstractButton::clicked, this, &RPCConsole::fontBigger);
555556
connect(ui->fontSmallerButton, &QAbstractButton::clicked, this, &RPCConsole::fontSmaller);
@@ -1221,6 +1222,7 @@ void RPCConsole::updateDetailWidget()
12211222
ui->peerRelayTxes->setText(stats->nodeStateStats.m_relay_txs ? ts.yes : ts.no);
12221223
}
12231224

1225+
ui->hidePeersDetailButton->setIcon(platformStyle->SingleColorIcon(QStringLiteral(":/icons/remove")));
12241226
ui->peersTabRightPanel->show();
12251227
}
12261228

0 commit comments

Comments
 (0)