mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-07 16:53:00 -07:00
CardInfoWidget improvement by Absinthe and Hellkeepa
This commit is contained in:
parent
a03bf8884f
commit
9cfe4bea59
4 changed files with 82 additions and 6 deletions
|
|
@ -2,6 +2,8 @@
|
|||
#define CARDINFOWIDGET_H
|
||||
|
||||
#include <QFrame>
|
||||
#include <QStringList>
|
||||
#include <QComboBox>
|
||||
|
||||
class QLabel;
|
||||
class QTextEdit;
|
||||
|
|
@ -13,34 +15,44 @@ class QMouseEvent;
|
|||
|
||||
class CardInfoWidget : public QFrame {
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
enum ResizeMode { ModeDeckEditor, ModeGameTab, ModePopUp };
|
||||
|
||||
private:
|
||||
int pixmapWidth;
|
||||
qreal aspectRatio;
|
||||
bool minimized;
|
||||
int minimized; // 0 - minimized, 1 - card, 2 - oracle only, 3 - full
|
||||
ResizeMode mode;
|
||||
|
||||
QComboBox *dropList;
|
||||
QLabel *cardPicture;
|
||||
QLabel *nameLabel1, *nameLabel2;
|
||||
QLabel *manacostLabel1, *manacostLabel2;
|
||||
QLabel *cardtypeLabel1, *cardtypeLabel2;
|
||||
QLabel *powtoughLabel1, *powtoughLabel2;
|
||||
QTextEdit *textLabel;
|
||||
|
||||
|
||||
CardInfo *info;
|
||||
void setMinimized(int _minimized);
|
||||
|
||||
public:
|
||||
CardInfoWidget(ResizeMode _mode, QWidget *parent = 0, Qt::WindowFlags f = 0);
|
||||
void retranslateUi();
|
||||
|
||||
public slots:
|
||||
void setCard(CardInfo *card);
|
||||
void setCard(const QString &cardName);
|
||||
void setCard(AbstractCardItem *card);
|
||||
|
||||
private slots:
|
||||
void clear();
|
||||
void updatePixmap();
|
||||
void minimizeClicked(int newMinimized);
|
||||
|
||||
signals:
|
||||
void mouseReleased();
|
||||
|
||||
protected:
|
||||
void resizeEvent(QResizeEvent *event);
|
||||
void mouseReleaseEvent(QMouseEvent *event);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue