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 QWidget
31{
32 Q_OBJECT
33public:
35 KisSelectionActionsPanel(KisViewManager *viewManager, QWidget *parent);
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
43private:
45 QPushButton *createButton(const QString &iconName, const QString &tooltip);
46 QPoint updateCanvasBoundaries(QPoint position, QWidget *canvasWidget) const;
47 QPoint initialDragHandlePosition() const;
48 void drawActionBarBackground(QPainter &gc) const;
49
50 bool handlePress(QEvent *event, const QPoint &pos, Qt::MouseButton button = Qt::LeftButton);
51 bool handleMove(QEvent *event, const QPoint &pos, QObject *obj);
52 bool handleRelease(QEvent *event, const QPoint &pos, QObject *obj);
53
54 static QPoint mouseEventPos(const QMouseEvent *mouseEvent);
55 static QPoint tabletEventPos(const QTabletEvent *tabletEvent);
56 // Touch events can have zero touch points when pressing an entire palm on
57 // the screen on Android, so this returns false if this is a non-touch.
58 static bool touchEventPos(const QTouchEvent *touchEvent, QPoint &outPos);
59
60 struct Private;
61 QScopedPointer<Private> d;
62
63Q_SIGNALS:
64};
65
66#endif
bool handleRelease(QEvent *event, const QPoint &pos, QObject *obj)
KisSharedPtr< KisSelectionActionsPanel > KisSelectionActionsPanelSP
QString button(const QWheelEvent &ev)