Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/dialogs/KisDlgPaletteEditor.h
- This file was added.
1 | /* | ||||
---|---|---|---|---|---|
2 | * Copyright (c) 2018 Michael Zhou <simeirxh@gmail.com> | ||||
3 | * | ||||
4 | * This program is free software; you can redistribute it and/or modify | ||||
5 | * it under the terms of the GNU General Public License as published by | ||||
6 | * the Free Software Foundation; either version 2 of the License, or | ||||
7 | * (at your option) any later version. | ||||
8 | * | ||||
9 | * This program is distributed in the hope that it will be useful, | ||||
10 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | ||||
11 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||||
12 | * GNU General Public License for more details. | ||||
13 | * | ||||
14 | * You should have received a copy of the GNU General Public License | ||||
15 | * along with this program; if not, write to the Free Software | ||||
16 | * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. | ||||
17 | */ | ||||
18 | | ||||
19 | #ifndef KISDLGPALETTEEDITOR_H | ||||
20 | #define KISDLGPALETTEEDITOR_H | ||||
21 | | ||||
22 | #include <QDialog> | ||||
23 | #include <QPointer> | ||||
24 | #include <QPair> | ||||
25 | #include <QScopedPointer> | ||||
26 | #include <QHash> | ||||
27 | #include <QSet> | ||||
28 | | ||||
29 | #include "kritaui_export.h" | ||||
30 | | ||||
31 | class QAction; | ||||
32 | | ||||
33 | class KoColorSet; | ||||
34 | class KisPaletteModel; | ||||
35 | class KisSwatchGroup; | ||||
36 | class KoDialog; | ||||
37 | class KisViewManager; | ||||
38 | | ||||
39 | class KisPaletteEditor; | ||||
40 | class Ui_WdgDlgPaletteEditor; | ||||
41 | | ||||
42 | /** | ||||
43 | * @brief The KisDlgPaletteEditor class | ||||
44 | * a dialog used by the palette docker to make modifications to a palette. | ||||
45 | * it automatically uploads all changes into the resource server when | ||||
46 | * the change is accepted | ||||
47 | */ | ||||
48 | class KRITAUI_EXPORT KisDlgPaletteEditor : public QDialog | ||||
49 | { | ||||
50 | Q_OBJECT | ||||
51 | public: | ||||
52 | explicit KisDlgPaletteEditor(); | ||||
53 | ~KisDlgPaletteEditor(); | ||||
54 | | ||||
55 | public: | ||||
56 | void setPaletteModel(KisPaletteModel *); | ||||
57 | KoColorSet* palette() const { return m_colorSet; } | ||||
58 | void setView(KisViewManager *); | ||||
59 | | ||||
60 | private Q_SLOTS: | ||||
61 | void slotDelGroup(); | ||||
62 | void slotAddGroup(); | ||||
63 | void slotRenGroup(); | ||||
64 | | ||||
65 | void slotGroupChosen(const QString &groupName); | ||||
66 | | ||||
67 | void slotRowCountChanged(int); | ||||
68 | void slotSetGlobal(int); | ||||
69 | void slotSetReadOnly(int); | ||||
70 | | ||||
71 | void slotNameChanged(); | ||||
72 | void slotFilenameChanged(const QString &newFilename); | ||||
73 | void slotFilenameInputFinished(); | ||||
74 | void slotColCountChanged(int); | ||||
75 | | ||||
76 | void slotAccepted(); | ||||
77 | | ||||
78 | private: | ||||
79 | QString oldNameFromNewName(const QString &newName) const; | ||||
80 | | ||||
81 | private: | ||||
82 | QScopedPointer<Ui_WdgDlgPaletteEditor> m_ui; | ||||
83 | QScopedPointer<QAction> m_actAddGroup; | ||||
84 | QScopedPointer<QAction> m_actDelGroup; | ||||
85 | QScopedPointer<QAction> m_actRenGroup; | ||||
86 | QScopedPointer<KisPaletteEditor> m_paletteEditor; | ||||
87 | QPointer<KoColorSet> m_colorSet; | ||||
88 | QString m_currentGroupOriginalName; | ||||
89 | | ||||
90 | QPalette m_normalPalette; | ||||
91 | QPalette m_warnPalette; | ||||
92 | }; | ||||
93 | | ||||
94 | #endif // KISKisDlgPaletteEditor_H |