Cockatrice 2026-10-19-Development-3.1.2-beta.2
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
archidekt_deck_preview_image_display_widget.h
Go to the documentation of this file.
1#ifndef COCKATRICE_ARCHIDEKT_DECK_PREVIEW_IMAGE_DISPLAY_WIDGET_H
2#define COCKATRICE_ARCHIDEKT_DECK_PREVIEW_IMAGE_DISPLAY_WIDGET_H
3
4#include <QWidget>
5#include <qtmetamacros.h>
6
7class QLabel;
9
29{
30 Q_OBJECT
31public:
36 explicit ArchidektDeckPreviewImageDisplayWidget(QWidget *parent = nullptr);
37
42 void setAspectRatio(float ratio);
43
48 void setPreviewWidth(int width);
49
50 QLabel *imageLabel;
55
56protected:
61 void resizeEvent(QResizeEvent *event) override;
62
63private:
64 float aspectRatio = 1.0f;
65};
66
67#endif // COCKATRICE_ARCHIDEKT_DECK_PREVIEW_IMAGE_DISPLAY_WIDGET_H
ShadowBackgroundLabel * bottomRightLabel
Overlay label at bottom-right (views).
Definition archidekt_deck_preview_image_display_widget.h:54
void setPreviewWidth(int width)
Sets the width of the preview image; height is adjusted according to the aspect ratio.
Definition archidekt_deck_preview_image_display_widget.cpp:40
float aspectRatio
Aspect ratio to maintain for the preview image.
Definition archidekt_deck_preview_image_display_widget.h:64
ShadowBackgroundLabel * bottomLeftLabel
Overlay label at bottom-left (EDH bracket).
Definition archidekt_deck_preview_image_display_widget.h:53
ShadowBackgroundLabel * topRightLabel
Overlay label at top-right (card count).
Definition archidekt_deck_preview_image_display_widget.h:52
ArchidektDeckPreviewImageDisplayWidget(QWidget *parent=nullptr)
Constructs the deck preview display widget.
Definition archidekt_deck_preview_image_display_widget.cpp:10
void resizeEvent(QResizeEvent *event) override
Handles resize events to reposition the image and overlay labels.
Definition archidekt_deck_preview_image_display_widget.cpp:49
QLabel * imageLabel
QLabel to display the deck image.
Definition archidekt_deck_preview_image_display_widget.h:50
void setAspectRatio(float ratio)
Sets the aspect ratio for the preview image (height / width).
Definition archidekt_deck_preview_image_display_widget.cpp:35
ShadowBackgroundLabel * topLeftLabel
Overlay label at top-left (deck name).
Definition archidekt_deck_preview_image_display_widget.h:51
A QLabel with a semi-transparent black shadowed background and rounded corners.
Definition shadow_background_label.h:17