From b624fdaae66280ad2b8082ce0b1a7bd0dd46c030 Mon Sep 17 00:00:00 2001 From: Bertrand Songis Date: Fri, 6 Dec 2019 13:59:45 +0100 Subject: [PATCH] Fixes --- radio/src/thirdparty/libopenui/src/window.h | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/radio/src/thirdparty/libopenui/src/window.h b/radio/src/thirdparty/libopenui/src/window.h index be6801acf..c8f18338c 100644 --- a/radio/src/thirdparty/libopenui/src/window.h +++ b/radio/src/thirdparty/libopenui/src/window.h @@ -236,12 +236,22 @@ class Window { pageHeight = h; } + uint8_t getPageCount() + { + if (pageWidth) + return innerWidth / pageWidth; + else if (pageHeight) + return innerHeight / pageHeight; + else + return 1; + } + uint8_t getPageIndex() { if (pageWidth) return (getScrollPositionX() + (pageWidth / 2)) / pageWidth; else if (pageHeight) - return (getScrollPositionX() + (pageHeight / 2)) / pageHeight; + return (getScrollPositionY() + (pageHeight / 2)) / pageHeight; else return 0; }