mirror of
https://github.com/tomahawk-player/tomahawk.git
synced 2025-07-31 11:20:22 +02:00
* Got rid of cover shadow / gradient.
This commit is contained in:
@@ -179,23 +179,13 @@ GridItemDelegate::paint( QPainter* painter, const QStyleOptionViewItem& option,
|
|||||||
int topHeight = QFontMetrics( boldFont ).boundingRect( top ).height();
|
int topHeight = QFontMetrics( boldFont ).boundingRect( top ).height();
|
||||||
int frameHeight = bottomHeight + topHeight + 10;
|
int frameHeight = bottomHeight + topHeight + 10;
|
||||||
|
|
||||||
QColor c1;
|
QRect gradientRect = r.adjusted( 0, r.height() - frameHeight * 1.2, 0, 0 );
|
||||||
c1.setRgb( 0, 0, 0 );
|
QColor gradientColor = opt.palette.background().color();
|
||||||
c1.setAlphaF( 0.00 );
|
gradientColor.setAlphaF( 0.66 );
|
||||||
QColor c2;
|
|
||||||
c2.setRgb( 0, 0, 0 );
|
|
||||||
c2.setAlphaF( 0.88 );
|
|
||||||
|
|
||||||
QRect gradientRect = r.adjusted( 0, r.height() - frameHeight * 2, 0, 0 );
|
|
||||||
QLinearGradient gradient( QPointF( 0, 0 ), QPointF( 0, 1 ) );
|
|
||||||
gradient.setCoordinateMode( QGradient::ObjectBoundingMode );
|
|
||||||
gradient.setColorAt( 0.0, c1 );
|
|
||||||
gradient.setColorAt( 0.6, c2 );
|
|
||||||
gradient.setColorAt( 1.0, c2 );
|
|
||||||
|
|
||||||
painter->save();
|
painter->save();
|
||||||
painter->setPen( Qt::transparent );
|
painter->setPen( Qt::transparent );
|
||||||
painter->setBrush( gradient );
|
painter->setBrush( gradientColor );
|
||||||
painter->drawRect( gradientRect );
|
painter->drawRect( gradientRect );
|
||||||
painter->restore();
|
painter->restore();
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user