Cockatrice/cockatrice/src/interface/widgets/general/home_widget.h
BruebachL 1ef07309d6
Turn Card, Deck_List, Protocol, RNG, Network (Client, Server), Settings and Utility into libraries and remove cockatrice_common. (#6212)
---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
Co-authored-by: ebbit1q <ebbit1q@gmail.com>
2025-10-09 07:36:12 +02:00

50 lines
1.3 KiB
C++

/**
* @file home_widget.h
* @ingroup Core
* @ingroup Widgets
* @brief TODO: Document this.
*/
#ifndef HOME_WIDGET_H
#define HOME_WIDGET_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>
#include <libcockatrice/network/client/abstract/abstract_client.h>
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 onBackgroundShuffleFrequencyChanged();
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