mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-28 13:28:01 +03:00
Qt: Fix gamelist icon after stopping a movie
Do not set an icon if it's null. This happens because we save memory by clearing the pixmap of non-movie items. Also don't stop the movie here, as it should be stopped already anyway.
This commit is contained in:
parent
e80809f629
commit
9295e6f5c8
2 changed files with 10 additions and 10 deletions
|
@ -91,19 +91,19 @@ void game_list_grid::populate(
|
||||||
if (const QPixmap pixmap = item->get_movie_image(frame); item->get_active() && !pixmap.isNull())
|
if (const QPixmap pixmap = item->get_movie_image(frame); item->get_active() && !pixmap.isNull())
|
||||||
{
|
{
|
||||||
item->set_icon(gui::utils::get_centered_pixmap(pixmap, m_icon_size, 0, 0, 1.0, Qt::FastTransformation));
|
item->set_icon(gui::utils::get_centered_pixmap(pixmap, m_icon_size, 0, 0, 1.0, Qt::FastTransformation));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
std::lock_guard lock(item->pixmap_mutex);
|
|
||||||
|
|
||||||
|
std::lock_guard lock(item->pixmap_mutex);
|
||||||
|
|
||||||
|
if (!game->pxmap.isNull())
|
||||||
|
{
|
||||||
item->set_icon(game->pxmap);
|
item->set_icon(game->pxmap);
|
||||||
|
|
||||||
if (!game->has_hover_gif && !game->has_hover_pam)
|
if (!game->has_hover_gif && !game->has_hover_pam)
|
||||||
{
|
{
|
||||||
game->pxmap = {};
|
game->pxmap = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
item->stop_movie();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
@ -252,19 +252,19 @@ void game_list_table::populate(
|
||||||
if (const QPixmap pixmap = icon_item->get_movie_image(frame); icon_item->get_active() && !pixmap.isNull())
|
if (const QPixmap pixmap = icon_item->get_movie_image(frame); icon_item->get_active() && !pixmap.isNull())
|
||||||
{
|
{
|
||||||
icon_item->setData(Qt::DecorationRole, pixmap.scaled(m_icon_size, Qt::KeepAspectRatio));
|
icon_item->setData(Qt::DecorationRole, pixmap.scaled(m_icon_size, Qt::KeepAspectRatio));
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
else
|
|
||||||
{
|
|
||||||
std::lock_guard lock(icon_item->pixmap_mutex);
|
|
||||||
|
|
||||||
|
std::lock_guard lock(icon_item->pixmap_mutex);
|
||||||
|
|
||||||
|
if (!game->pxmap.isNull())
|
||||||
|
{
|
||||||
icon_item->setData(Qt::DecorationRole, game->pxmap);
|
icon_item->setData(Qt::DecorationRole, game->pxmap);
|
||||||
|
|
||||||
if (!game->has_hover_gif && !game->has_hover_pam)
|
if (!game->has_hover_gif && !game->has_hover_pam)
|
||||||
{
|
{
|
||||||
game->pxmap = {};
|
game->pxmap = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
icon_item->stop_movie();
|
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue