mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 16:24:45 -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
|
|
@ -6,48 +6,48 @@
|
|||
#include "main.h"
|
||||
|
||||
CardInfoPicture::CardInfoPicture(int maximumWidth, QWidget *parent)
|
||||
: QLabel(parent)
|
||||
, info(0)
|
||||
, noPicture(true)
|
||||
: QLabel(parent)
|
||||
, info(0)
|
||||
, noPicture(true)
|
||||
{
|
||||
setMaximumWidth(maximumWidth);
|
||||
setMaximumWidth(maximumWidth);
|
||||
}
|
||||
|
||||
void CardInfoPicture::setNoPicture(bool status)
|
||||
{
|
||||
if (noPicture != status) {
|
||||
noPicture = status;
|
||||
emit hasPictureChanged();
|
||||
}
|
||||
if (noPicture != status) {
|
||||
noPicture = status;
|
||||
emit hasPictureChanged();
|
||||
}
|
||||
}
|
||||
|
||||
void CardInfoPicture::setCard(CardInfo *card)
|
||||
{
|
||||
if (info)
|
||||
disconnect(info, 0, this, 0);
|
||||
info = card;
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
if (info)
|
||||
disconnect(info, 0, this, 0);
|
||||
info = card;
|
||||
connect(info, SIGNAL(pixmapUpdated()), this, SLOT(updatePixmap()));
|
||||
|
||||
updatePixmap();
|
||||
updatePixmap();
|
||||
}
|
||||
|
||||
void CardInfoPicture::updatePixmap()
|
||||
{
|
||||
qreal aspectRatio = (qreal) CARD_HEIGHT / (qreal) CARD_WIDTH;
|
||||
qreal pixmapWidth = this->width();
|
||||
qreal aspectRatio = (qreal) CARD_HEIGHT / (qreal) CARD_WIDTH;
|
||||
qreal pixmapWidth = this->width();
|
||||
|
||||
if (pixmapWidth == 0) {
|
||||
setNoPicture(true);
|
||||
return;
|
||||
}
|
||||
if (pixmapWidth == 0) {
|
||||
setNoPicture(true);
|
||||
return;
|
||||
}
|
||||
|
||||
QPixmap *resizedPixmap = info->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio));
|
||||
if (resizedPixmap) {
|
||||
setNoPicture(false);
|
||||
this->setPixmap(*resizedPixmap);
|
||||
}
|
||||
else {
|
||||
setNoPicture(true);
|
||||
this->setPixmap(*(db->getCard()->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio))));
|
||||
}
|
||||
QPixmap *resizedPixmap = info->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio));
|
||||
if (resizedPixmap) {
|
||||
setNoPicture(false);
|
||||
this->setPixmap(*resizedPixmap);
|
||||
}
|
||||
else {
|
||||
setNoPicture(true);
|
||||
this->setPixmap(*(db->getCard()->getPixmap(QSize(pixmapWidth, pixmapWidth * aspectRatio))));
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue