#include <printing_selector_card_overlay_widget.h>
|
| void | updateCardAmounts (int mainboardAmount, int sideboardAmount, int tokensboardAmount) |
|
| void | resizeEvent (QResizeEvent *event) override |
| | Resizes the overlay widget to match the card's size.
|
| void | enterEvent (QEnterEvent *event) override |
| | Handles the mouse enter event when the cursor enters the overlay widget area.
|
| void | leaveEvent (QEvent *event) override |
| | Handles the mouse leave event when the cursor leaves the overlay widget area.
|
| void | mousePressEvent (QMouseEvent *event) override |
| | Handles the mouse press event for right-clicks to show the context menu.
|
| void | customMenu (QPoint point) |
| | Creates and shows the card-overlay context menu.
|
|
| void | updateVisibility () |
| | Sets the visibility of the widgets depending on the amounts and whether the mouse is hovering over.
|
| void | updatePinBadgeVisibility () |
| | Updates the pin badge visibility and position based on the card's pinned state.
|
|
| void | initializePinBadge () |
| | Initializes the pin badge overlay and loads its icon with DPI-aware rasterization.
|
| void | loadCustomImage () |
| | Asks for an image file and installs it as the card's custom art.
|
| void | showPreviewForAction (QAction *action) |
| | Shows the hover preview for a highlighted printing entry in the Image Overrides submenu.
|
| void | refreshPreview () |
| | Renders the hover preview for the currently highlighted printing.
|
| void | hidePreview () |
| | Hides the hover preview and forgets the currently highlighted printing.
|
◆ PrintingSelectorCardOverlayWidget()
Constructs a PrintingSelectorCardOverlayWidget for displaying a card overlay.
This widget is responsible for showing the card's image and providing interactive features such as a context menu and the ability to adjust the card's scale. It includes the card's image as well as a widget that displays the card amounts in different zones (mainboard, sideboard, etc.).
- Parameters
-
| parent | The parent widget for this overlay. |
| _deckEditor | The TabDeckEditor instance for deck management. |
| deckStateManager | The DeckStateManager instance providing deck data. |
| cardSizeSlider | The slider controlling the size of the card. |
| _rootCard | The root card object that contains information about the card. |
◆ cardPreferenceChanged
| void PrintingSelectorCardOverlayWidget::cardPreferenceChanged |
( |
| ) |
|
|
signal |
◆ customMenu()
| void PrintingSelectorCardOverlayWidget::customMenu |
( |
QPoint | point | ) |
|
|
protected |
Creates and shows the card-overlay context menu.
The menu includes the card art preference (Pin/Unpin Printing), the Image Overrides submenu (Load Custom Image, Clear Custom Image, and one entry per alternate printing with a live preview), and the Show Related cards submenu.
- Parameters
-
| point | The local position the menu should pop at. |
◆ enterEvent()
| void PrintingSelectorCardOverlayWidget::enterEvent |
( |
QEnterEvent * | event | ) |
|
|
overrideprotected |
Handles the mouse enter event when the cursor enters the overlay widget area.
When the cursor enters the widget, the card amount widget becomes visible regardless of whether the amounts are zero.
- Parameters
-
| event | The event triggered when the mouse enters the widget. |
◆ hidePreview()
| void PrintingSelectorCardOverlayWidget::hidePreview |
( |
| ) |
|
|
private |
Hides the hover preview and forgets the currently highlighted printing.
◆ initializePinBadge()
| void PrintingSelectorCardOverlayWidget::initializePinBadge |
( |
| ) |
|
|
private |
Initializes the pin badge overlay and loads its icon with DPI-aware rasterization.
The icon is rasterized once using the label's device pixel ratio so it stays crisp on HiDPI displays. The resulting pixmap is cached on the QLabel and simply shown/hidden when needed. If the SVG cannot be read, a textual fallback badge is created instead.
◆ leaveEvent()
| void PrintingSelectorCardOverlayWidget::leaveEvent |
( |
QEvent * | event | ) |
|
|
overrideprotected |
Handles the mouse leave event when the cursor leaves the overlay widget area.
When the cursor leaves the widget, the card amount widget is hidden if all of the mainboard, sideboard, and tokensboard amounts are zero.
- Parameters
-
| event | The event triggered when the mouse leaves the widget. |
◆ loadCustomImage()
| void PrintingSelectorCardOverlayWidget::loadCustomImage |
( |
| ) |
|
|
private |
Asks for an image file and installs it as the card's custom art.
Unreadable files answer with a visible warning instead of a silent no-op.
◆ mousePressEvent()
| void PrintingSelectorCardOverlayWidget::mousePressEvent |
( |
QMouseEvent * | event | ) |
|
|
overrideprotected |
Handles the mouse press event for right-clicks to show the context menu.
If the right mouse button is pressed, a custom context menu will appear. For other mouse buttons, the event is passed to the base class for default handling.
- Parameters
-
| event | The mouse event triggered by the user. |
◆ refreshPreview()
| void PrintingSelectorCardOverlayWidget::refreshPreview |
( |
| ) |
|
|
private |
Renders the hover preview for the currently highlighted printing.
The preview shows the loading placeholder while the art is pending and swaps in the real art when it resolves. The label is positioned against its already-resized geometry so the first-ever show at the screen's edges stays fully on-screen.
◆ resizeEvent()
| void PrintingSelectorCardOverlayWidget::resizeEvent |
( |
QResizeEvent * | event | ) |
|
|
overrideprotected |
Resizes the overlay widget to match the card's size.
This method ensures that the amount widget matches the card's size when the overlay widget is resized. It also resizes the card info picture widget to match the new size.
- Parameters
-
| event | The resize event triggered when the widget is resized. |
◆ showPreviewForAction()
| void PrintingSelectorCardOverlayWidget::showPreviewForAction |
( |
QAction * | action | ) |
|
|
private |
Shows the hover preview for a highlighted printing entry in the Image Overrides submenu.
QMenu::hovered fires on keyboard highlight too, so the preview appears when arrows walk onto a printing entry, not only under the mouse.
Non-printing entries (e.g., Load Custom Image, Clear Custom Image) hide the preview.
- Parameters
-
| action | The action that was highlighted. |
◆ updateCardAmounts
| void PrintingSelectorCardOverlayWidget::updateCardAmounts |
( |
int | mainboardAmount, |
|
|
int | sideboardAmount, |
|
|
int | tokensboardAmount ) |
|
slot |
◆ updatePinBadgeVisibility
| void PrintingSelectorCardOverlayWidget::updatePinBadgeVisibility |
( |
| ) |
|
|
privateslot |
Updates the pin badge visibility and position based on the card's pinned state.
This method checks whether the current card printing is pinned and updates the pin badge accordingly. If the card is pinned, the badge is made visible and positioned in the top-right corner of the card image with appropriate margins. If the card is not pinned, the badge is hidden.
The method is called whenever the card preference changes or the card size is adjusted via the slider to ensure the badge remains properly positioned.
◆ updateVisibility
| void PrintingSelectorCardOverlayWidget::updateVisibility |
( |
| ) |
|
|
privateslot |
Sets the visibility of the widgets depending on the amounts and whether the mouse is hovering over.
◆ allZonesCardAmountWidget
◆ cardInfoPicture
◆ cardOverridePreviewLabel
| QLabel* PrintingSelectorCardOverlayWidget::cardOverridePreviewLabel = nullptr |
|
private |
◆ deckEditor
◆ hoveredOverrideAction
| QAction* PrintingSelectorCardOverlayWidget::hoveredOverrideAction = nullptr |
|
private |
◆ hoveredOverrideCard
| ExactCard PrintingSelectorCardOverlayWidget::hoveredOverrideCard |
|
private |
◆ pinBadge
| QLabel* PrintingSelectorCardOverlayWidget::pinBadge = nullptr |
|
private |
◆ previewSourceMenu
| QMenu* PrintingSelectorCardOverlayWidget::previewSourceMenu = nullptr |
|
private |
◆ rootCard
| ExactCard PrintingSelectorCardOverlayWidget::rootCard |
|
private |
The documentation for this class was generated from the following files: