Skip to content

Commit

Permalink
GUI: Differentiate between not passing and over budget in mini-card
Browse files Browse the repository at this point in the history
Set a unique label text for proposals that are passing but there aren't
enough funds left in the budget to find them.
  • Loading branch information
Fuzzbawls committed Jan 23, 2022
1 parent 1d28002 commit 52cbb9e
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions src/qt/pivx/proposalcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ void ProposalCard::setProposal(const ProposalInfo& _proposalInfo)
ui->labelYes->setText(tr("Yes") + " " + QString::number(percentageYes) + "%");

QString cssClassStatus;
if (proposalInfo.status == ProposalInfo::WAITING_FOR_APPROVAL){
if (proposalInfo.status == ProposalInfo::WAITING_FOR_APPROVAL) {
cssClassStatus = "card-status-no-votes";
setStatusAndVotes(tr("Waiting"), 50);
} else if (proposalInfo.status == ProposalInfo::FINISHED) {
Expand All @@ -59,10 +59,12 @@ void ProposalCard::setProposal(const ProposalInfo& _proposalInfo)
} else if (totalVotes == 0) {
cssClassStatus = "card-status-no-votes";
setStatusAndVotes(tr("No Votes"), 50);
} else if (proposalInfo.status == ProposalInfo::NOT_PASSING ||
proposalInfo.status == ProposalInfo::PASSING_NOT_FUNDED) {
} else if (proposalInfo.status == ProposalInfo::NOT_PASSING) {
cssClassStatus = "card-status-not-passing";
setStatusAndVotes(tr("Not Passing"), (int)percentageNo);
setStatusAndVotes( tr("Not Passing"), (int)percentageNo);
} else if (proposalInfo.status == ProposalInfo::PASSING_NOT_FUNDED) {
cssClassStatus = "card-status-not-passing";
setStatusAndVotes( tr("Over Budget"), (int)percentageNo);
} else if (proposalInfo.status == ProposalInfo::PASSING) {
cssClassStatus = "card-status-passing";
setStatusAndVotes(tr("Passing"), (int)percentageNo);
Expand Down

0 comments on commit 52cbb9e

Please sign in to comment.