fix: type chooser [n] array modifier now works for primitive types

Array count defaults to 1 when clicking the [n] toggle.
This commit is contained in:
IChooseYou
2026-02-18 08:16:02 -07:00
parent bb466516ba
commit 57d55456a8
4 changed files with 131 additions and 9 deletions

View File

@@ -334,7 +334,12 @@ TypeSelectorPopup::TypeSelectorPopup(QWidget* parent)
this, [this](int id, bool checked) {
if (!checked) return;
m_arrayCountEdit->setVisible(id == 3);
if (id == 3) m_arrayCountEdit->setFocus();
if (id == 3) {
if (m_arrayCountEdit->text().trimmed().isEmpty())
m_arrayCountEdit->setText(QStringLiteral("1"));
m_arrayCountEdit->setFocus();
m_arrayCountEdit->selectAll();
}
updateModifierPreview();
applyFilter(m_filterEdit->text());
});