2017-07-19 14:20:32 -07:00
|
|
|
#pragma once
|
2013-08-09 04:57:18 +00:00
|
|
|
|
|
|
|
#include <QObject>
|
|
|
|
class lcQColorList;
|
|
|
|
|
|
|
|
class lcQColorPickerPopup : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-01-31 17:32:38 -08:00
|
|
|
lcQColorPickerPopup(QWidget* Parent = nullptr, int ColorIndex = 0, bool AllowNoColor = false);
|
2013-08-09 04:57:18 +00:00
|
|
|
~lcQColorPickerPopup();
|
|
|
|
|
|
|
|
void exec();
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void changed(int colorIndex);
|
|
|
|
void selected(int colorIndex);
|
|
|
|
void hid();
|
|
|
|
|
|
|
|
public slots:
|
|
|
|
void colorChanged(int colorIndex);
|
|
|
|
void colorSelected(int colorIndex);
|
|
|
|
|
|
|
|
protected:
|
2020-03-22 15:44:41 -07:00
|
|
|
void showEvent(QShowEvent* ShowEvent) override;
|
|
|
|
void hideEvent(QHideEvent* HideEvent) override;
|
|
|
|
void mouseReleaseEvent(QMouseEvent* MouseEvent) override;
|
2013-08-09 04:57:18 +00:00
|
|
|
|
|
|
|
private:
|
2021-01-31 17:32:38 -08:00
|
|
|
QEventLoop* eventLoop;
|
|
|
|
lcQColorList* colorList;
|
2013-08-09 04:57:18 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
class lcQColorPicker : public QPushButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-01-31 17:32:38 -08:00
|
|
|
lcQColorPicker(QWidget* Parent = nullptr, bool AllowNoColor = false);
|
2013-08-09 04:57:18 +00:00
|
|
|
~lcQColorPicker();
|
|
|
|
|
|
|
|
int currentColor() const;
|
2018-03-11 20:35:04 -07:00
|
|
|
int currentColorCode() const;
|
2013-08-09 04:57:18 +00:00
|
|
|
void setCurrentColor(int colorIndex);
|
2018-03-11 20:35:04 -07:00
|
|
|
void setCurrentColorCode(int colorCode);
|
2013-08-09 04:57:18 +00:00
|
|
|
|
|
|
|
public slots:
|
|
|
|
void changed(int colorIndex);
|
|
|
|
void selected(int colorIndex);
|
|
|
|
|
|
|
|
signals:
|
|
|
|
void colorChanged(int colorIndex);
|
|
|
|
|
|
|
|
private slots:
|
|
|
|
void buttonPressed(bool toggled);
|
|
|
|
void popupClosed();
|
|
|
|
|
2021-01-31 17:32:38 -08:00
|
|
|
protected:
|
|
|
|
void UpdateIcon();
|
2013-08-09 04:57:18 +00:00
|
|
|
|
2021-01-31 17:32:38 -08:00
|
|
|
int mCurrentColorIndex = 0;
|
|
|
|
int mInitialColorIndex = 0;
|
|
|
|
bool mAllowNoColor = false;
|
|
|
|
};
|