fix wallpaper refresh and editinit error

This commit is contained in:
likehomedream 2023-11-30 16:03:09 +08:00
parent 08f1a0019e
commit 755b090fde
2 changed files with 4 additions and 3 deletions

View File

@ -119,10 +119,11 @@ void GlobalImageWidget::updateWidgetBackgroundColor(const QColor& color)
*
*
*
* @param coverFilePath
* @param WallpaperFilePath
*/
void GlobalImageWidget::updateWallpaper(const QString &WallpaperFilePath)
{
m_image = QPixmap();
m_image = QPixmap(WallpaperFilePath);
m_image = m_image.scaled(1920, 1080, Qt::KeepAspectRatio, Qt::SmoothTransformation);
if (m_image.isNull()) {

View File

@ -49,7 +49,7 @@ void GlobalThemeWidget::eidtInitWidget(const HistoryInfo &InfoData)
this->setTransparency(m_info.transparency);
this->setWindowRadius(m_info.windowradius);
// m_preview->updateWallpaper(m_info.wallpaperpath);
m_preview->updateWallpaper(m_info.wallpaperpath);
// this->update();
}
@ -67,7 +67,7 @@ void GlobalThemeWidget::refresh()
this->setTransparency(65);
this->setCover(":/resource/background/background-glazing.png");
this->setWallpaper(":/resource/background/background-light.png");
// m_preview->updateWallpaper(":/resource/background/background-light.png");
m_preview->updateWallpaper(":/resource/background/background-light.png");
m_preview->updatescale1();
}