File indexing completed on 2024-12-22 04:15:04

0001 /*
0002  * SPDX-FileCopyrightText: 2020 Mathias Wein <lynx.mw+kde@gmail.com>
0003  *
0004  * SPDX-License-Identifier: GPL-3.0-or-later
0005  */
0006 
0007 #ifndef WGSHADELINEEDITOR_H
0008 #define WGSHADELINEEDITOR_H
0009 
0010 #include <WGConfig.h>
0011 
0012 #include <KisVisualColorModel.h>
0013 #include <QIcon>
0014 #include <QFrame>
0015 #include <QScopedPointer>
0016 
0017 class Ui_WGShadeLineEditor;
0018 class WGShadeSlider;
0019 
0020 class WGShadeLineEditor : public QFrame
0021 {
0022     Q_OBJECT
0023 public:
0024     explicit WGShadeLineEditor(QWidget *parent = nullptr);
0025     ~WGShadeLineEditor();
0026 
0027     WGConfig::ShadeLine configuration() const;
0028     void setConfiguration(const WGConfig::ShadeLine &cfg, int lineIndex);
0029     QIcon generateIcon(const WGConfig::ShadeLine &cfg);
0030 
0031 protected:
0032     void hideEvent(QHideEvent *event) override;
0033 
0034 private Q_SLOTS:
0035     void slotValueChanged();
0036     void slotPatchCountChanged(int value);
0037     void slotSliderModeChanged(bool enabled);
0038 
0039 Q_SIGNALS:
0040     void sigEditorClosed(int lineIndex);
0041 
0042 private:
0043     KisVisualColorModelSP m_model;
0044     QScopedPointer<Ui_WGShadeLineEditor> m_ui;
0045     WGShadeSlider *m_previewLine;
0046     WGShadeSlider *m_iconSlider;
0047     int m_lineIndex {0};
0048 };
0049 
0050 #endif // WGSHADELINEEDITOR_H