You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

46 lines
1.4 KiB
C

#ifndef SACOLORPALETTEGRIDWIDGET_H
#define SACOLORPALETTEGRIDWIDGET_H
#include <QWidget>
#include "SAColorWidgetsGlobal.h"
class QMenu;
class SAColorToolButton;
/**
* @brief office32
*/
class SA_COLOR_WIDGETS_API SAColorPaletteGridWidget : public QWidget
{
Q_OBJECT
SA_COLOR_WIDGETS_DECLARE_PRIVATE(SAColorPaletteGridWidget)
public:
SAColorPaletteGridWidget(QWidget* par = nullptr);
SAColorPaletteGridWidget(const QList< QColor >& cls, QWidget* par = nullptr);
~SAColorPaletteGridWidget();
// 设置窗口维护的colorList
void setColorList(const QList< QColor >& cls);
QList< QColor > colorList() const;
// 设置颜色深浅比例factor默认为{ 180, 160, 140, 75, 50 }
void setFactor(const QList< int >& factor);
QList< int > factor() const;
// 设置iconsize
void setColorIconSize(const QSize& s);
QSize colorIconSize() const;
// 设置颜色是否是checkable
void setColorCheckable(bool on = true);
bool isColorCheckable() const;
private slots:
void onMainColorClicked(const QColor& c);
void onPaletteColorClicked(const QColor& c);
private:
void init();
signals:
/**
* @brief checkcheck
* @param c
* @param on
*/
void colorClicked(const QColor& c);
};
#endif // SACOLORPALETTEGRIDWIDGET_H