[plasmalnf] Properly scale the image
- Since the image size isn't known a priori (due to sizing based on fonts), load the image and then resize in all code paths. - Use the right resizing flags. - .. and actually use the resulting scaled pixmap. Thanks to Jeff Hodd.
This commit is contained in:
parent
958aee1d41
commit
04de4a0b02
@ -57,8 +57,8 @@ ThemeWidget::ThemeWidget(const ThemeInfo& info, QWidget* parent)
|
|||||||
cDebug() << "Theme image" << info.imagePath << "not found, hash" << hash_color;
|
cDebug() << "Theme image" << info.imagePath << "not found, hash" << hash_color;
|
||||||
image.fill( QColor( QRgb( hash_color ) ) );
|
image.fill( QColor( QRgb( hash_color ) ) );
|
||||||
}
|
}
|
||||||
else
|
|
||||||
image.scaled( image_size );
|
image = image.scaled( image_size, Qt::KeepAspectRatio, Qt::SmoothTransformation );
|
||||||
|
|
||||||
QLabel* image_label = new QLabel( this );
|
QLabel* image_label = new QLabel( this );
|
||||||
image_label->setPixmap( image );
|
image_label->setPixmap( image );
|
||||||
|
Loading…
Reference in New Issue
Block a user