Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
printing_selector_card_overlay_widget.h
Go to the documentation of this file.
1
6
7#ifndef PRINTING_SELECTOR_CARD_OVERLAY_WIDGET_H
8#define PRINTING_SELECTOR_CARD_OVERLAY_WIDGET_H
9
11
12#include <QWidget>
13#include <qtmetamacros.h>
14
15class QAction;
16class QMenu;
21class QLabel;
22class QPoint;
23class QSlider;
24
26{
27 Q_OBJECT
28
29public:
30 explicit PrintingSelectorCardOverlayWidget(QWidget *parent,
31 AbstractTabDeckEditor *_deckEditor,
32 DeckStateManager *_deckStateManager,
33 QSlider *_cardSizeSlider,
34 const ExactCard &_rootCard);
35
36protected:
37 void resizeEvent(QResizeEvent *event) override;
38 void enterEvent(QEnterEvent *event) override;
39 void leaveEvent(QEvent *event) override;
40 void mousePressEvent(QMouseEvent *event) override;
41 void customMenu(QPoint point);
42
43signals:
45
46public slots:
47 void updateCardAmounts(int mainboardAmount, int sideboardAmount, int tokensboardAmount);
48
49private slots:
50 void updateVisibility();
52
53private:
54 void initializePinBadge();
55 void loadCustomImage();
56 void showPreviewForAction(QAction *action);
57 void refreshPreview();
58 void hidePreview();
61 QLabel *pinBadge = nullptr;
64 QLabel *cardOverridePreviewLabel = nullptr;
66 QMenu *previewSourceMenu = nullptr;
67 QAction *hoveredOverrideAction = nullptr;
68};
69
70#endif // PRINTING_SELECTOR_CARD_OVERLAY_WIDGET_H
AbstractTabDeckEditor is the base class for all deck editor tabs.
Definition abstract_tab_deck_editor.h:77
Definition all_zones_card_amount_widget.h:21
Widget that displays an enlarged image of a card, loading the image based on the card's info or showi...
Definition card_info_picture_widget.h:27
This class centralizes the management of the state of the deck in the deck editor tab....
Definition deck_state_manager.h:32
Represents a specific card instance, defined by its CardInfo and a particular printing.
Definition exact_card.h:24
ExactCard rootCard
Definition printing_selector_card_overlay_widget.h:63
void showPreviewForAction(QAction *action)
Shows the hover preview for a highlighted printing entry in the Image Overrides submenu.
Definition printing_selector_card_overlay_widget.cpp:495
QLabel * pinBadge
Definition printing_selector_card_overlay_widget.h:61
void updatePinBadgeVisibility()
Updates the pin badge visibility and position based on the card's pinned state.
Definition printing_selector_card_overlay_widget.cpp:245
void refreshPreview()
Renders the hover preview for the currently highlighted printing.
Definition printing_selector_card_overlay_widget.cpp:527
void updateCardAmounts(int mainboardAmount, int sideboardAmount, int tokensboardAmount)
Definition printing_selector_card_overlay_widget.cpp:214
QMenu * previewSourceMenu
Definition printing_selector_card_overlay_widget.h:66
CardInfoPictureWidget * cardInfoPicture
Definition printing_selector_card_overlay_widget.h:59
QAction * hoveredOverrideAction
Definition printing_selector_card_overlay_widget.h:67
AbstractTabDeckEditor * deckEditor
Definition printing_selector_card_overlay_widget.h:62
void mousePressEvent(QMouseEvent *event) override
Handles the mouse press event for right-clicks to show the context menu.
Definition printing_selector_card_overlay_widget.cpp:173
AllZonesCardAmountWidget * allZonesCardAmountWidget
Definition printing_selector_card_overlay_widget.h:60
void resizeEvent(QResizeEvent *event) override
Resizes the overlay widget to match the card's size.
Definition printing_selector_card_overlay_widget.cpp:190
ExactCard hoveredOverrideCard
Definition printing_selector_card_overlay_widget.h:65
QLabel * cardOverridePreviewLabel
Definition printing_selector_card_overlay_widget.h:64
void customMenu(QPoint point)
Creates and shows the card-overlay context menu.
Definition printing_selector_card_overlay_widget.cpp:293
void loadCustomImage()
Asks for an image file and installs it as the card's custom art.
Definition printing_selector_card_overlay_widget.cpp:463
void updateVisibility()
Sets the visibility of the widgets depending on the amounts and whether the mouse is hovering over.
Definition printing_selector_card_overlay_widget.cpp:225
void enterEvent(QEnterEvent *event) override
Handles the mouse enter event when the cursor enters the overlay widget area.
Definition printing_selector_card_overlay_widget.cpp:207
void leaveEvent(QEvent *event) override
Handles the mouse leave event when the cursor leaves the overlay widget area.
Definition printing_selector_card_overlay_widget.cpp:278
PrintingSelectorCardOverlayWidget(QWidget *parent, AbstractTabDeckEditor *_deckEditor, DeckStateManager *_deckStateManager, QSlider *_cardSizeSlider, const ExactCard &_rootCard)
Constructs a PrintingSelectorCardOverlayWidget for displaying a card overlay.
Definition printing_selector_card_overlay_widget.cpp:103
void hidePreview()
Hides the hover preview and forgets the currently highlighted printing.
Definition printing_selector_card_overlay_widget.cpp:581
void initializePinBadge()
Initializes the pin badge overlay and loads its icon with DPI-aware rasterization.
Definition printing_selector_card_overlay_widget.cpp:411