- pixmap = pixmap.scaled( label->maximumWidth(),
- label->maximumHeight(), Qt::KeepAspectRatio );
+ /* Scale up the pixmap to fill widget's size */
+ f_alpha = ( (float) pixmap.height() / (float) height() );
+ pixmap = pixmap.scaled(
+ width() - MARGIN * 2,
+ height() - MARGIN * 2,
+ Qt::KeepAspectRatio,
+ ( f_alpha < .2 )? /* Don't waste cpu when not visible */
+ Qt::SmoothTransformation:
+ Qt::FastTransformation
+ );
+ /* Non agressive alpha compositing when sizing up */
+ pMask = QBitmap( pixmap.width(), pixmap.height() );
+ pMask.fill( QColor::fromRgbF( 1.0, 1.0, 1.0, f_alpha ) );
+ pixmap.setMask( pMask );