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;
27
30
31class KRITAUI_EXPORT KisSelectionActionsPanel : public QObject
32{
33 Q_OBJECT
34public:
38
39 void draw(QPainter &painter, const KoColorDisplayRendererInterface *displayRendererInterface);
40 void setVisible(bool visible);
41 void setEnabled(bool enabled);
42 bool eventFilter(QObject *obj, QEvent *event) override;
43
44 void canvasWidgetChanged(KisCanvasWidgetBase* canvas);
45
46private Q_SLOTS:
47 void showContextMenu(const QPoint& pos);
48 void disableSelectionActionsPanel();
49 void configureSelectionActionsPanel();
50
51private:
52 QPoint updateCanvasBoundaries(QPoint position, QWidget *canvasWidget) const;
53 QPoint initialDragHandlePosition() const;
54 void drawActionBarBackground(QPainter &gc, const KoColorDisplayRendererInterface *displayRendererInterface) const;
55
56 bool handlePress(QEvent *event, const QPoint &pos, Qt::MouseButton button = Qt::LeftButton);
57 bool handleMove(QEvent *event, const QPoint &pos);
58 bool handleRelease(QEvent *event, const QPoint &pos);
59
61 void movePanelWidgets();
62
63 QPoint mouseEventPos(const QMouseEvent *mouseEvent);
64 QPoint tabletEventPos(const QTabletEvent *tabletEvent);
65 // Touch events can have zero touch points when pressing an entire palm on
66 // the screen on Android, so this returns false if this is a non-touch.
67 bool touchEventPos(const QTouchEvent *touchEvent, QPoint &outPos);
68
69 QPoint transformHandleCoords(QPoint pos);
70
71 struct Private;
72 QScopedPointer<Private> d;
73};
74
75#endif
bool handleRelease(QEvent *event, const QPoint &pos)
KisSharedPtr< KisSelectionActionsPanel > KisSelectionActionsPanelSP
QString button(const QWheelEvent &ev)