Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform 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
5
6#include <QLabel>
7#include <QWidget>
8
28{
29 Q_OBJECT
30public:
35 explicit ArchidektDeckPreviewImageDisplayWidget(QWidget *parent = nullptr);
36
41 void setAspectRatio(float ratio);
42
47 void setPreviewWidth(int width);
48
49 QLabel *imageLabel;
54
55protected:
60 void resizeEvent(QResizeEvent *event) override;
61
62private:
63 float aspectRatio = 1.0f;
64};
65
66#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:53
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:36
float aspectRatio
Aspect ratio to maintain for the preview image.
Definition archidekt_deck_preview_image_display_widget.h:63
ShadowBackgroundLabel * bottomLeftLabel
Overlay label at bottom-left (EDH bracket)
Definition archidekt_deck_preview_image_display_widget.h:52
ShadowBackgroundLabel * topRightLabel
Overlay label at top-right (card count)
Definition archidekt_deck_preview_image_display_widget.h:51
ArchidektDeckPreviewImageDisplayWidget(QWidget *parent=nullptr)
Constructs the deck preview display widget.
Definition archidekt_deck_preview_image_display_widget.cpp:6
void resizeEvent(QResizeEvent *event) override
Handles resize events to reposition the image and overlay labels.
Definition archidekt_deck_preview_image_display_widget.cpp:45
QLabel * imageLabel
QLabel to display the deck image.
Definition archidekt_deck_preview_image_display_widget.h:49
void setAspectRatio(float ratio)
Sets the aspect ratio for the preview image (height / width).
Definition archidekt_deck_preview_image_display_widget.cpp:31
ShadowBackgroundLabel * topLeftLabel
Overlay label at top-left (deck name)
Definition archidekt_deck_preview_image_display_widget.h:50
A QLabel with a semi-transparent black shadowed background and rounded corners.
Definition shadow_background_label.h:13
TODO: Document this.