Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_select_similar.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2004 Boudewijn Rempt (boud@valdyas.org)
3 * SPDX-FileCopyrightText: 2015 Michael Abrahams <miabraha@gmail.com>
4 *
5 * SPDX-License-Identifier: GPL-2.0-or-later
6 */
7#ifndef KIS_TOOL_SELECT_SIMILAR_H_
8#define KIS_TOOL_SELECT_SIMILAR_H_
9
11#include <kis_icon.h>
12#include <kconfig.h>
14#include <kconfiggroup.h>
16
17/*
18 * Tool to select colors by pointing at a color on the image.
19 */
21{
22 Q_OBJECT
23
24public:
26 void beginPrimaryAction(KoPointerEvent *event) override;
27 void endPrimaryAction(KoPointerEvent *event) override;
28 void paint(QPainter&, const KoViewConverter &) override {}
29 QWidget* createOptionWidget() override;
30 void resetCursorStyle() override;
31
32public Q_SLOTS:
33 void activate(const QSet<KoShape*> &shapes) override;
34 void deactivate() override;
35 void slotSetThreshold(int);
36 void slotSetOpacitySpread(int);
37
38protected:
40 bool isPixelOnly() const override { return true; }
41 bool usesColorLabels() const override { return true; }
42
43private:
46 KConfigGroup m_configGroup;
50};
51
52
54{
55public:
57 : KisSelectionToolFactoryBase("KisToolSelectSimilar")
58 {
59 setToolTip(i18n("Similar Color Selection Tool"));
62 setIconName(koIconNameCStr("tool_similar_selection"));
63 setPriority(5);
64 }
69};
70
71
72#endif // KIS_TOOL_SELECT_SIMILAR_H_
73
KisSelectionToolConfigWidgetHelper m_widgetHelper
KoToolBase * createTool(KoCanvasBase *canvas) override
bool usesColorLabels() const override
void beginPrimaryAction(KoPointerEvent *event) override
KisToolSelectSimilar(KoCanvasBase *canvas)
QWidget * createOptionWidget() override
bool isPixelOnly() const override
KisMergeLabeledLayersCommand::ReferenceNodeInfoListSP m_referenceNodeList
void activate(const QSet< KoShape * > &shapes) override
void paint(QPainter &, const KoViewConverter &) override
KisPaintDeviceSP m_referencePaintDevice
void endPrimaryAction(KoPointerEvent *event) override
void setSection(const QString &section)
void setActivationShapeId(const QString &activationShapeId)
void setIconName(const char *iconName)
void setToolTip(const QString &tooltip)
void setPriority(int newPriority)
#define koIconNameCStr(name)
Definition kis_icon.h:28
static const QString KRITA_TOOL_ACTIVATION_ID
Definition kis_tool.h:37
static const QString Select
Tools that select pixels.
KisCanvas2 * canvas