/* * SPDX-FileCopyrightText: 2018 Michael Zhou * * SPDX-License-Identifier: GPL-2.0-or-later */ #ifndef KISDLGPALETTEEDITOR_H #define KISDLGPALETTEEDITOR_H #include #include #include #include #include "kritaui_export.h" class QAction; class KoColorSet; class KisPaletteModel; class KisSwatchGroup; class KoDialog; class KisViewManager; class KisPaletteEditor; class Ui_WdgDlgPaletteEditor; /** * @brief The KisDlgPaletteEditor class * a dialog used by the palette docker to make modifications to a palette. * it automatically uploads all changes into the resource server when * the change is accepted */ class KRITAUI_EXPORT KisDlgPaletteEditor : public QDialog { Q_OBJECT public: explicit KisDlgPaletteEditor(KisPaletteEditor *editor, QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags()); ~KisDlgPaletteEditor(); public: void initialize(KisPaletteModel *); KoColorSetSP palette() const { return m_colorSet; } private Q_SLOTS: void slotDelGroup(); void slotAddGroup(); void slotRenGroup(); void slotGroupChosen(const QString &groupName); void slotRowCountChanged(int); void slotSetGlobal(); void slotNameChanged(); void slotColCountChanged(int); private: QString oldNameFromNewName(const QString &newName) const; private: QScopedPointer m_ui; QScopedPointer m_actAddGroup; QScopedPointer m_actDelGroup; QScopedPointer m_actRenGroup; QPointer m_paletteEditor; QSharedPointer m_colorSet; QString m_currentGroupOriginalName; QPalette m_normalPalette; QPalette m_warnPalette; }; #endif // KISKisDlgPaletteEditor_H