Fix scaling of context view background when size of view changes.
This commit is contained in:
committed by
craig.p.drummond
parent
22d5977188
commit
cd4f653e32
@@ -27,6 +27,7 @@
|
||||
6. If a sidebar view has focus, but sidebar is collapsed, then find action
|
||||
should activate playqueue search widget.
|
||||
7. FreeBSD 1.0 compile fixes.
|
||||
8. Fix scaling of context view background when size of view changes.
|
||||
|
||||
1.3.0.1
|
||||
-------
|
||||
|
||||
@@ -730,7 +730,11 @@ void ContextWidget::updateImage(QImage img, bool created)
|
||||
painter.end();
|
||||
img = blurred;
|
||||
}
|
||||
#ifdef SCALE_CONTEXT_BGND
|
||||
currentImage=img;
|
||||
#else
|
||||
currentBackdrop=QPixmap::fromImage(img);
|
||||
#endif
|
||||
}
|
||||
albumCoverBackdrop=created;
|
||||
resizeBackdrop();
|
||||
@@ -1209,9 +1213,9 @@ void ContextWidget::createBackdrop()
|
||||
void ContextWidget::resizeBackdrop()
|
||||
{
|
||||
#ifdef SCALE_CONTEXT_BGND
|
||||
if (!currentBackdrop.isNull() && !albumCoverBackdrop && currentBackdrop.width()!=width()) {
|
||||
QSize sz(width(), width()*currentBackdrop.height()/currentBackdrop.width());
|
||||
currentBackdrop=currentBackdrop.scaled(sz, Qt::KeepAspectRatio, Qt::SmoothTransformation);
|
||||
if (!albumCoverBackdrop && !currentImage.isNull() &&( currentBackdrop.isNull() || (!currentBackdrop.isNull() && currentBackdrop.width()!=width()))) {
|
||||
QSize sz(width(), width()*currentImage.height()/currentImage.width());
|
||||
currentBackdrop = QPixmap::fromImage(currentImage.scaled(sz, Qt::KeepAspectRatioByExpanding, Qt::SmoothTransformation));
|
||||
}
|
||||
#else
|
||||
if (!currentBackdrop.isNull() && !albumCoverBackdrop) {
|
||||
|
||||
@@ -148,6 +148,9 @@ private:
|
||||
bool useFanArt;
|
||||
bool albumCoverBackdrop;
|
||||
Song currentSong;
|
||||
#ifdef SCALE_CONTEXT_BGND
|
||||
QImage currentImage;
|
||||
#endif
|
||||
QPixmap oldBackdrop;
|
||||
QPixmap currentBackdrop;
|
||||
QString currentArtist;
|
||||
|
||||
Reference in New Issue
Block a user