diff --git a/ChangeLog b/ChangeLog index 6cdf2f113..09232bcc1 100644 --- a/ChangeLog +++ b/ChangeLog @@ -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 ------- diff --git a/context/contextwidget.cpp b/context/contextwidget.cpp index 8eea8c35e..60569a1a1 100644 --- a/context/contextwidget.cpp +++ b/context/contextwidget.cpp @@ -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) { diff --git a/context/contextwidget.h b/context/contextwidget.h index 84c66e802..f05ffba75 100644 --- a/context/contextwidget.h +++ b/context/contextwidget.h @@ -148,6 +148,9 @@ private: bool useFanArt; bool albumCoverBackdrop; Song currentSong; + #ifdef SCALE_CONTEXT_BGND + QImage currentImage; + #endif QPixmap oldBackdrop; QPixmap currentBackdrop; QString currentArtist;