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;
16
18{
19 Q_OBJECT
20public:
21 explicit KisColorHistory(QWidget *parent = 0);
23 void setCanvas(KisCanvas2 *canvas) override;
24 void unsetCanvas() override;
25
26protected:
27 KisColorSelectorBase* createPopup() const override;
28
29public Q_SLOTS:
30 void addColorToHistory(const KoColor& color);
31
32 void clearColorHistory();
33
34 void updateUserSettings();
35
36 // Receive notification that the color history changed in some selector
38
39private:
40 // Get reference to the relevant color history, either from resource provider or document.
42 std::unique_ptr<KisUniqueColorSet> m_fallbackColorHistoryModel;
43
44 // Write the changed color history where it is stored, depending on the settings.
45 void updateColorHistory(const QList<KoColor> &history);
46
48
49 QToolButton* m_clearButton;
50 KisDocument *m_document; // Color history is now stored in the document
52};
53
54// Singleton instance to update color history when there are multiple windows that must have it in sync.
55class KisColorHistoryNotifier : public QObject
56{
57Q_OBJECT
58
59public:
60 void notifyColorHistoryChanged(const QList<KoColor> &history);
61
62
63Q_SIGNALS:
64
65 void colorHistoryChanged(const QList<KoColor> &history);
66};
67
68
69#endif // KIS_COLOR_HISTORY_H
void colorHistoryChanged(const QList< KoColor > &history)
void notifyColorHistoryChanged(const QList< KoColor > &history)
KisUniqueColorSet * colorHistoryModel()
QToolButton * m_clearButton
KisColorHistory(QWidget *parent=0)
KisDocument * m_document
KisColorSelectorBase * createPopup() const override
std::unique_ptr< KisUniqueColorSet > m_fallbackColorHistoryModel
void updateColorHistory(const QList< KoColor > &history)
void addColorToHistory(const KoColor &color)
void setCanvas(KisCanvas2 *canvas) override
void unsetCanvas() override
KisCanvasResourceProvider * m_resourceProvider
Base class for all color selectors, that should support color management and zooming.