Home tab to replace generic deck editor on startup (#6114)

This commit is contained in:
BruebachL 2025-09-11 21:36:34 +02:00 committed by GitHub
parent 22c8268f02
commit 93c15c8151
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
26 changed files with 751 additions and 8 deletions

View file

@ -0,0 +1,42 @@
#ifndef HOME_WIDGET_H
#define HOME_WIDGET_H
#include "../../../../server/abstract_client.h"
#include "../../../tabs/tab_supervisor.h"
#include "../cards/card_info_picture_art_crop_widget.h"
#include "home_styled_button.h"
#include <QGridLayout>
#include <QGroupBox>
#include <QWidget>
class HomeWidget : public QWidget
{
Q_OBJECT
public:
HomeWidget(QWidget *parent, TabSupervisor *tabSupervisor);
void updateRandomCard();
QPair<QColor, QColor> extractDominantColors(const QPixmap &pixmap);
public slots:
void paintEvent(QPaintEvent *event) override;
void initializeBackgroundFromSource();
void updateBackgroundProperties();
void updateButtonsToBackgroundColor();
QGroupBox *createButtons();
void updateConnectButton(const ClientStatus status);
private:
QGridLayout *layout;
QTimer *cardChangeTimer;
TabSupervisor *tabSupervisor;
QPixmap background;
CardInfoPictureArtCropWidget *backgroundSourceCard = nullptr;
DeckLoader *backgroundSourceDeck;
QPixmap overlay;
QPair<QColor, QColor> gradientColors;
HomeStyledButton *connectButton;
};
#endif // HOME_WIDGET_H