Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 7 additions & 4 deletions src/widgets/fullscreenbackground.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ FullscreenBackground::FullscreenBackground(SessionBaseModel *model, QWidget *par
, m_useSolidBackground(false)
, m_fadeOutAniFinished(false)
, m_enableAnimation(true)
, m_useBlurBackground(true)
, m_blackWidget(new BlackWidget(this))
{
#ifndef QT_DEBUG
Expand Down Expand Up @@ -89,12 +90,12 @@ FullscreenBackground::~FullscreenBackground()

void FullscreenBackground::updateBackground(const QString &path)
{
m_useBlurBackground = true;
if (m_useSolidBackground)
return;

if (isPicture(path)) {
// 动画播放完毕不再需要清晰的背景图片
if (!m_fadeOutAniFinished && !(backgroundPath == path && contains(PIXMAP_TYPE_BACKGROUND))) {
if (!(backgroundPath == path && contains(PIXMAP_TYPE_BACKGROUND))) {
backgroundPath = path;
addPixmap(pixmapHandle(QPixmap(path)), PIXMAP_TYPE_BACKGROUND);
}
Expand Down Expand Up @@ -129,7 +130,9 @@ void FullscreenBackground::updateBlurBackground(const QString &path)
else
update();
} else {
qWarning() << "get blur background image error: " << reply.error().message();
qWarning() << "get blur background image error: " << reply.error().message() << ", then use normal background";
m_useBlurBackground = false;
update();
}
call->deleteLater();
}, Qt::QueuedConnection);
Expand Down Expand Up @@ -227,7 +230,7 @@ void FullscreenBackground::paintEvent(QPaintEvent *e)
if (m_useSolidBackground || (background.isNull() && blurBackground.isNull())) {
painter.fillRect(trueRect, QColor(DDESESSIONCC::SOLID_BACKGROUND_COLOR));
} else {
if (m_fadeOutAni) {
if (m_fadeOutAni && m_useBlurBackground) {
const double currentAniValue = m_fadeOutAni->currentValue().toDouble();
if (!background.isNull() && currentAniValue != 1.0) {
painter.setOpacity(1);
Expand Down
1 change: 1 addition & 0 deletions src/widgets/fullscreenbackground.h
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,7 @@ public slots:
bool m_useSolidBackground;
bool m_fadeOutAniFinished;
bool m_enableAnimation;
bool m_useBlurBackground;

BlackWidget *m_blackWidget;
};
Expand Down
Loading