mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
change tabs into 4 spaces in new files
This commit is contained in:
parent
0770626270
commit
cd4d04be3e
16 changed files with 759 additions and 759 deletions
|
|
@ -7,53 +7,53 @@
|
|||
#include "cardinfotext.h"
|
||||
|
||||
CardFrame::CardFrame(int width, int height,
|
||||
const QString &cardName, QWidget *parent)
|
||||
: QStackedWidget(parent)
|
||||
, info(0)
|
||||
, cardTextOnly(false)
|
||||
const QString &cardName, QWidget *parent)
|
||||
: QStackedWidget(parent)
|
||||
, info(0)
|
||||
, cardTextOnly(false)
|
||||
{
|
||||
setFrameStyle(QFrame::Panel | QFrame::Raised);
|
||||
setMaximumWidth(width);
|
||||
setMinimumWidth(width);
|
||||
setMaximumHeight(height);
|
||||
setMinimumHeight(height);
|
||||
pic = new CardInfoPicture(width);
|
||||
addWidget(pic);
|
||||
text = new CardInfoText();
|
||||
addWidget(text);
|
||||
connect(pic, SIGNAL(hasPictureChanged()), this, SLOT(hasPictureChanged()));
|
||||
setCard(db->getCard(cardName));
|
||||
setFrameStyle(QFrame::Panel | QFrame::Raised);
|
||||
setMaximumWidth(width);
|
||||
setMinimumWidth(width);
|
||||
setMaximumHeight(height);
|
||||
setMinimumHeight(height);
|
||||
pic = new CardInfoPicture(width);
|
||||
addWidget(pic);
|
||||
text = new CardInfoText();
|
||||
addWidget(text);
|
||||
connect(pic, SIGNAL(hasPictureChanged()), this, SLOT(hasPictureChanged()));
|
||||
setCard(db->getCard(cardName));
|
||||
}
|
||||
|
||||
void CardFrame::setCard(CardInfo *card)
|
||||
{
|
||||
if (info)
|
||||
disconnect(info, 0, this, 0);
|
||||
info = card;
|
||||
connect(info, SIGNAL(destroyed()), this, SLOT(clear()));
|
||||
text->setCard(info);
|
||||
pic->setCard(info);
|
||||
if (info)
|
||||
disconnect(info, 0, this, 0);
|
||||
info = card;
|
||||
connect(info, SIGNAL(destroyed()), this, SLOT(clear()));
|
||||
text->setCard(info);
|
||||
pic->setCard(info);
|
||||
}
|
||||
|
||||
void CardFrame::setCard(const QString &cardName)
|
||||
{
|
||||
setCard(db->getCard(cardName));
|
||||
setCard(db->getCard(cardName));
|
||||
}
|
||||
|
||||
void CardFrame::setCard(AbstractCardItem *card)
|
||||
{
|
||||
setCard(card->getInfo());
|
||||
setCard(card->getInfo());
|
||||
}
|
||||
|
||||
void CardFrame::clear()
|
||||
{
|
||||
setCard(db->getCard());
|
||||
setCard(db->getCard());
|
||||
}
|
||||
|
||||
void CardFrame::hasPictureChanged()
|
||||
{
|
||||
if (pic->hasPicture() && !cardTextOnly)
|
||||
setCurrentWidget(pic);
|
||||
else
|
||||
setCurrentWidget(text);
|
||||
if (pic->hasPicture() && !cardTextOnly)
|
||||
setCurrentWidget(pic);
|
||||
else
|
||||
setCurrentWidget(text);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue