Krita Source Code Documentation
Loading...
Searching...
No Matches
kis_selection_actions_panel.h
Go to the documentation of this file.
1/*
2 * SPDX-FileCopyrightText: 2025 Ross Rosales <ross.erosales@gmail.com>
3 *
4 * SPDX-License-Identifier: GPL-2.0-or-later
5 */
6
7#ifndef _KIS_SELECTION_ACTIONS_PANEL_H_
8#define _KIS_SELECTION_ACTIONS_PANEL_H_
9
10#include "kis_types.h"
11#include <QColor>
12#include <QObject>
13#include <QPointF>
14#include <QPushButton>
15
16#include "KoPointerEvent.h"
17#include "KoSnapGuide.h"
19#include "kis_icon_utils.h"
21#include <kritaui_export.h>
22
23class KisCanvas2;
25class KisViewManager;
26
29
30class KRITAUI_EXPORT KisSelectionActionsPanel : public QObject
31{
32 Q_OBJECT
33public:
37
38 void draw(QPainter &painter);
39 void setVisible(bool visible);
40 void setEnabled(bool enabled);
41 bool eventFilter(QObject *obj, QEvent *event) override;
42
43 void canvasWidgetChanged(KisCanvasWidgetBase* canvas);
44private:
45 QPoint updateCanvasBoundaries(QPoint position, QWidget *canvasWidget) const;
46 QPoint initialDragHandlePosition() const;
47 void drawActionBarBackground(QPainter &gc) const;
48
49 bool handlePress(QEvent *event, const QPoint &pos, Qt::MouseButton button = Qt::LeftButton);
50 bool handleMove(QEvent *event, const QPoint &pos);
51 bool handleRelease(QEvent *event, const QPoint &pos);
52
54 void movePanelWidgets();
55
56 QPoint mouseEventPos(const QMouseEvent *mouseEvent);
57 QPoint tabletEventPos(const QTabletEvent *tabletEvent);
58 // Touch events can have zero touch points when pressing an entire palm on
59 // the screen on Android, so this returns false if this is a non-touch.
60 bool touchEventPos(const QTouchEvent *touchEvent, QPoint &outPos);
61
62 constexpr QPoint transformHandleCoords(QPoint pos);
63
64 struct Private;
65 QScopedPointer<Private> d;
66};
67
68#endif
bool handleRelease(QEvent *event, const QPoint &pos)
KisSharedPtr< KisSelectionActionsPanel > KisSelectionActionsPanelSP
QString button(const QWheelEvent &ev)