File indexing completed on 2024-12-22 04:13:06
0001 /* 0002 * KDE. Krita Project. 0003 * 0004 * SPDX-FileCopyrightText: 2021 Deif Lou <ginoba@gmail.com> 0005 * 0006 * SPDX-License-Identifier: GPL-2.0-or-later 0007 */ 0008 0009 #ifndef KIS_GRADIENT_COLOR_EDITOR_H 0010 #define KIS_GRADIENT_COLOR_EDITOR_H 0011 0012 #include <QWidget> 0013 #include <QScopedPointer> 0014 0015 #include <KisGradientWidgetsUtils.h> 0016 #include <KoColor.h> 0017 #include <kritaui_export.h> 0018 0019 class KRITAUI_EXPORT KisGradientColorEditor : public QWidget 0020 { 0021 Q_OBJECT 0022 0023 public: 0024 KisGradientColorEditor(QWidget *parent = nullptr); 0025 KisGradientColorEditor(const KisGradientColorEditor &other); 0026 ~KisGradientColorEditor(); 0027 0028 qreal position() const; 0029 KisGradientWidgetsUtils::ColorType colorType() const; 0030 bool transparent() const; 0031 KoColor color() const; 0032 qreal opacity() const; 0033 0034 QSize sizeHint() const override; 0035 QSize minimumSizeHint() const override; 0036 0037 public Q_SLOTS: 0038 void setPosition(qreal position); 0039 void setColorType(KisGradientWidgetsUtils::ColorType type); 0040 void setTransparent(bool checked); 0041 void setColor(KoColor color); 0042 void setOpacity(qreal opacity); 0043 0044 void setUseTransParentCheckBox(bool use); 0045 void setUsePositionSlider(bool use); 0046 void setPositionSliderEnabled(bool enabled); 0047 0048 Q_SIGNALS: 0049 void positionChanged(qreal position); 0050 void colorTypeChanged(KisGradientWidgetsUtils::ColorType type); 0051 void transparentToggled(bool checked); 0052 void colorChanged(KoColor color); 0053 void opacityChanged(qreal opacity); 0054 0055 private: 0056 class Private; 0057 QScopedPointer<Private> m_d; 0058 }; 0059 0060 #endif