mirror of
https://github.com/daveallie/crosspoint-reader.git
synced 2026-02-08 08:37:38 +03:00
Improvements to indicators and button interaction
This commit is contained in:
parent
c2d0dce438
commit
5d81d7cac3
@ -99,19 +99,18 @@ void ScreenComponents::drawScrollIndicator(const GfxRenderer &renderer,
|
||||
contentTop + 60; // Offset to avoid overlapping side button hints
|
||||
const int indicatorBottom = contentTop + contentHeight - 30;
|
||||
|
||||
// Draw up arrow at top (triangle pointing up - wide at bottom, narrow at top)
|
||||
// Draw up arrow at top (^) - narrow point at top, wide base at bottom
|
||||
for (int i = 0; i < arrowSize; ++i) {
|
||||
const int lineWidth = 1 + (arrowSize - 1 - i) * 2;
|
||||
const int startX = centerX - (arrowSize - 1 - i);
|
||||
const int lineWidth = 1 + i * 2;
|
||||
const int startX = centerX - i;
|
||||
renderer.drawLine(startX, indicatorTop + i, startX + lineWidth - 1,
|
||||
indicatorTop + i);
|
||||
}
|
||||
|
||||
// Draw down arrow at bottom (triangle pointing down - narrow at top, wide at
|
||||
// bottom)
|
||||
// Draw down arrow at bottom (v) - wide base at top, narrow point at bottom
|
||||
for (int i = 0; i < arrowSize; ++i) {
|
||||
const int lineWidth = 1 + i * 2;
|
||||
const int startX = centerX - i;
|
||||
const int lineWidth = 1 + (arrowSize - 1 - i) * 2;
|
||||
const int startX = centerX - (arrowSize - 1 - i);
|
||||
renderer.drawLine(startX, indicatorBottom - arrowSize + 1 + i,
|
||||
startX + lineWidth - 1,
|
||||
indicatorBottom - arrowSize + 1 + i);
|
||||
|
||||
@ -269,8 +269,7 @@ void MyLibraryActivity::loop() {
|
||||
return;
|
||||
}
|
||||
|
||||
// Tab switching: Left/Right when selectorIndex == 0
|
||||
if (selectorIndex == 0) {
|
||||
// Tab switching: Left/Right always control tabs
|
||||
if (leftReleased && currentTab == Tab::Files) {
|
||||
currentTab = Tab::Recent;
|
||||
selectorIndex = 0;
|
||||
@ -283,11 +282,10 @@ void MyLibraryActivity::loop() {
|
||||
updateRequired = true;
|
||||
return;
|
||||
}
|
||||
}
|
||||
|
||||
// Navigation: Up/Down moves through items, Left/Right also work as prev/next
|
||||
const bool prevReleased = upReleased || leftReleased;
|
||||
const bool nextReleased = downReleased || rightReleased;
|
||||
// Navigation: Up/Down moves through items only
|
||||
const bool prevReleased = upReleased;
|
||||
const bool nextReleased = downReleased;
|
||||
|
||||
if (prevReleased && itemCount > 0) {
|
||||
if (skipPage) {
|
||||
|
||||
@ -23,7 +23,8 @@ class MyLibraryActivity final : public Activity {
|
||||
|
||||
// Recent tab state (from RecentBooksActivity)
|
||||
std::vector<std::string> bookTitles; // Display titles for each book
|
||||
std::vector<std::string> bookPaths; // Paths for each visible book (excludes missing)
|
||||
std::vector<std::string>
|
||||
bookPaths; // Paths for each visible book (excludes missing)
|
||||
|
||||
// Files tab state (from FileSelectionActivity)
|
||||
std::string basepath = "/";
|
||||
@ -51,14 +52,13 @@ class MyLibraryActivity final : public Activity {
|
||||
void renderFilesTab() const;
|
||||
|
||||
public:
|
||||
explicit MyLibraryActivity(GfxRenderer& renderer, MappedInputManager& mappedInput,
|
||||
explicit MyLibraryActivity(
|
||||
GfxRenderer &renderer, MappedInputManager &mappedInput,
|
||||
const std::function<void()> &onGoHome,
|
||||
const std::function<void(const std::string &path)> &onSelectBook,
|
||||
Tab initialTab = Tab::Recent)
|
||||
: Activity("MyLibrary", renderer, mappedInput),
|
||||
currentTab(initialTab),
|
||||
onGoHome(onGoHome),
|
||||
onSelectBook(onSelectBook) {}
|
||||
: Activity("MyLibrary", renderer, mappedInput), currentTab(initialTab),
|
||||
onGoHome(onGoHome), onSelectBook(onSelectBook) {}
|
||||
void onEnter() override;
|
||||
void onExit() override;
|
||||
void loop() override;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user