mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-07-16 03:38:38 +12:00
Qt: release scaled pixmaps from memory if possible
This commit is contained in:
parent
4d70c483b2
commit
2fb68bfc03
3 changed files with 16 additions and 5 deletions
|
@ -17,10 +17,10 @@ struct gui_game_info
|
||||||
compat::status compat;
|
compat::status compat;
|
||||||
QPixmap icon;
|
QPixmap icon;
|
||||||
QPixmap pxmap;
|
QPixmap pxmap;
|
||||||
bool hasCustomConfig;
|
bool hasCustomConfig = false;
|
||||||
bool hasCustomPadConfig;
|
bool hasCustomPadConfig = false;
|
||||||
bool has_hover_gif;
|
bool has_hover_gif = false;
|
||||||
movie_item* item;
|
movie_item* item = nullptr;
|
||||||
};
|
};
|
||||||
|
|
||||||
typedef std::shared_ptr<gui_game_info> game_info;
|
typedef std::shared_ptr<gui_game_info> game_info;
|
||||||
|
|
|
@ -2289,7 +2289,7 @@ void game_list_frame::PopulateGameList()
|
||||||
|
|
||||||
icon_item->set_icon_func([this, icon_item, game](int)
|
icon_item->set_icon_func([this, icon_item, game](int)
|
||||||
{
|
{
|
||||||
ensure(icon_item);
|
ensure(icon_item && game);
|
||||||
|
|
||||||
if (QMovie* movie = icon_item->movie(); movie && icon_item->get_active())
|
if (QMovie* movie = icon_item->movie(); movie && icon_item->get_active())
|
||||||
{
|
{
|
||||||
|
@ -2298,6 +2298,12 @@ void game_list_frame::PopulateGameList()
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
icon_item->setData(Qt::DecorationRole, game->pxmap);
|
icon_item->setData(Qt::DecorationRole, game->pxmap);
|
||||||
|
|
||||||
|
if (!game->has_hover_gif)
|
||||||
|
{
|
||||||
|
game->pxmap = {};
|
||||||
|
}
|
||||||
|
|
||||||
if (movie)
|
if (movie)
|
||||||
{
|
{
|
||||||
movie->stop();
|
movie->stop();
|
||||||
|
|
|
@ -114,6 +114,11 @@ movie_item* game_list_grid::addItem(const game_info& app, const QString& name, c
|
||||||
painter.drawImage(offset, bg_img);
|
painter.drawImage(offset, bg_img);
|
||||||
painter.drawPixmap(offset, app->pxmap);
|
painter.drawPixmap(offset, app->pxmap);
|
||||||
|
|
||||||
|
if (!app->has_hover_gif)
|
||||||
|
{
|
||||||
|
app->pxmap = {};
|
||||||
|
}
|
||||||
|
|
||||||
if (movie)
|
if (movie)
|
||||||
{
|
{
|
||||||
movie->stop();
|
movie->stop();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue