diff --git a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp index 7206c05c9..69f746edb 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp +++ b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.cpp @@ -15,6 +15,18 @@ #include #include +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 diff --git a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.h b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.h index c9dbc47ab..58b4b1361 100644 --- a/cockatrice/src/interface/widgets/cards/card_info_picture_widget.h +++ b/cockatrice/src/interface/widgets/cards/card_info_picture_widget.h @@ -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();