CustomColorSettingCard.h 1.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. #ifndef CUSTOMCOLORSETTINGCARD_H
  2. #define CUSTOMCOLORSETTINGCARD_H
  3. #include "ExpandGroupSettingCard.h"
  4. #include <QBoxLayout>
  5. #include <QLabel>
  6. #include <QPushButton>
  7. class RadioButton;
  8. class CustomColorSettingCard : public ExpandGroupSettingCard
  9. {
  10. Q_OBJECT
  11. public:
  12. explicit CustomColorSettingCard(const QVariant &configItem, FluentIconBase *icon, const QString &title,
  13. const QString &content = "", QWidget *parent = nullptr);
  14. private:
  15. void initWidget();
  16. void initLayout();
  17. private slots:
  18. void onRadioButtonClicked(QAbstractButton *button);
  19. void showColorDialog();
  20. void onCustomColorChanged(const QColor &color);
  21. signals:
  22. void colorChanged(const QColor &);
  23. private:
  24. QVariant m_configItem;
  25. QColor m_defaultColor;
  26. QColor m_customColor;
  27. QLabel *m_choiceLabel;
  28. QWidget *m_radioWidget;
  29. QVBoxLayout *m_radioLayout;
  30. RadioButton *m_defaultRadioButton;
  31. RadioButton *m_customRadioButton;
  32. QButtonGroup *m_buttonGroup;
  33. QWidget *m_customColorWidget;
  34. QHBoxLayout *m_customColorLayout;
  35. QLabel *m_customLabel;
  36. QPushButton *m_chooseColorButton;
  37. };
  38. #endif // CUSTOMCOLORSETTINGCARD_H