Skip to content

Commit

Permalink
Reapply "GUI/MempoolStats: Colour text of displayed labels to act as …
Browse files Browse the repository at this point in the history
…graph legend"

This reverts commit 452b156.
  • Loading branch information
luke-jr committed May 4, 2024
1 parent 4b3994f commit 518e99b
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/qt/mempoolstats.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,6 @@ void MempoolStats::drawChart()

cbShowMemUsage = new QCheckBox("Dynamic Memory Usage");
cbShowMemUsage->setChecked(true);
cbShowMemUsage->setStyleSheet("background-color: rgb(255,255,255);");
dynMemUsageSwitch = scene->addWidget(cbShowMemUsage);
connect(cbShowMemUsage, SIGNAL(stateChanged(int)), this, SLOT(drawChart()));
cbShowMemUsage->setFont(QFont(LABEL_FONT, LABEL_KV_SIZE, QFont::Light));
Expand All @@ -98,7 +97,6 @@ void MempoolStats::drawChart()

cbShowNumTxns = new QCheckBox("Amount of Transactions");
cbShowNumTxns->setChecked(true);
cbShowNumTxns->setStyleSheet("background-color: rgb(255,255,255);");
txCountSwitch = scene->addWidget(cbShowNumTxns);
scene->addItem(txCountSwitch);
connect(cbShowNumTxns, SIGNAL(stateChanged(int)), this, SLOT(drawChart()));
Expand All @@ -108,7 +106,6 @@ void MempoolStats::drawChart()

cbShowMinFeerate = new QCheckBox("MinRelayFee per KB");
cbShowMinFeerate->setChecked(false);
cbShowMinFeerate->setStyleSheet("background-color: rgb(255,255,255);");
minFeeSwitch = scene->addWidget(cbShowMinFeerate);
scene->addItem(minFeeSwitch);
connect(cbShowMinFeerate, SIGNAL(stateChanged(int)), this, SLOT(drawChart()));
Expand Down Expand Up @@ -138,6 +135,11 @@ void MempoolStats::drawChart()
allDataLabel->setFont(QFont(LABEL_FONT, LABEL_KV_SIZE, QFont::Light));
}

static const QString checkbox_style_base = QStringLiteral("background-color:rgb(255,255,255);");
cbShowNumTxns->setStyleSheet(cbShowNumTxns->isChecked() ? (checkbox_style_base + "color:rgb(188,49,62);") : checkbox_style_base);
cbShowMinFeerate->setStyleSheet(cbShowMinFeerate->isChecked() ? (checkbox_style_base + "color:rgb(49,113,62);") : checkbox_style_base);
cbShowMemUsage->setStyleSheet(cbShowMemUsage->isChecked() ? (checkbox_style_base + "color:rgb(15,68,113);") : checkbox_style_base);

last10MinLabel->setEnabled((timeFilter == TEN_MINS));
lastHourLabel->setEnabled((timeFilter == ONE_HOUR));
lastDayLabel->setEnabled((timeFilter == ONE_DAY));
Expand Down

0 comments on commit 518e99b

Please sign in to comment.