Voltaire // New PgDn/Up functions with single page.

- When candidates take only one page, PgDn/PgUp functions like arrow keys.
This commit is contained in:
ShikiSuen 2022-02-23 20:33:04 +08:00
parent 55bfcefaa8
commit 457996a118
2 changed files with 16 additions and 0 deletions

View File

@ -259,6 +259,10 @@ public class HorizontalCandidateController: CandidateController {
return false return false
} }
if pageCount == 1 {
return highlightNextCandidate()
}
if currentPage + 1 >= pageCount { if currentPage + 1 >= pageCount {
currentPage = 0 currentPage = 0
} else { } else {
@ -275,6 +279,10 @@ public class HorizontalCandidateController: CandidateController {
return false return false
} }
if pageCount == 1 {
return highlightPreviousCandidate()
}
if currentPage == 0 { if currentPage == 0 {
currentPage = pageCount - 1 currentPage = pageCount - 1
} else { } else {

View File

@ -265,6 +265,10 @@ public class VerticalCandidateController: CandidateController {
return false return false
} }
if pageCount == 1 {
return highlightNextCandidate()
}
if currentPage + 1 >= pageCount { if currentPage + 1 >= pageCount {
currentPage = 0 currentPage = 0
} else { } else {
@ -281,6 +285,10 @@ public class VerticalCandidateController: CandidateController {
return false return false
} }
if pageCount == 1 {
return highlightPreviousCandidate()
}
if currentPage == 0 { if currentPage == 0 {
currentPage = pageCount - 1 currentPage = pageCount - 1
} else { } else {