Skip to content

Commit 0b7d6ac

Browse files
committed
gui: network graph - show/hide slider based on click event
1 parent 6169d95 commit 0b7d6ac

2 files changed

Lines changed: 111 additions & 206 deletions

File tree

src/qt/forms/debugwindow.ui

Lines changed: 109 additions & 186 deletions
Original file line numberDiff line numberDiff line change
@@ -623,6 +623,115 @@
623623
<verstretch>0</verstretch>
624624
</sizepolicy>
625625
</property>
626+
<layout class="QGridLayout" name="totalsGridLayout">
627+
<item row="0" column="1">
628+
<widget class="QGroupBox" name="totalsGroupBox">
629+
<property name="minimumSize">
630+
<size>
631+
<width>160</width>
632+
<height>40</height>
633+
</size>
634+
</property>
635+
<property name="styleSheet">
636+
<string notr="true">background:rgba(0, 0, 0, 64)</string>
637+
</property>
638+
<layout class="QGridLayout" name="sentLayout">
639+
<item row="1" column="0">
640+
<layout class="QHBoxLayout" name="sentHorzLayout">
641+
<item>
642+
<widget class="QLabel" name="sentLabel">
643+
<property name="styleSheet">
644+
<string notr="true">background:rgba(0, 0, 0, 16);color:rgb(255, 0, 0, 255)</string>
645+
</property>
646+
<property name="text">
647+
<string>Sent</string>
648+
</property>
649+
</widget>
650+
</item>
651+
<item>
652+
<widget class="QLabel" name="lblBytesOut">
653+
<property name="minimumSize">
654+
<size>
655+
<width>50</width>
656+
<height>0</height>
657+
</size>
658+
</property>
659+
<property name="styleSheet">
660+
<string notr="true">background:rgba(0, 0, 0, 16);color:rgb(255, 255, 255, 255)</string>
661+
</property>
662+
<property name="text">
663+
<string>### MB</string>
664+
</property>
665+
<property name="alignment">
666+
<set>Qt::AlignTrailing|Qt::AlignRight|Qt::AlignVCenter</set>
667+
</property>
668+
</widget>
669+
</item>
670+
</layout>
671+
</item>
672+
<item row="0" column="0">
673+
<layout class="QHBoxLayout" name="receivedHorzLayout">
674+
<item>
675+
<widget class="QLabel" name="receivedLabel">
676+
<property name="styleSheet">
677+
<string notr="true">background:rgba(0, 0, 0, 16);color:rgb(0, 255, 0)</string>
678+
</property>
679+
<property name="text">
680+
<string>Received</string>
681+
</property>
682+
</widget>
683+
</item>
684+
<item>
685+
<widget class="QLabel" name="lblBytesIn">
686+
<property name="minimumSize">
687+
<size>
688+
<width>50</width>
689+
<height>0</height>
690+
</size>
691+
</property>
692+
<property name="styleSheet">
693+
<string notr="true">background:rgba(0, 0, 0, 16);color:white</string>
694+
</property>
695+
<property name="text">
696+
<string>### MB</string>
697+
</property>
698+
<property name="alignment">
699+
<set>Qt::AlignTrailing|Qt::AlignRight|Qt::AlignVCenter</set>
700+
</property>
701+
</widget>
702+
</item>
703+
</layout>
704+
</item>
705+
</layout>
706+
</widget>
707+
</item>
708+
<item row="1" column="1">
709+
<spacer name="verticalSpacer_4">
710+
<property name="orientation">
711+
<enum>Qt::Vertical</enum>
712+
</property>
713+
<property name="sizeHint" stdset="0">
714+
<size>
715+
<width>20</width>
716+
<height>40</height>
717+
</size>
718+
</property>
719+
</spacer>
720+
</item>
721+
<item row="0" column="2">
722+
<spacer name="horizontalSpacer_2">
723+
<property name="orientation">
724+
<enum>Qt::Horizontal</enum>
725+
</property>
726+
<property name="sizeHint" stdset="0">
727+
<size>
728+
<width>985</width>
729+
<height>20</height>
730+
</size>
731+
</property>
732+
</spacer>
733+
</item>
734+
</layout>
626735
</widget>
627736
</item>
628737
<item>
@@ -673,192 +782,6 @@
673782
</item>
674783
</layout>
675784
</item>
676-
<item>
677-
<layout class="QVBoxLayout" name="verticalLayout">
678-
<item>
679-
<widget class="QGroupBox" name="groupBox">
680-
<property name="title">
681-
<string>Totals</string>
682-
</property>
683-
<layout class="QVBoxLayout" name="verticalLayout_5">
684-
<item>
685-
<layout class="QHBoxLayout" name="horizontalLayout_4">
686-
<item>
687-
<widget class="Line" name="line">
688-
<property name="sizePolicy">
689-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
690-
<horstretch>0</horstretch>
691-
<verstretch>0</verstretch>
692-
</sizepolicy>
693-
</property>
694-
<property name="minimumSize">
695-
<size>
696-
<width>10</width>
697-
<height>0</height>
698-
</size>
699-
</property>
700-
<property name="palette">
701-
<palette>
702-
<active>
703-
<colorrole role="Light">
704-
<brush brushstyle="SolidPattern">
705-
<color alpha="255">
706-
<red>0</red>
707-
<green>255</green>
708-
<blue>0</blue>
709-
</color>
710-
</brush>
711-
</colorrole>
712-
</active>
713-
<inactive>
714-
<colorrole role="Light">
715-
<brush brushstyle="SolidPattern">
716-
<color alpha="255">
717-
<red>0</red>
718-
<green>255</green>
719-
<blue>0</blue>
720-
</color>
721-
</brush>
722-
</colorrole>
723-
</inactive>
724-
<disabled>
725-
<colorrole role="Light">
726-
<brush brushstyle="SolidPattern">
727-
<color alpha="255">
728-
<red>0</red>
729-
<green>255</green>
730-
<blue>0</blue>
731-
</color>
732-
</brush>
733-
</colorrole>
734-
</disabled>
735-
</palette>
736-
</property>
737-
<property name="orientation">
738-
<enum>Qt::Horizontal</enum>
739-
</property>
740-
</widget>
741-
</item>
742-
<item>
743-
<widget class="QLabel" name="label_16">
744-
<property name="text">
745-
<string>Received</string>
746-
</property>
747-
</widget>
748-
</item>
749-
<item>
750-
<widget class="QLabel" name="lblBytesIn">
751-
<property name="minimumSize">
752-
<size>
753-
<width>50</width>
754-
<height>0</height>
755-
</size>
756-
</property>
757-
<property name="alignment">
758-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
759-
</property>
760-
</widget>
761-
</item>
762-
</layout>
763-
</item>
764-
<item>
765-
<layout class="QHBoxLayout" name="horizontalLayout_5">
766-
<item>
767-
<widget class="Line" name="line_2">
768-
<property name="sizePolicy">
769-
<sizepolicy hsizetype="Fixed" vsizetype="Fixed">
770-
<horstretch>0</horstretch>
771-
<verstretch>0</verstretch>
772-
</sizepolicy>
773-
</property>
774-
<property name="minimumSize">
775-
<size>
776-
<width>10</width>
777-
<height>0</height>
778-
</size>
779-
</property>
780-
<property name="palette">
781-
<palette>
782-
<active>
783-
<colorrole role="Light">
784-
<brush brushstyle="SolidPattern">
785-
<color alpha="255">
786-
<red>255</red>
787-
<green>0</green>
788-
<blue>0</blue>
789-
</color>
790-
</brush>
791-
</colorrole>
792-
</active>
793-
<inactive>
794-
<colorrole role="Light">
795-
<brush brushstyle="SolidPattern">
796-
<color alpha="255">
797-
<red>255</red>
798-
<green>0</green>
799-
<blue>0</blue>
800-
</color>
801-
</brush>
802-
</colorrole>
803-
</inactive>
804-
<disabled>
805-
<colorrole role="Light">
806-
<brush brushstyle="SolidPattern">
807-
<color alpha="255">
808-
<red>255</red>
809-
<green>0</green>
810-
<blue>0</blue>
811-
</color>
812-
</brush>
813-
</colorrole>
814-
</disabled>
815-
</palette>
816-
</property>
817-
<property name="orientation">
818-
<enum>Qt::Horizontal</enum>
819-
</property>
820-
</widget>
821-
</item>
822-
<item>
823-
<widget class="QLabel" name="label_17">
824-
<property name="text">
825-
<string>Sent</string>
826-
</property>
827-
</widget>
828-
</item>
829-
<item>
830-
<widget class="QLabel" name="lblBytesOut">
831-
<property name="minimumSize">
832-
<size>
833-
<width>50</width>
834-
<height>0</height>
835-
</size>
836-
</property>
837-
<property name="alignment">
838-
<set>Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter</set>
839-
</property>
840-
</widget>
841-
</item>
842-
</layout>
843-
</item>
844-
<item>
845-
<spacer name="verticalSpacer_4">
846-
<property name="orientation">
847-
<enum>Qt::Vertical</enum>
848-
</property>
849-
<property name="sizeHint" stdset="0">
850-
<size>
851-
<width>20</width>
852-
<height>407</height>
853-
</size>
854-
</property>
855-
</spacer>
856-
</item>
857-
</layout>
858-
</widget>
859-
</item>
860-
</layout>
861-
</item>
862785
</layout>
863786
</widget>
864787
<widget class="QWidget" name="tab_peers">

