mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-02-11 15:40:51 +00:00
Qt: fix squished icon column when opening rpcs3 after closing with an empty list
This commit is contained in:
parent
9b4302bc2f
commit
5f3f8eeec6
@ -922,15 +922,25 @@ void game_list_frame::OnRefreshFinished()
|
|||||||
|
|
||||||
if (!std::exchange(m_initial_refresh_done, true))
|
if (!std::exchange(m_initial_refresh_done, true))
|
||||||
{
|
{
|
||||||
|
// Resize to fit and get the ideal icon column width
|
||||||
|
ResizeColumnsToContents();
|
||||||
|
const int icon_column_width = m_game_list->columnWidth(gui::column_icon);
|
||||||
|
|
||||||
|
// Restore header layout from last session
|
||||||
const QByteArray state = m_gui_settings->GetValue(gui::gl_state).toByteArray();
|
const QByteArray state = m_gui_settings->GetValue(gui::gl_state).toByteArray();
|
||||||
if (!m_game_list->horizontalHeader()->restoreState(state) && m_game_list->rowCount())
|
if (!m_game_list->horizontalHeader()->restoreState(state) && m_game_list->rowCount())
|
||||||
{
|
{
|
||||||
// If no settings exist, resize to contents.
|
// Nothing to do
|
||||||
ResizeColumnsToContents();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Make sure no columns are squished
|
||||||
FixNarrowColumns();
|
FixNarrowColumns();
|
||||||
|
|
||||||
|
// Make sure that the icon column is large enough for the actual items.
|
||||||
|
// This is important if the list appeared as empty when closing the software before.
|
||||||
|
m_game_list->horizontalHeader()->resizeSection(gui::column_icon, icon_column_width);
|
||||||
|
|
||||||
|
// Save new header state
|
||||||
m_game_list->horizontalHeader()->restoreState(m_game_list->horizontalHeader()->saveState());
|
m_game_list->horizontalHeader()->restoreState(m_game_list->horizontalHeader()->saveState());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user