Add icon generation script and list scroll helper

Introduce gen_icons.sh to regenerate UI icons from a manifest file using the FreeInk SDK's Lucide icon set. Add icons.manifest mapping UI icons to Lucide names. Refactor vertical swipe list scrolling into a reusable wasListScroll() helper method used by both reader chapter selection and settings activities. Add static assertion to ensure ThemeMetrics scaling stays in sync with struct changes.
This commit is contained in:
Justin Mitchell
2026-06-16 00:15:18 -04:00
parent 1c63847631
commit 4a17d21d80
7 changed files with 86 additions and 37 deletions
@@ -56,6 +56,12 @@ void XtcReaderChapterSelectionActivity::loop() {
const int pageItems = getPageItems();
const int totalItems = static_cast<int>(xtc->getChapters().size());
// Vertical swipe page-scrolls the list (touch nav without the side buttons).
if (mappedInput.wasListScroll(selectorIndex, totalItems, pageItems)) {
requestUpdate();
return;
}
if (mappedInput.wasReleased(MappedInputManager::Button::Confirm)) {
const auto& chapters = xtc->getChapters();
if (!chapters.empty() && selectorIndex >= 0 && selectorIndex < static_cast<int>(chapters.size())) {
+3 -7
View File
@@ -131,15 +131,11 @@ void SettingsActivity::loop() {
hasChangedCategory = true;
requestUpdate();
} else if (swipe == MappedInputManager::SwipeDir::Up || swipe == MappedInputManager::SwipeDir::Down) {
// Vertical swipe scrolls the settings list a page at a time (touch navigation
// without the side buttons). Swipe up moves down the list, and vice versa.
// Vertical swipe page-scrolls the list (touch nav without the side buttons).
// count is settingsCount + 1 because row 0 is the category tab bar.
const int page = std::max(
1, UITheme::getNumberOfItemsPerPage(renderer, true, true, BaseTheme::showButtonHints(), false));
if (swipe == MappedInputManager::SwipeDir::Up) {
selectedSettingIndex = std::min(selectedSettingIndex + page, settingsCount);
} else {
selectedSettingIndex = std::max(selectedSettingIndex - page, 0);
}
mappedInput.wasListScroll(selectedSettingIndex, settingsCount + 1, page);
requestUpdate();
}