Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_paintop_presets_editor.h
Go to the documentation of this file.
1/* This file is part of the KDE project
2 * SPDX-FileCopyrightText: 2008 Boudewijn Rempt <boud@valdyas.org>
3 * SPDX-FileCopyrightText: 2010 Lukáš Tvrdý <lukast.dev@gmail.com>
4 * SPDX-FileCopyrightText: 2011 Silvio Heinrich <plassy@web.de>
5 *
6 * SPDX-License-Identifier: LGPL-2.0-or-later
7 */
8#ifndef KIS_PAINTOP_PRESETS_POPUP_H
9#define KIS_PAINTOP_PRESETS_POPUP_H
10
11#include <QWidget>
12#include <QList>
13#include <KoID.h>
14#include <kis_types.h>
17#include <kis_action.h>
20#include "KoDialog.h"
21
22class QString;
24class KoResource;
25
30class KisPaintOpPresetsEditor : public QWidget
31{
32 Q_OBJECT
33
34public:
35
37 KisFavoriteResourceManager* favoriteResourceManager,
38 KisPresetSaveWidget* savePresetWidget,
39 QWidget * parent = 0);
40
41 ~KisPaintOpPresetsEditor() override;
42
43 void setPaintOpSettingsWidget(QWidget * widget);
44
45
48 QImage cutOutOverlay();
49
51
52 void setCurrentPaintOpId(const QString & paintOpId);
53
55 QString currentPaintOpId();
56
57 void resizeEvent(QResizeEvent* ) override;
58
59 void updateViewSettings();
60
62
64
65 // toggle the state when we are creating a brush from scratch
66 void setCreatingBrushFromScratch(bool enable);
67
70
71protected:
72 void contextMenuEvent(QContextMenuEvent *) override;
73 void hideEvent(QHideEvent *) override;
74 void showEvent(QShowEvent *) override;
75
76public Q_SLOTS:
77 void resourceSelected(KoResourceSP resource);
78 void updateThemedIcons();
79
80
86
87Q_SIGNALS:
91 void paintopActivated(const QString& presetName);
98 void createPresetFromScratch(const QString& paintOpName);
99 void toggleDetachState(bool detach);
100
101private Q_SLOTS:
102 void slotSwitchScratchpad(bool visible);
103 void slotSwitchShowEditor(bool visible);
105 void slotSwitchShowPresets(bool visible);
106 void slotSaveBrushPreset();
108 void slotToggleDetach(bool detach);
110
113
114private:
115
116 struct Private;
117 Private * const m_d;
122
125
128
129 void toggleBrushRenameUIActive(bool isRenaming);
130};
131
132#endif
float value(const T *src, size_t ch)
void createPresetFromScratch(const QString &paintOpName)
QList< KisPaintOpInfo > sortedBrushEnginesList
void setPaintOpList(const QList< KisPaintOpFactory * > &list)
void writeOptionSetting(KisPropertiesConfigurationSP setting) const
void toggleDetachState(bool detach)
QString currentPaintOpId()
returns the internal ID for the paint op (brush engine)
void showEvent(QShowEvent *) override
void eraserBrushSizeToggled(bool value)
void resourceSelected(KoResourceSP resource)
void eraserBrushOpacityToggled(bool value)
void paintopActivated(const QString &presetName)
void setCurrentPaintOpId(const QString &paintOpId)
void currentPresetChanged(KisPaintOpPresetSP preset)
void readOptionSetting(const KisPropertiesConfigurationSP setting)
void slotBlackListCurrentPreset()
we do not delete brush presets, but blacklist them so they disappear from the interface
void contextMenuEvent(QContextMenuEvent *) override
void signalResourceSelected(KoResourceSP resource)
void toggleBrushRenameUIActive(bool isRenaming)
void setPaintOpSettingsWidget(QWidget *widget)
void hideEvent(QHideEvent *) override
void resizeEvent(QResizeEvent *) override
KisPaintOpPresetsEditor(KisCanvasResourceProvider *resourceProvider, KisFavoriteResourceManager *favoriteResourceManager, KisPresetSaveWidget *savePresetWidget, QWidget *parent=0)
void dirtyPresetToggled(bool value)