Krita Source Code Documentation
Loading...
Searching...
No Matches
KisSelectionActionsPanelHandle Class Reference

#include <kis_selection_actions_panel_handle.h>

+ Inheritance diagram for KisSelectionActionsPanelHandle:

Classes

struct  Private
 

Public Member Functions

void draw (QPainter &painter)
 
 KisSelectionActionsPanelHandle (int size, QWidget *parent)
 
void set_held (bool held)
 
 ~KisSelectionActionsPanelHandle ()
 

Private Attributes

QScopedPointer< Privated
 

Detailed Description

Definition at line 12 of file kis_selection_actions_panel_handle.h.

Constructor & Destructor Documentation

◆ KisSelectionActionsPanelHandle()

KisSelectionActionsPanelHandle::KisSelectionActionsPanelHandle ( int size,
QWidget * parent )

Definition at line 20 of file kis_selection_actions_panel_handle.cpp.

20 :
21 QWidget(parent),
22 d(new Private(size))
23{
24 d->default_cursor = Qt::OpenHandCursor;
25 d->held_cursor = Qt::ClosedHandCursor;
26 d->handle_icon = KisIconUtils::loadIcon("drag-handle");
27 this->setCursor(d->default_cursor);
28 setFixedSize(size, size);
29 setAttribute(Qt::WA_AcceptTouchEvents);
30}
QIcon loadIcon(const QString &name)

References d, and KisIconUtils::loadIcon().

◆ ~KisSelectionActionsPanelHandle()

KisSelectionActionsPanelHandle::~KisSelectionActionsPanelHandle ( )

Definition at line 32 of file kis_selection_actions_panel_handle.cpp.

33{
34}

Member Function Documentation

◆ draw()

void KisSelectionActionsPanelHandle::draw ( QPainter & painter)

Definition at line 48 of file kis_selection_actions_panel_handle.cpp.

49{
50 QRect rect = geometry();
51
52 // Adjust the rect a bit to fill the right side of the bar properly
53 painter.fillRect(rect.marginsAdded(QMargins(-3, 4, 1, 4)), qApp->palette().window().color());
54
55 // Adjusting the icon location a bit to be properly centered
56 d->handle_icon.paint(&painter, QRect(rect.x() + 3, rect.y(), d->size, d->size));
57}

References d.

◆ set_held()

void KisSelectionActionsPanelHandle::set_held ( bool held)

Definition at line 36 of file kis_selection_actions_panel_handle.cpp.

37{
38 if(held)
39 {
40 this->setCursor(d->held_cursor);
41 }
42 else
43 {
44 this->setCursor(d->default_cursor);
45 }
46}

References d.

Member Data Documentation

◆ d

QScopedPointer<Private> KisSelectionActionsPanelHandle::d
private

Definition at line 21 of file kis_selection_actions_panel_handle.h.


The documentation for this class was generated from the following files: