Qt: Fix columns being hidden after editing cheats
This commit is contained in:
parent
3a13806f73
commit
880c76da24
|
@ -436,6 +436,11 @@ void GameCheatSettingsWidget::disableAllCheats()
|
|||
void GameCheatSettingsWidget::resizeEvent(QResizeEvent* event)
|
||||
{
|
||||
QWidget::resizeEvent(event);
|
||||
resizeColumns();
|
||||
}
|
||||
|
||||
void GameCheatSettingsWidget::resizeColumns()
|
||||
{
|
||||
QtUtils::ResizeColumnsForTreeView(m_ui.cheatList, {-1, 150});
|
||||
}
|
||||
|
||||
|
@ -518,8 +523,9 @@ void GameCheatSettingsWidget::reloadList()
|
|||
// Hide root indicator when there's no groups, frees up some whitespace.
|
||||
m_ui.cheatList->setRootIsDecorated(!m_parent_map.empty());
|
||||
|
||||
// Expand all items.
|
||||
// Expand all items, and ensure the size is correct. Otherwise editing codes resizes it.
|
||||
expandAllItems();
|
||||
resizeColumns();
|
||||
}
|
||||
|
||||
void GameCheatSettingsWidget::expandAllItems()
|
||||
|
|
|
@ -71,6 +71,7 @@ private:
|
|||
QStandardItem* getTreeWidgetParent(const std::string_view parent);
|
||||
void populateTreeWidgetItem(QStandardItem* parent, const Cheats::CodeInfo& pi, bool enabled);
|
||||
void expandAllItems();
|
||||
void resizeColumns();
|
||||
|
||||
void setCheatEnabled(std::string name, bool enabled, bool save_and_reload_settings);
|
||||
void setStateForAll(bool enabled);
|
||||
|
|
Loading…
Reference in New Issue