A fork of https://github.com/crosspoint-reader/crosspoint-reader
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(ui): Add Back label in KOReader Sync screen (#770)

## Summary

- Remove duplicate Cancel option
- Add Back label

<img width="435" height="613" alt="image"
src="https://github.com/user-attachments/assets/a3af4133-46fa-46e6-8360-a15dd7c4fe2a"
/>


## Result

<img width="575" height="431" alt="image"
src="https://github.com/user-attachments/assets/6ccdac89-43df-45bf-bcfa-3a7cc4bd88e4"
/>


---

### AI Usage

Did you use AI tools to help write this code? _**< PARTIALLY >**_

Closes #754

authored by

Yaroslav and committed by
GitHub
f34d7d2a 71769490

+7 -16
+5 -14
src/activities/reader/KOReaderSyncActivity.cpp
··· 317 317 localProgress.percentage * 100); 318 318 renderer.drawText(UI_10_FONT_ID, 20, 320, localPageStr); 319 319 320 - // Options 321 320 const int optionY = 350; 322 321 const int optionHeight = 30; 323 322 ··· 333 332 } 334 333 renderer.drawText(UI_10_FONT_ID, 20, optionY + optionHeight, "Upload local progress", selectedOption != 1); 335 334 336 - // Cancel option 337 - if (selectedOption == 2) { 338 - renderer.fillRect(0, optionY + optionHeight * 2 - 2, pageWidth - 1, optionHeight); 339 - } 340 - renderer.drawText(UI_10_FONT_ID, 20, optionY + optionHeight * 2, "Cancel", selectedOption != 2); 341 - 342 - const auto labels = mappedInput.mapLabels("", "Select", "", ""); 335 + // Bottom button hints: show Back and Select 336 + const auto labels = mappedInput.mapLabels("Back", "Select", "", ""); 343 337 GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4); 344 338 renderer.displayBuffer(); 345 339 return; ··· 349 343 renderer.drawCenteredText(UI_10_FONT_ID, 280, "No remote progress found", true, EpdFontFamily::BOLD); 350 344 renderer.drawCenteredText(UI_10_FONT_ID, 320, "Upload current position?"); 351 345 352 - const auto labels = mappedInput.mapLabels("Cancel", "Upload", "", ""); 346 + const auto labels = mappedInput.mapLabels("Back", "Upload", "", ""); 353 347 GUI.drawButtonHints(renderer, labels.btn1, labels.btn2, labels.btn3, labels.btn4); 354 348 renderer.displayBuffer(); 355 349 return; ··· 392 386 // Navigate options 393 387 if (mappedInput.wasPressed(MappedInputManager::Button::Up) || 394 388 mappedInput.wasPressed(MappedInputManager::Button::Left)) { 395 - selectedOption = (selectedOption + 2) % 3; // Wrap around 389 + selectedOption = (selectedOption + 1) % 2; // Wrap around among 2 options 396 390 updateRequired = true; 397 391 } else if (mappedInput.wasPressed(MappedInputManager::Button::Down) || 398 392 mappedInput.wasPressed(MappedInputManager::Button::Right)) { 399 - selectedOption = (selectedOption + 1) % 3; 393 + selectedOption = (selectedOption + 1) % 2; // Wrap around among 2 options 400 394 updateRequired = true; 401 395 } 402 396 ··· 407 401 } else if (selectedOption == 1) { 408 402 // Upload local progress 409 403 performUpload(); 410 - } else { 411 - // Cancel 412 - onCancel(); 413 404 } 414 405 } 415 406
+2 -2
src/activities/reader/KOReaderSyncActivity.h
··· 18 18 * 1. Connect to WiFi (if not connected) 19 19 * 2. Calculate document hash 20 20 * 3. Fetch remote progress 21 - * 4. Show comparison and options (Apply/Upload/Cancel) 21 + * 4. Show comparison and options (Apply/Upload) 22 22 * 5. Apply or upload progress 23 23 */ 24 24 class KOReaderSyncActivity final : public ActivityWithSubactivity { ··· 82 82 // Local progress as KOReader format (for display) 83 83 KOReaderPosition localProgress; 84 84 85 - // Selection in result screen (0=Apply, 1=Upload, 2=Cancel) 85 + // Selection in result screen (0=Apply, 1=Upload) 86 86 int selectedOption = 0; 87 87 88 88 OnCancelCallback onCancel;