//============================================================================== void DRowAudioEditorComponent::paint (Graphics& g) { Colour backgroundColour(0xFF455769); g.setColour(backgroundColour); g.fillRoundedRectangle(0, 0, getWidth(), getHeight(), 10); ColourGradient topHighlight(Colours::white.withAlpha(0.3f), 0, 0, Colours::white.withAlpha(0.0f), 0, 0 + 15, false); GradientBrush topBrush(topHighlight); g.setBrush(&topBrush); g.fillRoundedRectangle(0, 0, getWidth(), 30, 10); GradientBrush outlineGradient(Colours::white, 0, 00, backgroundColour.withBrightness(0.5f), 0, 20, false); g.setBrush(&outlineGradient); g.drawRoundedRectangle(0, 0, getWidth(), getHeight(), 10, 1.0f); }
void BarGraph::drawSegment( QPainter *p, const QRect &r, const QColor &c ) { if ( QPixmap::defaultDepth() > 8 ) { QColor topgrad = c.light(180); QLinearGradient grad (QPointF(r.x()+r.width()/2, r.y()), QPointF(r.x()+r.width()/2, r.y()+r.height())); grad.setColorAt(0,topgrad); grad.setColorAt(0.5,c); grad.setColorAt(1,topgrad); QBrush topBrush(grad); p->setBrush(topBrush); p->drawRect(r.x(), r.y(), r.width(), r.height()); } else { p->fillRect( r.x(), r.top(), r.width(), r.height(), c ); p->setPen(Qt::SolidLine); } }