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 | void acceptSelection(); | 56 | 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 | void drawBottomHelpText(QPainter& painter); | 64 | void drawBottomHelpText(QPainter& painter); | ||
64 | void drawDragHandles(QPainter& painter); | 65 | void drawDragHandles(QPainter& painter); | ||
66 | void drawMagnifier(QPainter& painter); | ||||
65 | void drawMidHelpText(QPainter& painter); | 67 | void drawMidHelpText(QPainter& painter); | ||
66 | void drawSelectionSizeTooltip(QPainter& painter); | 68 | void drawSelectionSizeTooltip(QPainter& painter); | ||
67 | void layoutBottomHelpText(); | 69 | void layoutBottomHelpText(); | ||
68 | void setMouseCursor(const QPointF& pos); | 70 | 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 | static const int magOffset; | ||||
90 | | ||||
85 | QColor mMaskColour; | 91 | QColor mMaskColour; | ||
86 | QColor mStrokeColour; | 92 | QColor mStrokeColour; | ||
93 | QColor mCrossColour; | ||||
87 | QColor mLabelBackgroundColour; | 94 | QColor mLabelBackgroundColour; | ||
88 | QColor mLabelForegroundColour; | 95 | QColor mLabelForegroundColour; | ||
89 | QRectF mSelection; | 96 | QRectF mSelection; | ||
90 | QPointF mStartPos; | 97 | QPointF mStartPos; | ||
91 | QPointF mInitialTopLeft; | 98 | QPointF mInitialTopLeft; | ||
92 | QString mMidHelpText; | 99 | QString mMidHelpText; | ||
93 | QFont mMidHelpTextFont; | 100 | QFont mMidHelpTextFont; | ||
94 | static constexpr int bottomHelpLength = 4; | 101 | static constexpr int bottomHelpLength = 4; | ||
95 | QPair<QStaticText, QStaticText> mBottomHelpText[bottomHelpLength]; | 102 | QPair<QStaticText, QStaticText> mBottomHelpText[bottomHelpLength]; | ||
96 | QFont mBottomHelpTextFont; | 103 | QFont mBottomHelpTextFont; | ||
97 | QRect mBottomHelpBorderBox; | 104 | QRect mBottomHelpBorderBox; | ||
98 | QPoint mBottomHelpContentPos; | 105 | QPoint mBottomHelpContentPos; | ||
99 | int mBottomHelpGridLeftWidth; | 106 | int mBottomHelpGridLeftWidth; | ||
100 | MouseState mMouseDragState; | 107 | MouseState mMouseDragState; | ||
101 | QPixmap mPixmap; | 108 | QPixmap mPixmap; | ||
102 | qreal dprI; | 109 | qreal dprI; | ||
110 | QPointF mMousePos; | ||||
111 | bool mMagnifierAllowed; | ||||
112 | bool mShowMagnifier; | ||||
113 | bool mToggleMagnifier; | ||||
103 | 114 | | |||
104 | signals: | 115 | signals: | ||
105 | void grabDone(const QPixmap &pixmap); | 116 | void grabDone(const QPixmap &pixmap); | ||
106 | void grabCancelled(); | 117 | void grabCancelled(); | ||
107 | }; | 118 | }; | ||
108 | 119 | | |||
109 | #endif // QUICKEDITOR_H | 120 | #endif // QUICKEDITOR_H |