From add02d34187964ce51f33d367c1466469cba25c9 Mon Sep 17 00:00:00 2001 From: DimitarCC Date: Sat, 22 Aug 2026 19:52:43 +0300 Subject: [PATCH 1/2] [elistbox] fix wrap-around logic for selection movement at boundaries --- lib/gui/elistbox.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp index 9d24d2e1f3..546fa4b540 100644 --- a/lib/gui/elistbox.cpp +++ b/lib/gui/elistbox.cpp @@ -481,9 +481,9 @@ void eListbox::moveSelection(long dir) break; case pageUp: case prevPage: { - if (m_enabled_wrap_around && oldsel < m_items_per_page) + if (m_enabled_wrap_around && oldsel == 0) { - // already on the first page, wrap around to the last selectable entry + // already at the first entry, wrap around to the last selectable entry m_content->cursorEnd(); m_content->cursorMove(-1); newsel = m_content->cursorGet(); @@ -534,9 +534,9 @@ void eListbox::moveSelection(long dir) } case pageDown: case nextPage: { - if (m_enabled_wrap_around && oldsel >= ((m_content->size() - 1) / m_items_per_page) * m_items_per_page) + if (m_enabled_wrap_around && oldsel == m_content->size() - 1) { - // already on the last page, wrap around to the first selectable entry + // already at the last entry, wrap around to the first selectable entry m_content->cursorHome(); newsel = m_content->cursorGet(); while (newsel != oldsel && !m_content->currentCursorSelectable()) From 9e8358ace044b184d442d7677bede34e35d1e368 Mon Sep 17 00:00:00 2001 From: DimitarCC Date: Sat, 22 Aug 2026 20:07:03 +0300 Subject: [PATCH 2/2] [elistbox] refine wrap-around logic to consider orientation for selection movement --- lib/gui/elistbox.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/gui/elistbox.cpp b/lib/gui/elistbox.cpp index 546fa4b540..48af389943 100644 --- a/lib/gui/elistbox.cpp +++ b/lib/gui/elistbox.cpp @@ -481,7 +481,7 @@ void eListbox::moveSelection(long dir) break; case pageUp: case prevPage: { - if (m_enabled_wrap_around && oldsel == 0) + if (m_orientation == orHorizontal && m_enabled_wrap_around && oldsel == 0) { // already at the first entry, wrap around to the last selectable entry m_content->cursorEnd(); @@ -534,7 +534,7 @@ void eListbox::moveSelection(long dir) } case pageDown: case nextPage: { - if (m_enabled_wrap_around && oldsel == m_content->size() - 1) + if (m_orientation == orHorizontal && m_enabled_wrap_around && oldsel == m_content->size() - 1) { // already at the last entry, wrap around to the first selectable entry m_content->cursorHome();