[CardInfoPictureWidget] Refactor constant fields to static const

This commit is contained in:
RickyRister 2026-01-26 03:34:13 -08:00
parent 5309dd17be
commit 0e33680c11
2 changed files with 14 additions and 8 deletions

View file

@ -15,6 +15,18 @@
#include <libcockatrice/card/relation/card_relation.h>
#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
* @brief Widget that displays an enlarged image of a card, loading the image based on the card's info or showing a

View file

@ -68,23 +68,17 @@ protected:
private:
ExactCard exactCard;
qreal magicTheGatheringCardAspectRatio = 1.396;
qreal yuGiOhCardAspectRatio = 1.457;
qreal aspectRatio = magicTheGatheringCardAspectRatio;
int baseWidth = 200;
int baseHeight = 200;
double scaleFactor = 100;
QPixmap resizedPixmap;
bool pixmapDirty;
bool hoverToZoomEnabled;
bool raiseOnEnter;
int hoverActivateThresholdInMs = 500;
CardInfoPictureEnlargedWidget *enlargedPixmapWidget = nullptr;
int enlargedPixmapOffset = 10;
QTimer *hoverTimer;
QPropertyAnimation *animation;
QPoint originalPos; // Store the original position
const int animationOffset = 10; // Adjust this for how much the widget moves up
QMenu *createRightClickMenu();
QMenu *createViewRelatedCardsMenu();