mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-04 14:47:37 +03:00
Compare commits
2 Commits
1da429174f
...
62f38b7a1d
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
62f38b7a1d | ||
|
|
66e69e750e |
@ -90,6 +90,11 @@ int ButtonNavigator::previousIndex(const int currentIndex, const int totalItems)
|
||||
int ButtonNavigator::nextPageIndex(const int currentIndex, const int totalItems, const int itemsPerPage) {
|
||||
if (totalItems <= 0 || itemsPerPage <= 0) return 0;
|
||||
|
||||
// When items fit on one page, use index navigation instead
|
||||
if (totalItems <= itemsPerPage) {
|
||||
return nextIndex(currentIndex, totalItems);
|
||||
}
|
||||
|
||||
const int lastPageIndex = (totalItems - 1) / itemsPerPage;
|
||||
const int currentPageIndex = currentIndex / itemsPerPage;
|
||||
|
||||
@ -103,6 +108,11 @@ int ButtonNavigator::nextPageIndex(const int currentIndex, const int totalItems,
|
||||
int ButtonNavigator::previousPageIndex(const int currentIndex, const int totalItems, const int itemsPerPage) {
|
||||
if (totalItems <= 0 || itemsPerPage <= 0) return 0;
|
||||
|
||||
// When items fit on one page, use index navigation instead
|
||||
if (totalItems <= itemsPerPage) {
|
||||
return previousIndex(currentIndex, totalItems);
|
||||
}
|
||||
|
||||
const int lastPageIndex = (totalItems - 1) / itemsPerPage;
|
||||
const int currentPageIndex = currentIndex / itemsPerPage;
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user