Trigger onToggle instead of onResourceSelected when pressing enter

Signed-off-by: TheKodeToad <TheKodeToad@proton.me>
This commit is contained in:
TheKodeToad 2025-03-19 10:42:38 +00:00
parent 7532172233
commit 0f3ac57fdd
No known key found for this signature in database
GPG key ID: 5E39D70B4C93C38E

View file

@ -132,13 +132,9 @@ auto ResourcePage::eventFilter(QObject* watched, QEvent* event) -> bool
m_searchTimer.start(350); m_searchTimer.start(350);
} }
} else if (watched == m_ui->packView) { } else if (watched == m_ui->packView) {
// stop the event from going to the confirm button
if (keyEvent->key() == Qt::Key_Return) { if (keyEvent->key() == Qt::Key_Return) {
onResourceSelected(); onToggle(m_ui->packView->currentIndex());
// To have the 'select mod' button outlined instead of the 'review and confirm' one
m_ui->resourceSelectionButton->setFocus(Qt::FocusReason::ShortcutFocusReason);
m_ui->packView->setFocus(Qt::FocusReason::NoFocusReason);
keyEvent->accept(); keyEvent->accept();
return true; return true;
} }