From 30d0f84a4f90ab66554141bf858cabddd908c59d Mon Sep 17 00:00:00 2001 From: Cyril Anisimov Date: Wed, 20 Aug 2025 06:59:57 +0200 Subject: [PATCH] fix: fixed focus view and reverse focus change in headers (#1791) * fix: add view movement on changing the focus in backwards direction * fix: return value in isFirstFocusItemInHeader function --- client/ui/controllers/listViewFocusController.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/client/ui/controllers/listViewFocusController.cpp b/client/ui/controllers/listViewFocusController.cpp index 6e91b78a..d94ec66e 100644 --- a/client/ui/controllers/listViewFocusController.cpp +++ b/client/ui/controllers/listViewFocusController.cpp @@ -112,6 +112,7 @@ void ListViewFocusController::previousDelegate() case Section::Default: { if (hasFooter()) { m_currentSection = Section::Footer; + viewAtCurrentIndex(); break; } [[fallthrough]]; @@ -127,9 +128,11 @@ void ListViewFocusController::previousDelegate() case Section::Delegate: { if (m_delegateIndex > 0) { setDelegateIndex(m_delegateIndex - 1); + viewAtCurrentIndex(); break; } else if (hasHeader()) { m_currentSection = Section::Header; + viewAtCurrentIndex(); break; } [[fallthrough]]; @@ -137,6 +140,7 @@ void ListViewFocusController::previousDelegate() case Section::Header: { m_isReturnNeeded = true; m_currentSection = Section::Default; + viewAtCurrentIndex(); break; } default: { @@ -275,7 +279,7 @@ bool ListViewFocusController::isFirstFocusItemInListView() const return isFirstFocusItemInDelegate() && (m_delegateIndex == 0) && !hasHeader(); } case Section::Header: { - isFirstFocusItemInDelegate(); + return isFirstFocusItemInDelegate(); } case Section::Default: { return true;