mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-08 17:13:57 -07:00
refactor cardframe as a parent of a text card frame and a picture card frame
cardframe is now a stacked widget that prefers to show the card picture only so that the screen can be more space efficient and the card pixel map can be displayed as a larger size. however if the card pixel map can not be loaded for some reason, the cardframe class will automatically switch to the text version of the card. a menu item was added under the database menu to allow for users to prefer card text only.
This commit is contained in:
parent
5d223b5917
commit
f77054f20d
9 changed files with 231 additions and 34 deletions
34
cockatrice/src/cardinfopicture.h
Normal file
34
cockatrice/src/cardinfopicture.h
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
#ifndef CARDINFOPICTURE_H
|
||||
#define CARDINFOPICTURE_H
|
||||
|
||||
#include <QLabel>
|
||||
|
||||
class AbstractCardItem;
|
||||
class CardInfo;
|
||||
|
||||
class CardInfoPicture : public QLabel {
|
||||
Q_OBJECT
|
||||
|
||||
signals:
|
||||
void hasPictureChanged();
|
||||
|
||||
private:
|
||||
CardInfo *info;
|
||||
bool noPicture;
|
||||
|
||||
public:
|
||||
CardInfoPicture(int maximumWidth, QWidget *parent = 0);
|
||||
bool hasPicture() const { return !noPicture; }
|
||||
|
||||
private:
|
||||
void setNoPicture(bool status);
|
||||
|
||||
public slots:
|
||||
void setCard(CardInfo *card);
|
||||
|
||||
private slots:
|
||||
void updatePixmap();
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
Loading…
Add table
Add a link
Reference in a new issue