From d956a1d3091f10b9cecb03c7e738f56ee9b0a5f3 Mon Sep 17 00:00:00 2001 From: Zach H Date: Wed, 15 Jul 2015 16:38:29 -0400 Subject: [PATCH] add colors to popup --- cockatrice/src/cardinfowidget.cpp | 9 +++++++++ cockatrice/src/cardinfowidget.h | 1 + 2 files changed, 10 insertions(+) diff --git a/cockatrice/src/cardinfowidget.cpp b/cockatrice/src/cardinfowidget.cpp index 57d59552..160e33f6 100644 --- a/cockatrice/src/cardinfowidget.cpp +++ b/cockatrice/src/cardinfowidget.cpp @@ -39,6 +39,9 @@ CardInfoWidget::CardInfoWidget(ResizeMode _mode, const QString &cardName, QWidge manacostLabel1 = new QLabel; manacostLabel2 = new QLabel; manacostLabel2->setWordWrap(true); + colorLabel1 = new QLabel; + colorLabel2 = new QLabel; + colorLabel2->setWordWrap(true); cardtypeLabel1 = new QLabel; cardtypeLabel2 = new QLabel; cardtypeLabel2->setWordWrap(true); @@ -59,6 +62,8 @@ CardInfoWidget::CardInfoWidget(ResizeMode _mode, const QString &cardName, QWidge grid->addWidget(nameLabel2, row++, 1); grid->addWidget(manacostLabel1, row, 0); grid->addWidget(manacostLabel2, row++, 1); + grid->addWidget(colorLabel1, row, 0); + grid->addWidget(colorLabel2, row++, 1); grid->addWidget(cardtypeLabel1, row, 0); grid->addWidget(cardtypeLabel2, row++, 1); grid->addWidget(powtoughLabel1, row, 0); @@ -117,6 +122,8 @@ void CardInfoWidget::setMinimized(int _minimized) nameLabel2->setVisible(showAll); manacostLabel1->setVisible(showAll); manacostLabel2->setVisible(showAll); + colorLabel1->setVisible(showAll); + colorLabel2->setVisible(showAll); cardtypeLabel1->setVisible(showAll); cardtypeLabel2->setVisible(showAll); powtoughLabel1->setVisible(showPowTough); @@ -153,6 +160,7 @@ void CardInfoWidget::setCard(CardInfo *card) updatePixmap(); nameLabel2->setText(card->getName()); manacostLabel2->setText(card->getManaCost()); + colorLabel2->setText(card->getColors().join("")); cardtypeLabel2->setText(card->getCardType()); powtoughLabel2->setText(card->getPowTough()); loyaltyLabel2->setText(card->getLoyalty() > 0 ? QString::number(card->getLoyalty()) : QString()); @@ -200,6 +208,7 @@ void CardInfoWidget::retranslateUi() { nameLabel1->setText(tr("Name:")); manacostLabel1->setText(tr("Mana cost:")); + colorLabel1->setText(tr("Color(s):")); cardtypeLabel1->setText(tr("Card type:")); powtoughLabel1->setText(tr("P / T:")); loyaltyLabel1->setText(tr("Loyalty:")); diff --git a/cockatrice/src/cardinfowidget.h b/cockatrice/src/cardinfowidget.h index b9988a7a..19e9cc61 100644 --- a/cockatrice/src/cardinfowidget.h +++ b/cockatrice/src/cardinfowidget.h @@ -31,6 +31,7 @@ private: QLabel *cardPicture; QLabel *nameLabel1, *nameLabel2; QLabel *manacostLabel1, *manacostLabel2; + QLabel *colorLabel1, *colorLabel2; QLabel *cardtypeLabel1, *cardtypeLabel2; QLabel *powtoughLabel1, *powtoughLabel2; QLabel *loyaltyLabel1, *loyaltyLabel2;