Changeset View
Changeset View
Standalone View
Standalone View
src/QuickEditor/QuickEditor.h
Show First 20 Lines • Show All 49 Lines • ▼ Show 20 Line(s) | 38 | enum MouseState : short { | |||
---|---|---|---|---|---|
50 | TopLeftOrBottomRight = 4, // 100 | 50 | TopLeftOrBottomRight = 4, // 100 | ||
51 | TopRightOrBottomLeft = 8, // 1000 | 51 | TopRightOrBottomLeft = 8, // 1000 | ||
52 | TopOrBottom = 16, // 10000 | 52 | TopOrBottom = 16, // 10000 | ||
53 | RightOrLeft = 32, // 100000 | 53 | RightOrLeft = 32, // 100000 | ||
54 | }; | 54 | }; | ||
55 | 55 | | |||
56 | inline void acceptSelection(); | 56 | inline void acceptSelection(); | ||
57 | void keyPressEvent(QKeyEvent* event) override; | 57 | void keyPressEvent(QKeyEvent* event) override; | ||
58 | void keyReleaseEvent(QKeyEvent* event) override; | ||||
58 | void mousePressEvent(QMouseEvent* event) override; | 59 | void mousePressEvent(QMouseEvent* event) override; | ||
59 | void mouseMoveEvent(QMouseEvent* event) override; | 60 | void mouseMoveEvent(QMouseEvent* event) override; | ||
60 | void mouseReleaseEvent(QMouseEvent* event) override; | 61 | void mouseReleaseEvent(QMouseEvent* event) override; | ||
61 | void mouseDoubleClickEvent(QMouseEvent* event) override; | 62 | void mouseDoubleClickEvent(QMouseEvent* event) override; | ||
62 | void paintEvent(QPaintEvent*) override; | 63 | void paintEvent(QPaintEvent*) override; | ||
63 | inline void drawBottomHelpText(QPainter& painter); | 64 | inline void drawBottomHelpText(QPainter& painter); | ||
64 | inline void drawDragHandles(QPainter& painter); | 65 | inline void drawDragHandles(QPainter& painter); | ||
66 | inline void drawMagnifier(QPainter& painter); | ||||
65 | inline void drawMidHelpText(QPainter& painter); | 67 | inline void drawMidHelpText(QPainter& painter); | ||
66 | inline void drawSelectionSizeTooltip(QPainter& painter); | 68 | inline void drawSelectionSizeTooltip(QPainter& painter); | ||
67 | inline void layoutBottomHelpText(); | 69 | inline void layoutBottomHelpText(); | ||
68 | inline void setMouseCursor(const QPointF& pos); | 70 | inline void setMouseCursor(const QPointF& pos); | ||
69 | MouseState whereIsTheMouse(const QPointF& pos); | 71 | MouseState whereIsTheMouse(const QPointF& pos); | ||
70 | 72 | | |||
71 | static const qreal mouseAreaSize; | 73 | static const qreal mouseAreaSize; | ||
72 | static const qreal cornerHandleRadius; | 74 | static const qreal cornerHandleRadius; | ||
73 | static const qreal midHandleRadius; | 75 | static const qreal midHandleRadius; | ||
74 | static const int selectionSizeThreshold; | 76 | static const int selectionSizeThreshold; | ||
75 | 77 | | |||
76 | static const int selectionBoxPaddingX; | 78 | static const int selectionBoxPaddingX; | ||
77 | static const int selectionBoxPaddingY; | 79 | static const int selectionBoxPaddingY; | ||
78 | static const int selectionBoxMarginY; | 80 | static const int selectionBoxMarginY; | ||
79 | 81 | | |||
80 | static const int bottomHelpBoxPaddingX; | 82 | static const int bottomHelpBoxPaddingX; | ||
81 | static const int bottomHelpBoxPaddingY; | 83 | static const int bottomHelpBoxPaddingY; | ||
82 | static const int bottomHelpBoxPairSpacing; | 84 | static const int bottomHelpBoxPairSpacing; | ||
83 | static const int bottomHelpBoxLineHeight; | 85 | static const int bottomHelpBoxLineHeight; | ||
84 | 86 | | |||
87 | static const int magZoom; | ||||
88 | static const int magPixels; | ||||
89 | | ||||
85 | QColor mMaskColour; | 90 | QColor mMaskColour; | ||
86 | QColor mStrokeColor; | 91 | QColor mStrokeColour; | ||
92 | QColor mCrossColour; | ||||
87 | QColor mLabelBackgroundColour; | 93 | QColor mLabelBackgroundColour; | ||
88 | QColor mLabelForegroundColour; | 94 | QColor mLabelForegroundColour; | ||
89 | QRectF mSelection; | 95 | QRectF mSelection; | ||
90 | QPointF mStartPos; | 96 | QPointF mStartPos; | ||
91 | QPointF mInitialTopLeft; | 97 | QPointF mInitialTopLeft; | ||
92 | QString mMidHelpText; | 98 | QString mMidHelpText; | ||
93 | QFont mMidHelpTextFont; | 99 | QFont mMidHelpTextFont; | ||
94 | static constexpr int bottomHelpLength = 4; | 100 | static constexpr int bottomHelpLength = 4; | ||
95 | QPair<QStaticText, QStaticText> mBottomHelpText[bottomHelpLength]; | 101 | QPair<QStaticText, QStaticText> mBottomHelpText[bottomHelpLength]; | ||
96 | QFont mBottomHelpTextFont; | 102 | QFont mBottomHelpTextFont; | ||
97 | QRectF mBottomHelpBorderBox; | 103 | QRectF mBottomHelpBorderBox; | ||
98 | QPointF mBottomHelpContentPos; | 104 | QPointF mBottomHelpContentPos; | ||
99 | int mBottomHelpGridLeftWidth; | 105 | int mBottomHelpGridLeftWidth; | ||
100 | MouseState mMouseDragState; | 106 | MouseState mMouseDragState; | ||
101 | QPixmap mPixmap; | 107 | QPixmap mPixmap; | ||
108 | QPointF mMousePos; | ||||
109 | bool mMagnifierAllowed; | ||||
110 | bool mShowMagnifier; | ||||
111 | bool mToggleMagnifier; | ||||
102 | 112 | | |||
103 | signals: | 113 | signals: | ||
104 | void grabDone(const QPixmap &pixmap); | 114 | void grabDone(const QPixmap &pixmap); | ||
105 | void grabCancelled(); | 115 | void grabCancelled(); | ||
106 | }; | 116 | }; | ||
107 | 117 | | |||
108 | #endif // QUICKEDITOR_H | 118 | #endif // QUICKEDITOR_H |