Krita Source Code Documentation
Loading...
Searching...
No Matches
KoFillConfigWidget.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * Made by Tomislav Lukman (tomislav.lukman@ck.tel.hr)
3 * SPDX-FileCopyrightText: 2012 Jean-Nicolas Artaud <jeannicolasartaud@gmail.com>
4 *
5 * SPDX-License-Identifier: LGPL-2.0-or-later
6 */
7
8#ifndef FILLCONFIGWIDGET_H
9#define FILLCONFIGWIDGET_H
10
11#include "kritaui_export.h"
12
13#include <QWidget>
14#include <QSharedPointer>
15#include <KoFlake.h>
16#include <KoFlakeTypes.h>
17#include <SvgMeshGradient.h>
18
20class KoCanvasBase;
22class KoShape;
23class KoColor;
24
26class KRITAUI_EXPORT KoFillConfigWidget : public QWidget
27{
28 Q_OBJECT
30 None = 0,
34 MeshGradient
35 };
36
37public:
38
45 explicit KoFillConfigWidget(KoCanvasBase *canvas, KoFlake::FillVariant fillVariant, bool trackShapeSelection, QWidget *parent);
46 ~KoFillConfigWidget() override;
47
48 void setNoSelectionTrackingMode(bool value);
49
52 QList<KoShape*> currentShapes();
53
56
57 KoShapeStrokeSP createShapeStroke();
58
59 void activate();
60 void deactivate();
61
62 void forceUpdateOnSelectionChanged();
63
64 void setSelectedMeshGradientHandle(const SvgMeshPosition &position);
65
66private Q_SLOTS:
67 void styleButtonPressed(int buttonId);
68
69 void noColorSelected();
70 void shapeChanged();
71
73 void colorChanged(std::pair<QColor, KoFlake::FillVariant> resource);
74
76 void patternChanged(QSharedPointer<KoShapeBackground> background);
77
78
79
80 void slotUpdateFillTitle();
81
82 void slotCanvasResourceChanged(int key, const QVariant &value);
83
84 void slotSavePredefinedGradientClicked();
85
86 void activeGradientChanged();
87 void gradientResourceChanged();
88
89 void slotGradientTypeChanged();
90 void slotGradientRepeatChanged();
91
92 void slotProposeCurrentColorToResourceManager();
93 void slotRecoverColorInResourceManager();
94
96 void slotMeshGradientChanged();
97 void slotMeshGradientShadingChanged(int index);
98 void slotMeshHandleColorChanged(const KoColor &c);
99
100Q_SIGNALS:
102
106
107private:
108 void updateGradientUi(const QGradient *gradient);
109 void setNewGradientBackgroundToShape();
110 void updateGradientSaveButtonAvailability();
111 void loadCurrentFillFromResourceServer();
112
114 void createNewMeshGradientBackground();
115 void createNewDefaultMeshGradientBackground();
116 void setNewMeshGradientBackgroundToShape();
117 void updateMeshGradientUI();
118
119 void updateWidgetComponentVisibility();
120
122 void updateUiFromFillType(KoShape *shape);
123
124 class Private;
125 Private * const d {nullptr};
126};
127
128#endif // FILLCONFIGWIDGET_H
float value(const T *src, size_t ch)
A widget for configuring the fill of a shape.
void sigInternalRequestColorToResourceManager()
void sigMeshGradientResetted()
void sigInternalRecoverColorInResourceManager()
int selectedFillIndex()
returns the selected index of the fill type
FillVariant
Definition KoFlake.h:28