From b487c09d340729a0d0a82a9fb5bdd06ae11146f9 Mon Sep 17 00:00:00 2001 From: Megamouse Date: Fri, 21 Aug 2020 08:25:53 +0200 Subject: [PATCH] Revert "Qt: speed up list refresh" This reverts commit 715f4f0669e7faeaa846b2b3e0b4ea516ec37ccf. --- rpcs3/rpcs3qt/game_list_frame.cpp | 8 ++++---- rpcs3/rpcs3qt/save_manager_dialog.cpp | 9 +-------- rpcs3/rpcs3qt/trophy_manager_dialog.cpp | 16 ++++++---------- 3 files changed, 11 insertions(+), 22 deletions(-) diff --git a/rpcs3/rpcs3qt/game_list_frame.cpp b/rpcs3/rpcs3qt/game_list_frame.cpp index 6d3c3bebf7..b9a078669a 100644 --- a/rpcs3/rpcs3qt/game_list_frame.cpp +++ b/rpcs3/rpcs3qt/game_list_frame.cpp @@ -94,7 +94,6 @@ game_list_frame::game_list_frame(std::shared_ptr gui_settings, std m_game_list->setAlternatingRowColors(true); m_game_list->installEventFilter(this); m_game_list->setColumnCount(gui::column_count); - m_game_list->horizontalHeader()->setSectionResizeMode(gui::column_icon, QHeaderView::Fixed); m_game_compat = new game_compatibility(m_gui_settings, this); @@ -364,9 +363,7 @@ void game_list_frame::SortGameList() // Fixate vertical header and row height m_game_list->verticalHeader()->setMinimumSectionSize(m_icon_size.height()); m_game_list->verticalHeader()->setMaximumSectionSize(m_icon_size.height()); - - // Removed for better performance. I can't see any visual difference with and without this code - // m_game_list->resizeRowsToContents(); + m_game_list->resizeRowsToContents(); // Resize columns if the game list was empty before if (!old_row_count && !old_game_count) @@ -378,6 +375,9 @@ void game_list_frame::SortGameList() m_game_list->resizeColumnToContents(gui::column_icon); } + // Fixate icon column + m_game_list->horizontalHeader()->setSectionResizeMode(gui::column_icon, QHeaderView::Fixed); + // Shorten the last section to remove horizontal scrollbar if possible m_game_list->resizeColumnToContents(gui::column_count - 1); } diff --git a/rpcs3/rpcs3qt/save_manager_dialog.cpp b/rpcs3/rpcs3qt/save_manager_dialog.cpp index 33f6caaa6e..b8d29d2553 100644 --- a/rpcs3/rpcs3qt/save_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/save_manager_dialog.cpp @@ -372,14 +372,7 @@ void save_manager_dialog::UpdateIcons() icon_item->setData(Qt::DecorationRole, scaled[i]); } - // Fixate vertical header and row height - m_list->verticalHeader()->setMinimumSectionSize(m_icon_size.height()); - m_list->verticalHeader()->setMaximumSectionSize(m_icon_size.height()); - - // Removed for better performance. I can't see any visual difference with and without this code - // m_list->resizeRowsToContents(); - - // Resize icon column + m_list->resizeRowsToContents(); m_list->resizeColumnToContents(0); } diff --git a/rpcs3/rpcs3qt/trophy_manager_dialog.cpp b/rpcs3/rpcs3qt/trophy_manager_dialog.cpp index 20ced2012a..d5b26bd535 100644 --- a/rpcs3/rpcs3qt/trophy_manager_dialog.cpp +++ b/rpcs3/rpcs3qt/trophy_manager_dialog.cpp @@ -89,7 +89,6 @@ trophy_manager_dialog::trophy_manager_dialog(std::shared_ptr gui_s m_game_table->setHorizontalHeaderLabels(QStringList{ tr("Icon"), tr("Game"), tr("Progress") }); m_game_table->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); m_game_table->horizontalHeader()->setStretchLastSection(true); - m_game_table->horizontalHeader()->setSectionResizeMode(GameColumns::GameIcon, QHeaderView::Fixed); m_game_table->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); m_game_table->verticalHeader()->setVisible(false); m_game_table->setAlternatingRowColors(true); @@ -111,7 +110,6 @@ trophy_manager_dialog::trophy_manager_dialog(std::shared_ptr gui_s m_trophy_table->setHorizontalHeaderLabels(QStringList{ tr("Icon"), tr("Name"), tr("Description"), tr("Type"), tr("Status"), tr("ID"), tr("Platinum Relevant") }); m_trophy_table->horizontalHeader()->setDefaultAlignment(Qt::AlignLeft); m_trophy_table->horizontalHeader()->setStretchLastSection(true); - m_trophy_table->horizontalHeader()->setSectionResizeMode(TrophyColumns::Icon, QHeaderView::Fixed); m_trophy_table->verticalHeader()->setVisible(false); m_trophy_table->verticalHeader()->setSectionResizeMode(QHeaderView::Fixed); m_trophy_table->setContextMenuPolicy(Qt::CustomContextMenu); @@ -888,12 +886,11 @@ void trophy_manager_dialog::ReadjustGameTable() // Fixate vertical header and row height m_game_table->verticalHeader()->setMinimumSectionSize(m_game_icon_size.height()); m_game_table->verticalHeader()->setMaximumSectionSize(m_game_icon_size.height()); + m_game_table->resizeRowsToContents(); - // Removed for better performance. I can't see any visual difference with and without this code - // m_game_table->resizeRowsToContents(); - - // Resize icon column + // Resize and fixate icon column m_game_table->resizeColumnToContents(GameColumns::GameIcon); + m_game_table->horizontalHeader()->setSectionResizeMode(GameColumns::GameIcon, QHeaderView::Fixed); // Shorten the last section to remove horizontal scrollbar if possible m_game_table->resizeColumnToContents(GameColumns::GameColumnsCount - 1); @@ -904,12 +901,11 @@ void trophy_manager_dialog::ReadjustTrophyTable() // Fixate vertical header and row height m_trophy_table->verticalHeader()->setMinimumSectionSize(m_icon_height); m_trophy_table->verticalHeader()->setMaximumSectionSize(m_icon_height); + m_trophy_table->resizeRowsToContents(); - // Removed for better performance. I can't see any visual difference with and without this code - // m_trophy_table->resizeRowsToContents(); - - // Resize icon column + // Resize and fixate icon column m_trophy_table->resizeColumnToContents(TrophyColumns::Icon); + m_trophy_table->horizontalHeader()->setSectionResizeMode(TrophyColumns::Icon, QHeaderView::Fixed); // Shorten the last section to remove horizontal scrollbar if possible m_trophy_table->resizeColumnToContents(TrophyColumns::Count - 1);