src/qt/rpcconsole.cpp

Lines changed: 2 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -650,14 +650,8 @@ bool RPCConsole::eventFilter(QObject* obj, QEvent *event)
650650
return QWidget::eventFilter(obj, event);
651651
}
652652

653-
void RPCConsole::onTrafficGraphClicked(){
654-
655-
LogPrintf("%s panelToggle = %s\n", __func__, ui->trafficGraph->panelToggle);
656-
if (ui->trafficGraph->panelToggle){
657-
ui->groupBox->hide();
658-
}else{
659-
ui->groupBox->show();
660-
}
653+
void RPCConsole::onTrafficGraphClicked()
654+
{
661655
if (ui->trafficGraph->panelToggle){
662656
ui->sldGraphRange->hide();
663657
ui->lblGraphRange->hide();
@@ -667,11 +661,6 @@ void RPCConsole::onTrafficGraphClicked(){
667661
ui->lblGraphRange->show();
668662
ui->btnClearTrafficGraph->show();
669663
}
670-
671-
672-
673-
674-
675664
}
676665

677666
void RPCConsole::setClientModel(ClientModel *model, int bestblock_height, int64_t bestblock_date, double verification_progress)
@@ -1253,11 +1242,6 @@ void RPCConsole::updateDetailWidget()
12531242
void RPCConsole::resizeEvent(QResizeEvent *event)
12541243
{
12551244
QWidget::resizeEvent(event);
1256-
if (width()<=minimumWidth()*2){
1257-
ui->groupBox->hide();
1258-
}else{
1259-
ui->groupBox->show();
1260-
}
12611245
if (height()==minimumHeight()){
12621246
ui->sldGraphRange->hide();
12631247
ui->lblGraphRange->hide();
@@ -1267,8 +1251,6 @@ void RPCConsole::resizeEvent(QResizeEvent *event)
12671251
ui->lblGraphRange->show();
12681252
ui->btnClearTrafficGraph->show();
12691253
}
1270-
1271-
12721254
}
12731255

12741256
void RPCConsole::showEvent(QShowEvent *event)

0 commit comments

Comments
 (0)