File indexing completed on 2024-06-16 04:16:01
0001 /* 0002 * SPDX-FileCopyrightText: 2010 Adam Celarek <kdedev at xibo dot at> 0003 * 0004 * SPDX-License-Identifier: LGPL-2.0-or-later 0005 */ 0006 0007 #ifndef KIS_COMMON_COLORS_H 0008 #define KIS_COMMON_COLORS_H 0009 0010 #include <QToolButton> 0011 0012 #include <QMutex> 0013 #include <QTimer> 0014 #include "kis_color_patches.h" 0015 #include <kis_types.h> 0016 0017 class KisCommonColors : public KisColorPatches 0018 { 0019 Q_OBJECT 0020 public: 0021 explicit KisCommonColors(QWidget *parent = 0); 0022 void setCanvas(KisCanvas2 *canvas) override; 0023 void unsetCanvas() override {} 0024 KisColorSelectorBase* createPopup() const override; 0025 0026 public Q_SLOTS: 0027 void setColors(QList<KoColor> colors); 0028 void updateSettings() override; 0029 void recalculate(); 0030 0031 private: 0032 QMutex m_mutex; 0033 QTimer m_recalculationTimer; 0034 QToolButton* m_reloadButton; 0035 QList<KoColor> m_calculatedColors; 0036 KisImageWSP m_image; 0037 }; 0038 0039 #endif