From 0c4c90bf2e6dd7df9751dd61ab755bd3e61f5c43 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Tue, 6 Dec 2016 11:29:11 +0100 Subject: [PATCH] cc_frm correct scroll direction if more than 2 pages (thx dbo) Signed-off-by: Thilo Graf picked from: github.com/TangoCash/neutrino-mp-cst-next commit: abce1c6be4bae17f343d3ff878670184708aa185 --- src/gui/components/cc_frm.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 3efb2da8b..a1ae03b04 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -636,9 +636,9 @@ void CComponentsForm::ScrollPage(int direction, bool do_paint) int target_page_id = (int)page_count - 1; int target_page = (int)cur_page; - if (direction == SCROLL_P_DOWN) + if (direction == SCROLL_P_UP) target_page = target_page+1 > target_page_id ? 0 : target_page+1; - else if (direction == SCROLL_P_UP) + else if (direction == SCROLL_P_DOWN) target_page = target_page-1 < 0 ? target_page_id : target_page-1; if (do_paint)