mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-09-22 01:25:10 -07:00
Some checks are pending
CodeQL / Analyze (cpp) (push) Waiting to run
CodeQL / Analyze (actions) (push) Waiting to run
Build Desktop / Configure (push) Waiting to run
Build Desktop / Debian 13 (push) Blocked by required conditions
Build Desktop / Debian 12 (push) Blocked by required conditions
Build Desktop / Fedora 44 (push) Blocked by required conditions
Build Desktop / Fedora 43 (push) Blocked by required conditions
Build Desktop / Servatrice_Debian 12 (push) Blocked by required conditions
Build Desktop / Ubuntu 26.04 (push) Blocked by required conditions
Build Desktop / Ubuntu 24.04 (push) Blocked by required conditions
Build Desktop / Arch (push) Blocked by required conditions
Build Desktop / macOS 13 Intel (push) Blocked by required conditions
Build Desktop / macOS 14 (push) Blocked by required conditions
Build Desktop / macOS 15 (push) Blocked by required conditions
Build Desktop / macOS 26 Debug (push) Blocked by required conditions
Build Desktop / Windows 10 (push) Blocked by required conditions
Build Docker / Servatrice (arm) (push) Waiting to run
Build Docker / Servatrice (x86) (push) Waiting to run
Build Docker / Publish multi-platform Servatrice image (push) Blocked by required conditions
53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
/**
|
|
* @file home_widget.h
|
|
* @ingroup Core
|
|
* @ingroup Widgets
|
|
*/
|
|
//! \todo Document this file.
|
|
|
|
#ifndef HOME_WIDGET_H
|
|
#define HOME_WIDGET_H
|
|
#include "../../../interface/widgets/tabs/tab_supervisor.h"
|
|
#include "../cards/card_info_picture_art_crop_widget.h"
|
|
#include "home_styled_button.h"
|
|
|
|
#include <QGridLayout>
|
|
#include <QWidget>
|
|
#include <libcockatrice/network/client/abstract/abstract_client.h>
|
|
|
|
class HomeWidget : public QWidget
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
HomeWidget(QWidget *parent, TabSupervisor *tabSupervisor);
|
|
void updateRandomCard();
|
|
static 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;
|
|
DeckList backgroundSourceDeck;
|
|
QPixmap overlay;
|
|
QPair<QColor, QColor> gradientColors;
|
|
HomeStyledButton *connectButton;
|
|
|
|
void setRandomCard(ExactCard &newCard);
|
|
void loadBackgroundSourceDeck();
|
|
QPair<QColor, QColor> determineButtonColor() const;
|
|
};
|
|
|
|
#endif // HOME_WIDGET_H
|