Krita Source Code Documentation
Loading...
Searching...
No Matches
LayerBoxStyle Class Reference
+ Inheritance diagram for LayerBoxStyle:

Public Member Functions

void drawPrimitive (PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const override
 
 LayerBoxStyle (QStyle *baseStyle=0)
 

Detailed Description

Definition at line 93 of file LayerBox.cpp.

Constructor & Destructor Documentation

◆ LayerBoxStyle()

LayerBoxStyle::LayerBoxStyle ( QStyle * baseStyle = 0)
inline

Definition at line 96 of file LayerBox.cpp.

96: QProxyStyle(baseStyle) {}

Member Function Documentation

◆ drawPrimitive()

void LayerBoxStyle::drawPrimitive ( PrimitiveElement element,
const QStyleOption * option,
QPainter * painter,
const QWidget * widget ) const
inlineoverride

Definition at line 98 of file LayerBox.cpp.

102 {
103 if (element == QStyle::PE_IndicatorItemViewItemDrop)
104 {
105 QColor color(widget->palette().color(QPalette::Highlight).lighter());
106
107 if (option->rect.height() == 0) {
108 QBrush brush(color);
109
110 QRect r(option->rect);
111 r.setTop(r.top() - 2);
112 r.setBottom(r.bottom() + 2);
113
114 painter->fillRect(r, brush);
115 } else {
116 color.setAlpha(200);
117 QBrush brush(color);
118 painter->fillRect(option->rect, brush);
119 }
120 }
121 else
122 {
123 QProxyStyle::drawPrimitive(element, option, painter, widget);
124 }
125 }

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