mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-01-30 12:32:43 +00:00
Qt: fix game list custom config icon refresh
I accidentally forgot to update the custom config icon after custom config creation/removal. This happened during some refactoring back in mid-april.
This commit is contained in:
parent
a7d4da25a4
commit
20e25cd928
@ -1904,6 +1904,33 @@ QPixmap game_list_frame::PaintedPixmap(const QPixmap& icon, bool paint_config_ic
|
||||
return canvas.scaled(m_icon_size * device_pixel_ratio, Qt::KeepAspectRatio, Qt::TransformationMode::SmoothTransformation);
|
||||
}
|
||||
|
||||
void game_list_frame::SetCustomConfigIcon(QTableWidgetItem* title_item, const game_info& game)
|
||||
{
|
||||
if (!title_item || !game)
|
||||
return;
|
||||
|
||||
static QIcon icon_combo_config_bordered(":/Icons/combo_config_bordered.png");
|
||||
static QIcon icon_custom_config(":/Icons/custom_config.png");
|
||||
static QIcon icon_controllers(":/Icons/controllers.png");
|
||||
|
||||
if (game->hasCustomConfig && game->hasCustomPadConfig)
|
||||
{
|
||||
title_item->setIcon(icon_combo_config_bordered);
|
||||
}
|
||||
else if (game->hasCustomConfig)
|
||||
{
|
||||
title_item->setIcon(icon_custom_config);
|
||||
}
|
||||
else if (game->hasCustomPadConfig)
|
||||
{
|
||||
title_item->setIcon(icon_controllers);
|
||||
}
|
||||
else if (!title_item->icon().isNull())
|
||||
{
|
||||
title_item->setIcon({});
|
||||
}
|
||||
}
|
||||
|
||||
void game_list_frame::ShowCustomConfigIcon(const game_info& game)
|
||||
{
|
||||
if (!game)
|
||||
@ -1924,6 +1951,16 @@ void game_list_frame::ShowCustomConfigIcon(const game_info& game)
|
||||
}
|
||||
}
|
||||
|
||||
const QString q_serial = qstr(game->info.serial);
|
||||
|
||||
for (int row = 0; row < m_game_list->rowCount(); ++row)
|
||||
{
|
||||
if (const auto item = m_game_list->item(row, gui::column_serial); item && item->text() == q_serial)
|
||||
{
|
||||
SetCustomConfigIcon(m_game_list->item(row, gui::column_name), game);
|
||||
}
|
||||
}
|
||||
|
||||
RepaintIcons();
|
||||
}
|
||||
|
||||
@ -2101,10 +2138,6 @@ void game_list_frame::PopulateGameList()
|
||||
|
||||
const QString game_icon_path = m_play_hover_movies ? qstr(fs::get_config_dir() + "/Icons/game_icons/") : "";
|
||||
|
||||
static QIcon icon_combo_config_bordered(":/Icons/combo_config_bordered.png");
|
||||
static QIcon icon_custom_config(":/Icons/custom_config.png");
|
||||
static QIcon icon_controllers(":/Icons/controllers.png");
|
||||
|
||||
int row = 0;
|
||||
int index = -1;
|
||||
for (const auto& game : m_game_data)
|
||||
@ -2149,18 +2182,7 @@ void game_list_frame::PopulateGameList()
|
||||
|
||||
// Title
|
||||
custom_table_widget_item* title_item = new custom_table_widget_item(title);
|
||||
if (game->hasCustomConfig && game->hasCustomPadConfig)
|
||||
{
|
||||
title_item->setIcon(icon_combo_config_bordered);
|
||||
}
|
||||
else if (game->hasCustomConfig)
|
||||
{
|
||||
title_item->setIcon(icon_custom_config);
|
||||
}
|
||||
else if (game->hasCustomPadConfig)
|
||||
{
|
||||
title_item->setIcon(icon_controllers);
|
||||
}
|
||||
SetCustomConfigIcon(title_item, game);
|
||||
|
||||
// Serial
|
||||
custom_table_widget_item* serial_item = new custom_table_widget_item(game->info.serial);
|
||||
|
@ -90,6 +90,9 @@ protected:
|
||||
private:
|
||||
QPixmap PaintedPixmap(const QPixmap& icon, bool paint_config_icon = false, bool paint_pad_config_icon = false, const QColor& color = QColor()) const;
|
||||
QColor getGridCompatibilityColor(const QString& string) const;
|
||||
|
||||
/** Sets the custom config icon. Only call this for list title items. */
|
||||
void SetCustomConfigIcon(QTableWidgetItem* title_item, const game_info& game);
|
||||
void ShowCustomConfigIcon(const game_info& game);
|
||||
void PopulateGameList();
|
||||
void PopulateGameGrid(int maxCols, const QSize& image_size, const QColor& image_color);
|
||||
|
Loading…
x
Reference in New Issue
Block a user