From 626b9e1e763e8b9e6b7ab94c41b85c25f5eb1da7 Mon Sep 17 00:00:00 2001 From: Cyril Anisimov Date: Sat, 19 Oct 2024 22:20:35 +0200 Subject: [PATCH] fix reverse focus move on listView --- client/ui/controllers/listViewFocusController.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/client/ui/controllers/listViewFocusController.cpp b/client/ui/controllers/listViewFocusController.cpp index b899dfe6..f07c069c 100644 --- a/client/ui/controllers/listViewFocusController.cpp +++ b/client/ui/controllers/listViewFocusController.cpp @@ -109,6 +109,7 @@ void ListViewFocusController::viewAtCurrentIndex() { switch(m_currentSection) { case Section::Default: + [[fallthrough]]; case Section::Header: { QMetaObject::invokeMethod(m_listView, "positionViewAtBeginning"); break; @@ -146,12 +147,14 @@ void ListViewFocusController::nextDelegate() viewToBegin(); break; } + [[fallthrough]]; } case Section::Header: { if (size() > 0) { m_currentSection = Section::Delegate; break; } + [[fallthrough]]; } case Section::Delegate: if (m_delegateIndex < (size() - 1)) { @@ -162,6 +165,7 @@ void ListViewFocusController::nextDelegate() viewToEnd(); break; } + [[fallthrough]]; case Section::Footer: { m_isReturnNeeded = true; m_currentSection = Section::Default; @@ -182,12 +186,15 @@ void ListViewFocusController::previousDelegate() m_currentSection = Section::Footer; break; } + [[fallthrough]]; } case Section::Footer: { if (size() > 0) { m_currentSection = Section::Delegate; + m_delegateIndex = size() - 1; break; } + [[fallthrough]]; } case Section::Delegate: { if (m_delegateIndex > 0) { @@ -197,6 +204,7 @@ void ListViewFocusController::previousDelegate() m_currentSection = Section::Header; break; } + [[fallthrough]]; } case Section::Header: { m_isReturnNeeded = true;