Changeset View
Changeset View
Standalone View
Standalone View
libs/ui/canvas/kis_mirror_axis.h
Show All 18 Lines | |||||
19 | 19 | | |||
20 | #ifndef KISMIRRORAXIS_H | 20 | #ifndef KISMIRRORAXIS_H | ||
21 | #define KISMIRRORAXIS_H | 21 | #define KISMIRRORAXIS_H | ||
22 | 22 | | |||
23 | #include "kis_canvas_decoration.h" | 23 | #include "kis_canvas_decoration.h" | ||
24 | 24 | | |||
25 | class KisView; | 25 | class KisView; | ||
26 | class KisCanvasResourceProvider; | 26 | class KisCanvasResourceProvider; | ||
27 | class KisMirrorAxisConfig; | ||||
27 | 28 | | |||
28 | class KisMirrorAxis : public KisCanvasDecoration | 29 | class KisMirrorAxis : public KisCanvasDecoration | ||
29 | { | 30 | { | ||
30 | Q_OBJECT | 31 | Q_OBJECT | ||
31 | Q_PROPERTY(float handleSize READ handleSize WRITE setHandleSize NOTIFY handleSizeChanged) | 32 | Q_PROPERTY(float handleSize READ handleSize WRITE setHandleSize NOTIFY handleSizeChanged) | ||
32 | 33 | | |||
33 | public: | 34 | public: | ||
34 | KisMirrorAxis(KisCanvasResourceProvider* provider, QPointer<KisView> parent); | 35 | KisMirrorAxis(KisCanvasResourceProvider* provider, QPointer<KisView> parent); | ||
35 | ~KisMirrorAxis() override; | 36 | ~KisMirrorAxis() override; | ||
36 | 37 | | |||
37 | float handleSize() const; | 38 | float handleSize() const; | ||
38 | void setHandleSize(float newSize); | 39 | void setHandleSize(float newSize); | ||
39 | void setVisible(bool v) override; | 40 | void setVisible(bool v) override; | ||
40 | 41 | | |||
42 | void setMirrorAxisConfig(const KisMirrorAxisConfig& config); | ||||
43 | const KisMirrorAxisConfig& mirrorAxisConfig() const; | ||||
44 | | ||||
41 | Q_SIGNALS: | 45 | Q_SIGNALS: | ||
42 | void handleSizeChanged(); | 46 | void handleSizeChanged(); | ||
47 | void sigConfigChanged(); | ||||
43 | 48 | | |||
44 | protected: | 49 | protected: | ||
45 | void drawDecoration(QPainter& gc, const QRectF& updateArea, const KisCoordinatesConverter* converter, KisCanvas2* canvas) override; | 50 | void drawDecoration(QPainter& gc, const QRectF& updateArea, const KisCoordinatesConverter* converter, KisCanvas2* canvas) override; | ||
46 | bool eventFilter(QObject* target, QEvent* event) override; | 51 | bool eventFilter(QObject* target, QEvent* event) override; | ||
47 | 52 | | |||
48 | private: | 53 | private: | ||
49 | class Private; | 54 | class Private; | ||
50 | Private * const d; | 55 | Private * const d; | ||
51 | 56 | | |||
52 | private Q_SLOTS: | 57 | private Q_SLOTS: | ||
53 | void mirrorModeChanged(); | 58 | void mirrorModeChanged(); | ||
54 | void moveHorizontalAxisToCenter(); | 59 | void moveHorizontalAxisToCenter(); | ||
55 | void moveVerticalAxisToCenter(); | 60 | void moveVerticalAxisToCenter(); | ||
56 | }; | 61 | }; | ||
57 | 62 | | |||
58 | #endif // KISMIRRORAXIS_H | 63 | #endif // KISMIRRORAXIS_H |