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 95 of file LayerBox.cpp.

Constructor & Destructor Documentation

◆ LayerBoxStyle()

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

Definition at line 98 of file LayerBox.cpp.

98: QProxyStyle(baseStyle) {}

Member Function Documentation

◆ drawPrimitive()

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

Definition at line 100 of file LayerBox.cpp.

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

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