Widget for displaying a deck preview image with overlaid metadata labels. More...
#include <archidekt_deck_preview_image_display_widget.h>
Public Member Functions | |
| ArchidektDeckPreviewImageDisplayWidget (QWidget *parent=nullptr) | |
| Constructs the deck preview display widget. | |
| void | setAspectRatio (float ratio) |
| Sets the aspect ratio for the preview image (height / width). | |
| void | setPreviewWidth (int width) |
| Sets the width of the preview image; height is adjusted according to the aspect ratio. | |
Public Attributes | |
| QLabel * | imageLabel |
| QLabel to display the deck image. | |
| ShadowBackgroundLabel * | topLeftLabel |
| Overlay label at top-left (deck name) | |
| ShadowBackgroundLabel * | topRightLabel |
| Overlay label at top-right (card count) | |
| ShadowBackgroundLabel * | bottomLeftLabel |
| Overlay label at bottom-left (EDH bracket) | |
| ShadowBackgroundLabel * | bottomRightLabel |
| Overlay label at bottom-right (views) | |
Protected Member Functions | |
| void | resizeEvent (QResizeEvent *event) override |
| Handles resize events to reposition the image and overlay labels. | |
Private Attributes | |
| float | aspectRatio = 1.0f |
| Aspect ratio to maintain for the preview image. | |
Widget for displaying a deck preview image with overlaid metadata labels.
This widget shows a deck's preview image along with several overlay labels:
Labels automatically scale and position themselves relative to the widget's size. The image can be scaled while maintaining a specified aspect ratio.
|
explicit |
Constructs the deck preview display widget.
| parent | Optional parent widget. |
|
overrideprotected |
Handles resize events to reposition the image and overlay labels.
| event | Resize event. |
| void ArchidektDeckPreviewImageDisplayWidget::setAspectRatio | ( | float | ratio | ) |
Sets the aspect ratio for the preview image (height / width).
| ratio | Aspect ratio to maintain. |
| void ArchidektDeckPreviewImageDisplayWidget::setPreviewWidth | ( | int | width | ) |
Sets the width of the preview image; height is adjusted according to the aspect ratio.
| width | Desired width in pixels. |
|
private |
Aspect ratio to maintain for the preview image.
| ShadowBackgroundLabel* ArchidektDeckPreviewImageDisplayWidget::bottomLeftLabel |
Overlay label at bottom-left (EDH bracket)
| ShadowBackgroundLabel* ArchidektDeckPreviewImageDisplayWidget::bottomRightLabel |
Overlay label at bottom-right (views)
| QLabel* ArchidektDeckPreviewImageDisplayWidget::imageLabel |
QLabel to display the deck image.
| ShadowBackgroundLabel* ArchidektDeckPreviewImageDisplayWidget::topLeftLabel |
Overlay label at top-left (deck name)
| ShadowBackgroundLabel* ArchidektDeckPreviewImageDisplayWidget::topRightLabel |
Overlay label at top-right (card count)