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

#include <KisHandleStyle.h>

Classes

struct  IterationStyle
 

Static Public Member Functions

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

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 44 of file KisHandleStyle.h.

Member Function Documentation

◆ gradientArrows()

KisHandleStyle & KisHandleStyle::gradientArrows ( KisHandlePalette palette = KisHandlePalette())
static

Style for painting linear gradient arrows

Definition at line 79 of file KisHandleStyle.cpp.

80{
82}
static KisHandleStyle & primarySelection(KisHandlePalette palette=KisHandlePalette())
rgba palette[MAX_PALETTE]
Definition palette.c:35

References palette, and primarySelection().

◆ gradientHandles()

KisHandleStyle & KisHandleStyle::gradientHandles ( KisHandlePalette palette = KisHandlePalette())
static

Style for painting gradient handles

Definition at line 67 of file KisHandleStyle.cpp.

68{
69 static QScopedPointer<KisHandleStyle> style;
70
71 if (!style) {
72 style.reset(new KisHandleStyle());
73 initDashedStyle(palette.primaryColor, palette.gradientFillColor, style.data(), palette.white);
74 }
75
76 return *style;
77}

References palette.

◆ highlightedPrimaryHandles()

KisHandleStyle & KisHandleStyle::highlightedPrimaryHandles ( KisHandlePalette palette = KisHandlePalette())
static

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

Definition at line 85 of file KisHandleStyle.cpp.

86{
87 static QScopedPointer<KisHandleStyle> style;
88
89 if (!style) {
90 style.reset(new KisHandleStyle());
91 initDashedStyle(palette.highlightOutlineColor, palette.highlightColor, style.data(), palette.white);
92 }
93
94 return *style;
95}

References palette.

◆ highlightedPrimaryHandlesWithSolidOutline()

KisHandleStyle & KisHandleStyle::highlightedPrimaryHandlesWithSolidOutline ( KisHandlePalette palette = KisHandlePalette())
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 97 of file KisHandleStyle.cpp.

98{
99 static QScopedPointer<KisHandleStyle> style;
100
101 if (!style) {
102 style.reset(new KisHandleStyle());
103 QPen h = QPen(palette.highlightOutlineColor, 2);
104 h.setCosmetic(true);
105 style->handleIterations << KisHandleStyle::IterationStyle(h, palette.highlightColor);
106 QPen l = QPen(palette.highlightOutlineColor, 1);
107 l.setCosmetic(true);
108 l.setJoinStyle(Qt::RoundJoin);
109 style->lineIterations << KisHandleStyle::IterationStyle(l, Qt::NoBrush);
110 }
111
112 return *style;
113}

References palette.

◆ 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 30 of file KisHandleStyle.cpp.

31{
32 static QScopedPointer<KisHandleStyle> style;
33
34 if (!style) {
35 style.reset(new KisHandleStyle());
36 style->lineIterations << KisHandleStyle::IterationStyle();
37 style->handleIterations << KisHandleStyle::IterationStyle();
38 }
39
40 return *style;
41}

References lineIterations.

◆ partiallyHighlightedPrimaryHandles()

KisHandleStyle & KisHandleStyle::partiallyHighlightedPrimaryHandles ( KisHandlePalette palette = KisHandlePalette())
static

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

Definition at line 115 of file KisHandleStyle.cpp.

116{
117 static QScopedPointer<KisHandleStyle> style;
118
119 if (!style) {
120 style.reset(new KisHandleStyle());
121 initDashedStyle(palette.highlightOutlineColor, palette.selectionColor, style.data(), palette.white);
122 }
123
124 return *style;
125}

References palette.

◆ primarySelection()

KisHandleStyle & KisHandleStyle::primarySelection ( KisHandlePalette palette = KisHandlePalette())
static

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

Definition at line 43 of file KisHandleStyle.cpp.

44{
45 static QScopedPointer<KisHandleStyle> style;
46
47 if (!style) {
48 style.reset(new KisHandleStyle());
49 initDashedStyle(palette.primaryColor, palette.white, style.data(), palette.white);
50 }
51
52 return *style;
53}

References palette.

◆ secondarySelection()

KisHandleStyle & KisHandleStyle::secondarySelection ( KisHandlePalette palette = KisHandlePalette())
static

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

Definition at line 55 of file KisHandleStyle.cpp.

56{
57 static QScopedPointer<KisHandleStyle> style;
58
59 if (!style) {
60 style.reset(new KisHandleStyle());
61 initDashedStyle(palette.secondaryColor, palette.white, style.data(), palette.white);
62 }
63
64 return *style;
65}

References palette.

◆ selectedPrimaryHandles()

KisHandleStyle & KisHandleStyle::selectedPrimaryHandles ( KisHandlePalette palette = KisHandlePalette())
static

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

Definition at line 127 of file KisHandleStyle.cpp.

128{
129 static QScopedPointer<KisHandleStyle> style;
130
131 if (!style) {
132 style.reset(new KisHandleStyle());
133 initDashedStyle(palette.primaryColor, palette.selectionColor, style.data(), palette.white);
134 }
135
136 return *style;
137}

References palette.

Member Data Documentation

◆ handleIterations

QVector<IterationStyle> KisHandleStyle::handleIterations

Definition at line 112 of file KisHandleStyle.h.

◆ lineIterations

QVector<IterationStyle> KisHandleStyle::lineIterations

Definition at line 113 of file KisHandleStyle.h.


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