mirror of
https://github.com/RPCS3/rpcs3.git
synced 2025-04-20 11:36:13 +00:00
Qt: handler zero-width columns in gamelist
This commit is contained in:
parent
15d0bdb7cf
commit
14ddeb07a5
1 changed files with 12 additions and 5 deletions
|
@ -278,14 +278,15 @@ game_list_frame::game_list_frame(std::shared_ptr<gui_settings> guiSettings, std:
|
|||
{
|
||||
m_columnActs[col]->setCheckable(true);
|
||||
|
||||
connect(m_columnActs[col], &QAction::triggered, [this, col](bool val)
|
||||
connect(m_columnActs[col], &QAction::triggered, [this, col](bool checked)
|
||||
{
|
||||
if (!val) // be sure to have at least one column left so you can call the context menu at all time
|
||||
if (!checked) // be sure to have at least one column left so you can call the context menu at all time
|
||||
{
|
||||
int c = 0;
|
||||
for (int i = 0; i < m_columnActs.count(); ++i)
|
||||
{
|
||||
if (xgui_settings->GetGamelistColVisibility(i)) { if (++c > 1) { break; } }
|
||||
if (xgui_settings->GetGamelistColVisibility(i) && ++c > 1)
|
||||
break;
|
||||
}
|
||||
if (c < 2)
|
||||
{
|
||||
|
@ -293,8 +294,14 @@ game_list_frame::game_list_frame(std::shared_ptr<gui_settings> guiSettings, std:
|
|||
return;
|
||||
}
|
||||
}
|
||||
m_gameList->setColumnHidden(col, !val); // Negate because it's a set col hidden and we have menu say show.
|
||||
xgui_settings->SetGamelistColVisibility(col, val);
|
||||
m_gameList->setColumnHidden(col, !checked); // Negate because it's a set col hidden and we have menu say show.
|
||||
xgui_settings->SetGamelistColVisibility(col, checked);
|
||||
|
||||
if (checked) // handle hidden columns that have zero width after showing them (stuck between others)
|
||||
{
|
||||
if (m_gameList->columnWidth(col) <= m_gameList->horizontalHeader()->minimumSectionSize())
|
||||
m_gameList->setColumnWidth(col, m_gameList->horizontalHeader()->minimumSectionSize());
|
||||
}
|
||||
});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue