| 1 |
/* |
| 2 |
* SPDX-FileCopyrightText: 2020 Mathias Wein <[email protected]> |
| 3 |
* |
| 4 |
* SPDX-License-Identifier: GPL-3.0-or-later |
| 5 |
*/ |
| 6 |
|
| 7 |
#ifndef WGSHADELINEEDITOR_H |
| 8 |
#define WGSHADELINEEDITOR_H |
| 9 |
|
| 10 |
#include <WGConfig.h> |
| 11 |
|
| 12 |
#include <KisVisualColorModel.h> |
| 13 |
#include <QIcon> |
| 14 |
#include <QFrame> |
| 15 |
#include <QScopedPointer> |
| 16 |
|
| 17 |
class Ui_WGShadeLineEditor; |
| 18 |
class WGShadeSlider; |
| 19 |
|
| 20 |
class WGShadeLineEditor : public QFrame |
| 21 |
{ |
| 22 |
Q_OBJECT |
| 23 |
public: |
| 24 |
explicit WGShadeLineEditor(QWidget *parent = nullptr); |
| 25 |
~WGShadeLineEditor(); |
| 26 |
|
| 27 |
WGConfig::ShadeLine configuration() const; |
| 28 |
void setConfiguration(const WGConfig::ShadeLine &cfg, int lineIndex); |
| 29 |
QIcon generateIcon(const WGConfig::ShadeLine &cfg); |
| 30 |
|
| 31 |
protected: |
| 32 |
void hideEvent(QHideEvent *event) override; |
| 33 |
|
| 34 |
private Q_SLOTS: |
| 35 |
void slotValueChanged(); |
| 36 |
void slotPatchCountChanged(int value); |
| 37 |
void slotSliderModeChanged(bool enabled); |
| 38 |
|
| 39 |
Q_SIGNALS: |
| 40 |
void sigEditorClosed(int lineIndex); |
| 41 |
|
| 42 |
private: |
| 43 |
KisVisualColorModelSP m_model; |
| 44 |
QScopedPointer<Ui_WGShadeLineEditor> m_ui; |
| 45 |
WGShadeSlider *m_previewLine; |
| 46 |
WGShadeSlider *m_iconSlider; |
| 47 |
int m_lineIndex {0}; |
| 48 |
}; |
| 49 |
|
| 50 |
#endif // WGSHADELINEEDITOR_H |