Krita Source Code Documentation
Loading...
Searching...
No Matches
KisGenericGradientEditor.h
Go to the documentation of this file.
1/*
2 * KDE. Krita Project.
3 *
4 * SPDX-FileCopyrightText: 2020 Deif Lou <ginoba@gmail.com>
5 *
6 * SPDX-License-Identifier: GPL-2.0-or-later
7 */
8
9#ifndef KISGENERICGRADIENTEDITOR_H
10#define KISGENERICGRADIENTEDITOR_H
11
12#include <QWidget>
13#include <QScopedPointer>
14
15#include <kritaui_export.h>
16#include <KoAbstractGradient.h>
18
28class KRITAUI_EXPORT KisGenericGradientEditor : public QWidget
29{
30 Q_OBJECT
31public:
36 KisGenericGradientEditor(QWidget* parent = 0);
38
44 void loadUISettings(const QString &prefix = QString());
50 void saveUISettings(const QString &prefix = QString());
51
72 bool compactMode() const;
124
125 QSize sizeHint() const override;
126 QSize minimumSizeHint() const override;
127
128 bool event(QEvent *e) override;
129
130public Q_SLOTS:
139 void setGradient(KoAbstractGradientSP newGradient);
149 void setCanvasResourcesInterface(KoCanvasResourcesInterfaceSP newCanvasResourcesInterface);
158 void setCompactMode(bool compact);
164 void setConvertGradientButtonVisible(bool visible);
170 void setUpdateGradientButtonVisible(bool visible);
176 void setAddGradientButtonVisible(bool visible);
182 void setGradientPresetChooserVisible(bool visible);
188 void setGradientPresetChooserOptionsButtonVisible(bool visible);
195 void setUseGradientPresetChooserPopUp(bool use);
203 void setCompactGradientPresetChooserMode(bool compact);
209 void setCompactGradientEditorMode(bool compact);
210
211Q_SIGNALS:
216
217private:
218 class Private;
219 QScopedPointer<Private> m_d;
220
221 void updateConvertGradientButton();
222 void updateUpdateGradientButton();
223 void updateAddGradientButton();
224 void updateGradientPresetChooser();
225 void updateGradientEditor();
226
227private Q_SLOTS:
228 void on_buttonConvertGradient_clicked();
229 void on_buttonUpdateGradient_clicked();
230 void on_buttonAddGradient_clicked();
231 void on_widgetGradientPresetChooser_resourceClicked(KoResourceSP resource);
232 void on_widgetGradientEditor_sigGradientChanged();
233};
234
235#endif
This is a generic gradient editor widget.
void sigGradientChanged()
signal emitted when the gradient changes
bool compactGradientPresetChooserMode() const
Tell if the gradient preset chooser is being shown without any controls other than the list view.
bool compactGradientEditorMode() const
Tell if the internal gradient editor is using the compact mode.
QScopedPointer< Private > m_d
KoAbstractGradientSP gradient() const
Get the current gradient.
bool isConvertGradientButtonVisible() const
Tell if the convert gradient button is being shown.
bool isGradientPresetChooserVisible() const
Tell if the gradient preset chooser is being shown.
bool isGradientPresetChooserOptionsButtonVisible() const
Tell if the button for the gradient preset chooser options is being shown.
bool compactMode() const
Tell if the compact mode is being used.
bool isAddGradientButtonVisible() const
Tell if the add gradient button is being shown.
bool useGradientPresetChooserPopUp() const
Tell if the gradient preset chooser is being shown as a pop-up clicking a button or embedded in the w...
bool isUpdateGradientButtonVisible() const
Tell if the update gradient button is being shown.
KoCanvasResourcesInterfaceSP canvasResourcesInterface() const
Get the current Canvas Resources Interface.