2017-07-19 23:20:32 +02:00
|
|
|
#pragma once
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
#include <QObject>
|
2023-04-30 04:48:30 +02:00
|
|
|
class lcColorList;
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
class lcQColorPickerPopup : public QFrame
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-02-01 02:32:38 +01:00
|
|
|
lcQColorPickerPopup(QWidget* Parent = nullptr, int ColorIndex = 0, bool AllowNoColor = false);
|
2013-08-09 06:57:18 +02: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 23:44:41 +01:00
|
|
|
void showEvent(QShowEvent* ShowEvent) override;
|
|
|
|
void hideEvent(QHideEvent* HideEvent) override;
|
|
|
|
void mouseReleaseEvent(QMouseEvent* MouseEvent) override;
|
2013-08-09 06:57:18 +02:00
|
|
|
|
|
|
|
private:
|
2021-02-01 02:32:38 +01:00
|
|
|
QEventLoop* eventLoop;
|
2023-04-30 04:48:30 +02:00
|
|
|
lcColorList* colorList;
|
2013-08-09 06:57:18 +02:00
|
|
|
};
|
|
|
|
|
|
|
|
class lcQColorPicker : public QPushButton
|
|
|
|
{
|
|
|
|
Q_OBJECT
|
|
|
|
|
|
|
|
public:
|
2021-02-01 02:32:38 +01:00
|
|
|
lcQColorPicker(QWidget* Parent = nullptr, bool AllowNoColor = false);
|
2013-08-09 06:57:18 +02:00
|
|
|
~lcQColorPicker();
|
|
|
|
|
|
|
|
int currentColor() const;
|
2018-03-12 04:35:04 +01:00
|
|
|
int currentColorCode() const;
|
2013-08-09 06:57:18 +02:00
|
|
|
void setCurrentColor(int colorIndex);
|
2018-03-12 04:35:04 +01:00
|
|
|
void setCurrentColorCode(int colorCode);
|
2013-08-09 06:57:18 +02: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-02-01 02:32:38 +01:00
|
|
|
protected:
|
|
|
|
void UpdateIcon();
|
2013-08-09 06:57:18 +02:00
|
|
|
|
2021-02-01 02:32:38 +01:00
|
|
|
int mCurrentColorIndex = 0;
|
|
|
|
int mInitialColorIndex = 0;
|
|
|
|
bool mAllowNoColor = false;
|
|
|
|
};
|