Re-add commander label.

This commit is contained in:
Lukas Brübach 2025-04-18 20:43:50 +02:00
parent 7ce895e23a
commit 8c711ac701
2 changed files with 9 additions and 1 deletions

View file

@ -8,6 +8,8 @@ EdhrecApiResponseCardInclusionDisplayWidget::EdhrecApiResponseCardInclusionDispl
layout = new QVBoxLayout(this); layout = new QVBoxLayout(this);
setLayout(layout); setLayout(layout);
commanderLabel = new QLabel(this);
commanderLabel->setAlignment(Qt::AlignCenter);
amountLabel = new QLabel(this); amountLabel = new QLabel(this);
amountLabel->setAlignment(Qt::AlignCenter); amountLabel->setAlignment(Qt::AlignCenter);
inclusionLabel = new QLabel(this); inclusionLabel = new QLabel(this);
@ -18,8 +20,12 @@ EdhrecApiResponseCardInclusionDisplayWidget::EdhrecApiResponseCardInclusionDispl
layout->addWidget(amountLabel); layout->addWidget(amountLabel);
layout->addWidget(inclusionLabel); layout->addWidget(inclusionLabel);
layout->addWidget(percentBarWidget); layout->addWidget(percentBarWidget);
commanderLabel->hide();
} else { } else {
hide(); amountLabel->hide();
inclusionLabel->hide();
percentBarWidget->hide();
layout->addWidget(commanderLabel);
} }
retranslateUi(); retranslateUi();
@ -27,6 +33,7 @@ EdhrecApiResponseCardInclusionDisplayWidget::EdhrecApiResponseCardInclusionDispl
void EdhrecApiResponseCardInclusionDisplayWidget::retranslateUi() void EdhrecApiResponseCardInclusionDisplayWidget::retranslateUi()
{ {
commanderLabel->setText(toDisplay.label);
amountLabel->setText(tr("In %1 decks").arg(QString::number(toDisplay.inclusion))); amountLabel->setText(tr("In %1 decks").arg(QString::number(toDisplay.inclusion)));
inclusionLabel->setText(tr("%1% of %2 decks") inclusionLabel->setText(tr("%1% of %2 decks")
.arg(QString::number(toDisplay.inclusion / (toDisplay.potentialDecks / 100.0), 'f', 2), .arg(QString::number(toDisplay.inclusion / (toDisplay.potentialDecks / 100.0), 'f', 2),

View file

@ -18,6 +18,7 @@ public:
private: private:
QVBoxLayout *layout; QVBoxLayout *layout;
EdhrecApiResponseCardDetails toDisplay; EdhrecApiResponseCardDetails toDisplay;
QLabel *commanderLabel;
QLabel *amountLabel; QLabel *amountLabel;
QLabel *inclusionLabel; QLabel *inclusionLabel;
PercentBarWidget *percentBarWidget; PercentBarWidget *percentBarWidget;