Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_color_history.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2010 Adam Celarek <kdedev at xibo dot at>
3 *
4 * SPDX-License-Identifier: LGPL-2.0-or-later
5 */
6
7#ifndef KIS_COLOR_HISTORY_H
8#define KIS_COLOR_HISTORY_H
9
10#include "kis_color_patches.h"
11
12class QToolButton;
15
17{
18 Q_OBJECT
19public:
20 explicit KisColorHistory(QWidget *parent = 0);
21 void setCanvas(KisCanvas2 *canvas) override;
22 void unsetCanvas() override;
23
24protected:
25 KisColorSelectorBase* createPopup() const override;
26
27public Q_SLOTS:
28 void addColorToHistory(const KoColor& color);
29
30 void clearColorHistory();
31
32 void updateUserSettings();
33
34 // Receive notification that the color history changed in some selector
35 void colorHistoryChanged(const QList<KoColor> &history);
36
37private:
38 // Get reference to the relevant color history, either from resource provider or document.
40
41 // Write the changed color history where it is stored, depending on the settings.
42 void updateColorHistory(const QList<KoColor> &history);
43
45
46 QToolButton* m_clearButton;
47 KisDocument *m_document; // Color history is now stored in the document
49};
50
51// Singleton instance to update color history when there are multiple windows that must have it in sync.
52class KisColorHistoryNotifier : public QObject
53{
54Q_OBJECT
55
56public:
57 void notifyColorHistoryChanged(const QList<KoColor> &history);
58
59
60Q_SIGNALS:
61
62 void colorHistoryChanged(const QList<KoColor> &history);
63};
64
65
66#endif // KIS_COLOR_HISTORY_H
void colorHistoryChanged(const QList< KoColor > &history)
void notifyColorHistoryChanged(const QList< KoColor > &history)
QToolButton * m_clearButton
KisColorHistory(QWidget *parent=0)
KisDocument * m_document
KisColorSelectorBase * createPopup() const override
QList< KoColor > colorHistory()
void updateColorHistory(const QList< KoColor > &history)
void addColorToHistory(const KoColor &color)
void setCanvas(KisCanvas2 *canvas) override
void unsetCanvas() override
void colorHistoryChanged(const QList< KoColor > &history)
KisCanvasResourceProvider * m_resourceProvider
Base class for all color selectors, that should support color management and zooming.