mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-06-10 00:04:48 -07:00
* Sort *every* file into a doxygen group. Took 7 hours 9 minutes Took 18 seconds Took 2 minutes * Lint some ingroup definitions. Took 10 minutes Took 2 seconds * Just include the groups in the Doxyfile in this commit. Took 3 minutes * Update some group comments so they link! Took 14 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
51 lines
1.2 KiB
C++
51 lines
1.2 KiB
C++
/**
|
|
* @file banner_widget.h
|
|
* @ingroup Widgets
|
|
* @ingroup DeckEditorCardGroupWidgets
|
|
* @ingroup DeckStorageWidgets
|
|
* @brief TODO: Document this.
|
|
*/
|
|
|
|
#ifndef BANNER_WIDGET_H
|
|
#define BANNER_WIDGET_H
|
|
|
|
#include <QLabel>
|
|
#include <QVBoxLayout>
|
|
#include <QWidget>
|
|
|
|
class BannerWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit BannerWidget(QWidget *parent,
|
|
const QString &text,
|
|
Qt::Orientation orientation = Qt::Vertical,
|
|
int transparency = 80);
|
|
void mousePressEvent(QMouseEvent *event) override;
|
|
void setText(const QString &text) const;
|
|
void setClickable(bool _clickable);
|
|
void setBuddy(QWidget *_buddy);
|
|
QString getText() const
|
|
{
|
|
return bannerLabel->text();
|
|
}
|
|
|
|
protected:
|
|
void paintEvent(QPaintEvent *event) override;
|
|
|
|
private:
|
|
QLabel *iconLabel;
|
|
QLabel *bannerLabel;
|
|
Qt::Orientation gradientOrientation;
|
|
int transparency; // Transparency percentage for the gradient
|
|
QWidget *buddy = nullptr;
|
|
bool clickable = true;
|
|
signals:
|
|
void buddyVisibilityChanged();
|
|
private slots:
|
|
void toggleBuddyVisibility() const;
|
|
void updateDropdownIconState() const;
|
|
};
|
|
|
|
#endif // BANNER_WIDGET_H
|