Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_tool_select_contiguous.h
Go to the documentation of this file.
1/*
2 * kis_tool_select_contiguous.h - part of KImageShop^WKrayon^Krita
3 *
4 * SPDX-FileCopyrightText: 1999 Michael Koch <koch@kde.org>
5 * SPDX-FileCopyrightText: 2002 Patrick Julien <freak@codepimps.org>
6 * SPDX-FileCopyrightText: 2015 Michael Abrahams <miabraha@gmail.com>
7 *
8 * SPDX-License-Identifier: GPL-2.0-or-later
9 */
10
11#ifndef __KIS_TOOL_SELECT_CONTIGUOUS_H__
12#define __KIS_TOOL_SELECT_CONTIGUOUS_H__
13
16#include <kis_icon.h>
17#include <kconfig.h>
18#include <kconfiggroup.h>
20
21class KoGroupButton;
22
28{
29
30 Q_OBJECT
31
32public:
38
40 ~KisToolSelectContiguous() override;
41
42 QWidget* createOptionWidget() override;
43 void paint(QPainter &painter, const KoViewConverter &converter) override;
44
45 void beginPrimaryAction(KoPointerEvent *event) override;
46 void endPrimaryAction(KoPointerEvent *event) override;
47
48 void resetCursorStyle() override;
49
50protected:
51
52 bool wantsAutoScroll() const override { return false; }
53
54 bool isPixelOnly() const override { return true; }
55 bool usesColorLabels() const override { return true; }
56
57public Q_SLOTS:
58 void activate(const QSet<KoShape*> &shapes) override;
59 void deactivate() override;
60
63 void slotSetThreshold(int);
64 void slotSetOpacitySpread(int);
65 void slotSetCloseGap(int);
67
68protected:
70
71private:
75 int m_opacitySpread {100};
76 int m_closeGap {0};
78 KConfigGroup m_configGroup;
82
84
85private Q_SLOTS:
87 KoGroupButton*, bool
88 );
89};
90
92{
93public:
95 : KisSelectionToolFactoryBase("KisToolSelectContiguous")
96 {
97 setToolTip(i18n("Contiguous Selection Tool"));
99 setIconName(koIconNameCStr("tool_contiguous_selection"));
100 setPriority(4);
102 }
103
105
109};
110
111#endif //__KIS_TOOL_SELECT_CONTIGUOUS_H__
KisSelectionToolConfigWidgetHelper m_widgetHelper
KoToolBase * createTool(KoCanvasBase *canvas) override
KisMergeLabeledLayersCommand::ReferenceNodeInfoListSP m_referenceNodeList
KisToolSelectContiguous(KoCanvasBase *canvas)
void slotSetContiguousSelectionMode(ContiguousSelectionMode)
void activate(const QSet< KoShape * > &shapes) override
void paint(QPainter &painter, const KoViewConverter &converter) override
void beginPrimaryAction(KoPointerEvent *event) override
ContiguousSelectionMode m_contiguousSelectionMode
void slotSetContiguousSelectionBoundaryColor(const KoColor &)
void endPrimaryAction(KoPointerEvent *event) override
bool wantsAutoScroll() const override
void slot_optionButtonStripContiguousSelectionMode_buttonToggled(KoGroupButton *, bool)
bool usesColorLabels() const 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