mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-09 01:23:57 -07:00
[CardInfoPictureWidget] Refactor constant fields to static const
This commit is contained in:
parent
5309dd17be
commit
0e33680c11
2 changed files with 14 additions and 8 deletions
|
|
@ -15,6 +15,18 @@
|
||||||
#include <libcockatrice/card/relation/card_relation.h>
|
#include <libcockatrice/card/relation/card_relation.h>
|
||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
|
static constexpr qreal magicTheGatheringCardAspectRatio = 1.396;
|
||||||
|
static constexpr qreal yuGiOhCardAspectRatio = 1.457;
|
||||||
|
static constexpr qreal aspectRatio = magicTheGatheringCardAspectRatio;
|
||||||
|
|
||||||
|
static constexpr int baseWidth = 200;
|
||||||
|
static constexpr int baseHeight = 200;
|
||||||
|
|
||||||
|
static constexpr int enlargedPixmapOffset = 10;
|
||||||
|
|
||||||
|
static constexpr int hoverActivateThresholdInMs = 500;
|
||||||
|
static constexpr int animationOffset = 10; // Adjust this for how much the widget moves up
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class CardInfoPictureWidget
|
* @class CardInfoPictureWidget
|
||||||
* @brief Widget that displays an enlarged image of a card, loading the image based on the card's info or showing a
|
* @brief Widget that displays an enlarged image of a card, loading the image based on the card's info or showing a
|
||||||
|
|
|
||||||
|
|
@ -68,23 +68,17 @@ protected:
|
||||||
|
|
||||||
private:
|
private:
|
||||||
ExactCard exactCard;
|
ExactCard exactCard;
|
||||||
qreal magicTheGatheringCardAspectRatio = 1.396;
|
|
||||||
qreal yuGiOhCardAspectRatio = 1.457;
|
|
||||||
qreal aspectRatio = magicTheGatheringCardAspectRatio;
|
|
||||||
int baseWidth = 200;
|
|
||||||
int baseHeight = 200;
|
|
||||||
double scaleFactor = 100;
|
double scaleFactor = 100;
|
||||||
QPixmap resizedPixmap;
|
QPixmap resizedPixmap;
|
||||||
bool pixmapDirty;
|
bool pixmapDirty;
|
||||||
bool hoverToZoomEnabled;
|
bool hoverToZoomEnabled;
|
||||||
bool raiseOnEnter;
|
bool raiseOnEnter;
|
||||||
int hoverActivateThresholdInMs = 500;
|
|
||||||
CardInfoPictureEnlargedWidget *enlargedPixmapWidget = nullptr;
|
CardInfoPictureEnlargedWidget *enlargedPixmapWidget = nullptr;
|
||||||
int enlargedPixmapOffset = 10;
|
|
||||||
QTimer *hoverTimer;
|
QTimer *hoverTimer;
|
||||||
QPropertyAnimation *animation;
|
QPropertyAnimation *animation;
|
||||||
QPoint originalPos; // Store the original position
|
QPoint originalPos; // Store the original position
|
||||||
const int animationOffset = 10; // Adjust this for how much the widget moves up
|
|
||||||
|
|
||||||
QMenu *createRightClickMenu();
|
QMenu *createRightClickMenu();
|
||||||
QMenu *createViewRelatedCardsMenu();
|
QMenu *createViewRelatedCardsMenu();
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue