From 812e5beee62c958839af4ae2258a58fbbf18cb7f Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Thu, 11 Sep 2025 11:21:43 +0200 Subject: [PATCH] Allow pressing enter/return on "Add Account" in account switcher dialog Because "Add Account" is a "fake item" by being the footer, it should be the null fallback when accessing currentItem. --- src/app/qml/AccountSwitchDialog.qml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/app/qml/AccountSwitchDialog.qml b/src/app/qml/AccountSwitchDialog.qml index 855b156e3..e2507b7d9 100644 --- a/src/app/qml/AccountSwitchDialog.qml +++ b/src/app/qml/AccountSwitchDialog.qml @@ -95,8 +95,8 @@ Kirigami.Dialog { accountView.decrementCurrentIndex(); } } - Keys.onEnterPressed: (accountView.currentItem as Delegates.RoundedItemDelegate).clicked() - Keys.onReturnPressed: (accountView.currentItem as Delegates.RoundedItemDelegate).clicked() + Keys.onEnterPressed: (accountView.currentItem as Delegates.RoundedItemDelegate ?? accountView.footerItem).clicked() + Keys.onReturnPressed: (accountView.currentItem as Delegates.RoundedItemDelegate ?? accountView.footerItem).clicked() onVisibleChanged: { for (let i = 0; i < accountView.count; i++) {