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
This commit is contained in:
Cyril Anisimov
2025-08-20 06:59:57 +02:00
committed by GitHub
parent 251f2aa5db
commit 30d0f84a4f

View File

@@ -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;