Add icon rendering and list scroll gesture support
Implement orientation-aware icon rendering using freeink::Icon format that applies rotation transforms per-pixel. Add wasListScroll helper for touch-based list navigation with swipe gestures. Switch vertical centering from x-height to cap-height for better visual alignment with capital-led UI labels.
This commit is contained in:
@@ -206,6 +206,14 @@ void FileBrowserActivity::loop() {
|
||||
const int pathReserved = renderer.getLineHeight(SMALL_FONT_ID) + UITheme::getInstance().getMetrics().verticalSpacing;
|
||||
const int pageItems = UITheme::getNumberOfItemsPerPage(renderer, true, false, true, false, pathReserved);
|
||||
|
||||
// Vertical swipe page-scrolls the list (touch nav without the side buttons).
|
||||
int scrollIdx = static_cast<int>(selectorIndex);
|
||||
if (mappedInput.wasListScroll(scrollIdx, static_cast<int>(files.size()), pageItems)) {
|
||||
selectorIndex = scrollIdx;
|
||||
requestUpdate();
|
||||
return;
|
||||
}
|
||||
|
||||
// Touch-down moves the selector to the pressed entry (shows selected state); release
|
||||
// opens it below.
|
||||
int downId = -1;
|
||||
|
||||
@@ -44,6 +44,14 @@ void RecentBooksActivity::onExit() {
|
||||
void RecentBooksActivity::loop() {
|
||||
const int pageItems = UITheme::getInstance().getNumberOfItemsPerPage(renderer, true, false, true, true);
|
||||
|
||||
// Vertical swipe page-scrolls the list (touch nav without the side buttons).
|
||||
int scrollIdx = static_cast<int>(selectorIndex);
|
||||
if (mappedInput.wasListScroll(scrollIdx, static_cast<int>(recentBooks.size()), pageItems)) {
|
||||
selectorIndex = scrollIdx;
|
||||
requestUpdate();
|
||||
return;
|
||||
}
|
||||
|
||||
// After a long-press has fired, swallow input until Confirm is physically released
|
||||
// (so the release doesn't also open the book; re-arm only once the button is up).
|
||||
if (longPressFired) {
|
||||
|
||||
Reference in New Issue
Block a user