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

#include <KisHandleStyle.h>

Classes

struct  IterationStyle
 

Static Public Member Functions

static KisHandleStylegradientArrows ()
 
static KisHandleStylegradientHandles ()
 
static KisHandleStylehighlightedPrimaryHandles ()
 
static KisHandleStylehighlightedPrimaryHandlesWithSolidOutline ()
 
static KisHandleStyleinheritStyle ()
 
static KisHandleStylepartiallyHighlightedPrimaryHandles ()
 
static KisHandleStyleprimarySelection ()
 
static KisHandleStylesecondarySelection ()
 
static KisHandleStyleselectedPrimaryHandles ()
 

Public Attributes

QVector< IterationStylehandleIterations
 
QVector< IterationStylelineIterations
 

Detailed Description

A special class that defines a set of predefined styles for painting handles. Please use static methods for requesting standard krita styles.

Definition at line 21 of file KisHandleStyle.h.

Member Function Documentation

◆ gradientArrows()

KisHandleStyle & KisHandleStyle::gradientArrows ( )
static

Style for painting linear gradient arrows

Definition at line 88 of file KisHandleStyle.cpp.

89{
90 return primarySelection();
91}
static KisHandleStyle & primarySelection()

References primarySelection().

◆ gradientHandles()

KisHandleStyle & KisHandleStyle::gradientHandles ( )
static

Style for painting gradient handles

Definition at line 76 of file KisHandleStyle.cpp.

77{
78 static QScopedPointer<KisHandleStyle> style;
79
80 if (!style) {
81 style.reset(new KisHandleStyle());
82 initDashedStyle(primaryColor, gradientFillColor, style.data());
83 }
84
85 return *style;
86}

◆ highlightedPrimaryHandles()

KisHandleStyle & KisHandleStyle::highlightedPrimaryHandles ( )
static

Same as primary style, but the handles are filled with red color to show that the user is hovering them.

Definition at line 94 of file KisHandleStyle.cpp.

95{
96 static QScopedPointer<KisHandleStyle> style;
97
98 if (!style) {
99 style.reset(new KisHandleStyle());
100 initDashedStyle(highlightOutlineColor, highlightColor, style.data());
101 }
102
103 return *style;
104}

◆ highlightedPrimaryHandlesWithSolidOutline()

KisHandleStyle & KisHandleStyle::highlightedPrimaryHandlesWithSolidOutline ( )
static

Same as primary style, but the handles are filled with red color to show that the user is hovering them and the outline is solid

Definition at line 106 of file KisHandleStyle.cpp.

107{
108 static QScopedPointer<KisHandleStyle> style;
109
110 if (!style) {
111 style.reset(new KisHandleStyle());
112 QPen h = QPen(highlightOutlineColor, 2);
113 h.setCosmetic(true);
114 style->handleIterations << KisHandleStyle::IterationStyle(h, highlightColor);
115 QPen l = QPen(highlightOutlineColor, 1);
116 l.setCosmetic(true);
117 l.setJoinStyle(Qt::RoundJoin);
118 style->lineIterations << KisHandleStyle::IterationStyle(l, Qt::NoBrush);
119 }
120
121 return *style;
122}

◆ inheritStyle()

KisHandleStyle & KisHandleStyle::inheritStyle ( )
static

Default style that does no change to the painter. That is, the painter will paint with its current pen and brush.

Definition at line 39 of file KisHandleStyle.cpp.

40{
41 static QScopedPointer<KisHandleStyle> style;
42
43 if (!style) {
44 style.reset(new KisHandleStyle());
45 style->lineIterations << KisHandleStyle::IterationStyle();
46 style->handleIterations << KisHandleStyle::IterationStyle();
47 }
48
49 return *style;
50}

References lineIterations.

◆ partiallyHighlightedPrimaryHandles()

KisHandleStyle & KisHandleStyle::partiallyHighlightedPrimaryHandles ( )
static

Used for nodes, which control points are highlighted (the node itself is not highlighted)

Definition at line 124 of file KisHandleStyle.cpp.

125{
126 static QScopedPointer<KisHandleStyle> style;
127
128 if (!style) {
129 style.reset(new KisHandleStyle());
130 initDashedStyle(highlightOutlineColor, selectionColor, style.data());
131 }
132
133 return *style;
134}

◆ primarySelection()

KisHandleStyle & KisHandleStyle::primarySelection ( )
static

Main style. Used for showing a single selection or a boundary box of multiple selected objects.

Definition at line 52 of file KisHandleStyle.cpp.

53{
54 static QScopedPointer<KisHandleStyle> style;
55
56 if (!style) {
57 style.reset(new KisHandleStyle());
58 initDashedStyle(primaryColor, Qt::white, style.data());
59 }
60
61 return *style;
62}

◆ secondarySelection()

KisHandleStyle & KisHandleStyle::secondarySelection ( )
static

Secondary style. Used for highlighting objects inside a multiple selection.

Definition at line 64 of file KisHandleStyle.cpp.

65{
66 static QScopedPointer<KisHandleStyle> style;
67
68 if (!style) {
69 style.reset(new KisHandleStyle());
70 initDashedStyle(secondaryColor, Qt::white, style.data());
71 }
72
73 return *style;
74}

◆ selectedPrimaryHandles()

KisHandleStyle & KisHandleStyle::selectedPrimaryHandles ( )
static

Same as primary style, but the handles are filled with green color to show that they are selected.

Definition at line 136 of file KisHandleStyle.cpp.

137{
138 static QScopedPointer<KisHandleStyle> style;
139
140 if (!style) {
141 style.reset(new KisHandleStyle());
142 initDashedStyle(primaryColor, selectionColor, style.data());
143 }
144
145 return *style;
146}

Member Data Documentation

◆ handleIterations

QVector<IterationStyle> KisHandleStyle::handleIterations

Definition at line 89 of file KisHandleStyle.h.

◆ lineIterations

QVector<IterationStyle> KisHandleStyle::lineIterations

Definition at line 90 of file KisHandleStyle.h.


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