mirror of
https://github.com/stenzek/duckstation.git
synced 2025-07-23 02:20:15 +00:00
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)
|
void GameCheatSettingsWidget::resizeEvent(QResizeEvent* event)
|
||||||
{
|
{
|
||||||
QWidget::resizeEvent(event);
|
QWidget::resizeEvent(event);
|
||||||
|
resizeColumns();
|
||||||
|
}
|
||||||
|
|
||||||
|
void GameCheatSettingsWidget::resizeColumns()
|
||||||
|
{
|
||||||
QtUtils::ResizeColumnsForTreeView(m_ui.cheatList, {-1, 150});
|
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.
|
// Hide root indicator when there's no groups, frees up some whitespace.
|
||||||
m_ui.cheatList->setRootIsDecorated(!m_parent_map.empty());
|
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();
|
expandAllItems();
|
||||||
|
resizeColumns();
|
||||||
}
|
}
|
||||||
|
|
||||||
void GameCheatSettingsWidget::expandAllItems()
|
void GameCheatSettingsWidget::expandAllItems()
|
||||||
|
@ -71,6 +71,7 @@ private:
|
|||||||
QStandardItem* getTreeWidgetParent(const std::string_view parent);
|
QStandardItem* getTreeWidgetParent(const std::string_view parent);
|
||||||
void populateTreeWidgetItem(QStandardItem* parent, const Cheats::CodeInfo& pi, bool enabled);
|
void populateTreeWidgetItem(QStandardItem* parent, const Cheats::CodeInfo& pi, bool enabled);
|
||||||
void expandAllItems();
|
void expandAllItems();
|
||||||
|
void resizeColumns();
|
||||||
|
|
||||||
void setCheatEnabled(std::string name, bool enabled, bool save_and_reload_settings);
|
void setCheatEnabled(std::string name, bool enabled, bool save_and_reload_settings);
|
||||||
void setStateForAll(bool enabled);
|
void setStateForAll(bool enabled);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user