feat: Current page as QR (#1099)

## Summary

* **What is the goal of this PR?** Implements QR text of the current
page
* **What changes are included?**

## Additional Context

I saw this feature request at #982 
It made sense to me so I implemented. But if the team thinks it is not
necessary please let me know and we can close the PR.

| Page | Menu | QR |
|------|-------|----|
|
![IMG_6601.bmp](https://github.com/user-attachments/files/25473201/IMG_6601.bmp)
|
![IMG_6599.bmp](https://github.com/user-attachments/files/25473202/IMG_6599.bmp)
|
![IMG_6600.bmp](https://github.com/user-attachments/files/25473205/IMG_6600.bmp)
|


---

### AI Usage


Did you use AI tools to help write this code? _** YES

---------

Co-authored-by: Eliz Kilic <elizk@google.com>
This commit is contained in:
Eliz
2026-02-25 09:12:31 +00:00
committed by GitHub
parent 31396da064
commit 128eb614a6
10 changed files with 199 additions and 34 deletions

View File

@@ -32,6 +32,7 @@ class PageLine final : public PageElement {
public:
PageLine(std::shared_ptr<TextBlock> block, const int16_t xPos, const int16_t yPos)
: PageElement(xPos, yPos), block(std::move(block)) {}
const std::shared_ptr<TextBlock>& getBlock() const { return block; }
void render(GfxRenderer& renderer, int fontId, int xOffset, int yOffset) override;
bool serialize(FsFile& file) override;
PageElementTag getTag() const override { return TAG_PageLine; }

View File

@@ -27,6 +27,7 @@ class TextBlock final : public Block {
~TextBlock() override = default;
void setBlockStyle(const BlockStyle& blockStyle) { this->blockStyle = blockStyle; }
const BlockStyle& getBlockStyle() const { return blockStyle; }
const std::vector<std::string>& getWords() const { return words; }
bool isEmpty() override { return words.empty(); }
// given a renderer works out where to break the words into lines
void render(const GfxRenderer& renderer, int fontId, int x, int y) const;

View File

@@ -285,6 +285,7 @@ STR_GO_TO_PERCENT: "Go to %"
STR_GO_HOME_BUTTON: "Go Home"
STR_SYNC_PROGRESS: "Sync Progress"
STR_DELETE_CACHE: "Delete Book Cache"
STR_DISPLAY_QR: "Show page as QR"
STR_CHAPTER_PREFIX: "Chapter: "
STR_PAGES_SEPARATOR: " pages | "
STR_BOOK_PREFIX: "Book: "