| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2020 Mathias Wein <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: GPL-3.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef WGSHADESELECTOR_H |
| 8 |
#define WGSHADESELECTOR_H |
| 9 |
|
| 10 |
#include <WGSelectorWidgetBase.h> |
| 11 |
|
| 12 |
#include <QObject> |
| 13 |
#include <QWidget> |
| 14 |
#include <QVector> |
| 15 |
#include <QVector4D> |
| 16 |
|
| 17 |
class WGShadeSlider; |
| 18 |
|
| 19 |
class WGShadeSelector : public WGSelectorWidgetBase |
| 20 |
{ |
| 21 |
Q_OBJECT |
| 22 |
|
| 23 |
public: |
| 24 |
WGShadeSelector(WGSelectorDisplayConfigSP displayConfig, KisVisualColorModelSP colorModel, QWidget *parent = nullptr); |
| 25 |
|
| 26 |
void setModel(KisVisualColorModelSP colorModel) override; |
| 27 |
void updateSettings() override; |
| 28 |
protected: |
| 29 |
void mousePressEvent(QMouseEvent *event) override; |
| 30 |
|
| 31 |
void connectToModel(); |
| 32 |
|
| 33 |
public Q_SLOTS: |
| 34 |
void slotChannelValuesChanged(const QVector4D &values); |
| 35 |
private Q_SLOTS: |
| 36 |
void slotSliderValuesChanged(const QVector4D &values); |
| 37 |
void slotSliderInteraction(bool active); |
| 38 |
void slotReset(); |
| 39 |
|
| 40 |
private: |
| 41 |
KisVisualColorModelSP m_model; |
| 42 |
QVector<WGShadeSlider *> m_sliders; |
| 43 |
int m_lineHeight {10}; |
| 44 |
bool m_resetOnExternalUpdate {true}; |
| 45 |
bool m_resetOnInteractions {false}; |
| 46 |
bool m_resetOnRightClick {true}; |
| 47 |
bool m_allowUpdates {true}; |
| 48 |
bool m_initialized {false}; |
| 49 |
}; |
| 50 |
|
| 51 |
#endif // WGSHADESELECTOR_H |