Skip to content

Commit

Permalink
Update poll card and style sheets to show stale indicator
Browse files Browse the repository at this point in the history
  • Loading branch information
jamescowens committed Oct 30, 2023
1 parent 5c49d46 commit 0849fff
Show file tree
Hide file tree
Showing 4 changed files with 29 additions and 0 deletions.
7 changes: 7 additions & 0 deletions src/qt/forms/voting/pollcard.ui
Original file line number Diff line number Diff line change
Expand Up @@ -298,6 +298,13 @@
</property>
</spacer>
</item>
<item>
<widget class="QLabel" name="staleLabel">
<property name="text">
<string>Stale</string>
</property>
</widget>
</item>
<item>
<widget class="QLabel" name="validatedLabel">
<property name="text">
Expand Down
8 changes: 8 additions & 0 deletions src/qt/res/stylesheets/dark_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -994,6 +994,14 @@ PollCard #invalidLabel {
color: rgb(150, 0, 0);
}

PollCard #staleLabel {
border: 0.065em solid rgb(240, 0, 0);
border-radius: 0.65em;
padding: 0.1em 0.3em;
color: rgb(255, 255, 255);
background-color: rgb(240, 0, 0);
}

PollCard #remainingLabel,
PollResultChoiceItem #percentageLabel,
PollResultChoiceItem #weightLabel,
Expand Down
8 changes: 8 additions & 0 deletions src/qt/res/stylesheets/light_stylesheet.qss
Original file line number Diff line number Diff line change
Expand Up @@ -969,6 +969,14 @@ PollCard #invalidLabel {
color: rgb(150, 0, 0);
}

PollCard #staleLabel {
border: 0.065em solid rgb(240, 0, 0);
border-radius: 0.65em;
padding: 0.1em 0.3em;
color: rgb(255, 255, 255);
background-color: rgb(240, 0, 0);
}

PollCard #remainingLabel,
PollResultChoiceItem #percentageLabel,
PollResultChoiceItem #weightLabel,
Expand Down
6 changes: 6 additions & 0 deletions src/qt/voting/pollcard.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,6 +83,12 @@ PollCard::PollCard(const PollItem& poll_item, QWidget* parent)
ui->invalidLabel->show();
}

if (poll_item.m_stale) {
ui->staleLabel->show();
} else {
ui->staleLabel->hide();
}

ui->topAnswerLabel->setText(poll_item.m_top_answer);

if (!poll_item.m_finished) {
Expand Down

0 comments on commit 0849fff

Please sign in to comment.