From 3d92bac3ec8e4688324061c03b570638926eea8f Mon Sep 17 00:00:00 2001 From: Arthur Tazhitdinov Date: Tue, 3 Feb 2026 18:32:08 +0300 Subject: [PATCH] clang format fix --- src/activities/reader/EpubReaderActivity.cpp | 4 ++-- .../reader/EpubReaderChapterSelectionActivity.cpp | 11 ++++++----- src/activities/reader/EpubReaderMenuActivity.cpp | 4 ++-- src/activities/reader/EpubReaderMenuActivity.h | 3 +-- .../reader/XtcReaderChapterSelectionActivity.cpp | 13 ++++++------- 5 files changed, 17 insertions(+), 18 deletions(-) diff --git a/src/activities/reader/EpubReaderActivity.cpp b/src/activities/reader/EpubReaderActivity.cpp index 6c064aa6..a510f8f3 100644 --- a/src/activities/reader/EpubReaderActivity.cpp +++ b/src/activities/reader/EpubReaderActivity.cpp @@ -136,8 +136,8 @@ void EpubReaderActivity::loop() { xSemaphoreTake(renderingMutex, portMAX_DELAY); exitActivity(); enterNewActivity(new EpubReaderMenuActivity( - this->renderer, this->mappedInput, epub->getTitle(), SETTINGS.orientation, - [this](const uint8_t orientation) { onReaderMenuBack(orientation); }, + this->renderer, this->mappedInput, epub->getTitle(), SETTINGS.orientation, + [this](const uint8_t orientation) { onReaderMenuBack(orientation); }, [this](EpubReaderMenuActivity::MenuAction action) { onReaderMenuConfirm(action); })); xSemaphoreGive(renderingMutex); } diff --git a/src/activities/reader/EpubReaderChapterSelectionActivity.cpp b/src/activities/reader/EpubReaderChapterSelectionActivity.cpp index c47db235..932a4812 100644 --- a/src/activities/reader/EpubReaderChapterSelectionActivity.cpp +++ b/src/activities/reader/EpubReaderChapterSelectionActivity.cpp @@ -1,8 +1,9 @@ #include "EpubReaderChapterSelectionActivity.h" -#include #include +#include + #include "KOReaderCredentialStore.h" #include "KOReaderSyncActivity.h" #include "MappedInputManager.h" @@ -193,8 +194,8 @@ void EpubReaderChapterSelectionActivity::renderScreen() { const int totalItems = getTotalItems(); // Manual centering to honor content gutters. - const int titleX = contentX + - (contentWidth - renderer.getTextWidth(UI_12_FONT_ID, "Go to Chapter", EpdFontFamily::BOLD)) / 2; + const int titleX = + contentX + (contentWidth - renderer.getTextWidth(UI_12_FONT_ID, "Go to Chapter", EpdFontFamily::BOLD)) / 2; renderer.drawText(UI_12_FONT_ID, titleX, 15 + contentY, "Go to Chapter", true, EpdFontFamily::BOLD); const auto pageStartIndex = selectorIndex / pageItems * pageItems; @@ -214,8 +215,8 @@ void EpubReaderChapterSelectionActivity::renderScreen() { const int tocIndex = tocIndexFromItemIndex(itemIndex); auto item = epub->getTocItem(tocIndex); - // Indent per TOC level while keeping content within the gutter-safe region. - const int indentSize = contentX + 20 + (item.level - 1) * 15; + // Indent per TOC level while keeping content within the gutter-safe region. + const int indentSize = contentX + 20 + (item.level - 1) * 15; const std::string chapterName = renderer.truncatedText(UI_10_FONT_ID, item.title.c_str(), contentWidth - 40 - indentSize); diff --git a/src/activities/reader/EpubReaderMenuActivity.cpp b/src/activities/reader/EpubReaderMenuActivity.cpp index 8d80bbc0..25e3397a 100644 --- a/src/activities/reader/EpubReaderMenuActivity.cpp +++ b/src/activities/reader/EpubReaderMenuActivity.cpp @@ -101,8 +101,8 @@ void EpubReaderMenuActivity::renderScreen() { const std::string truncTitle = renderer.truncatedText(UI_12_FONT_ID, title.c_str(), contentWidth - 40, EpdFontFamily::BOLD); // Manual centering so we can respect the content gutter. - const int titleX = contentX + - (contentWidth - renderer.getTextWidth(UI_12_FONT_ID, truncTitle.c_str(), EpdFontFamily::BOLD)) / 2; + const int titleX = + contentX + (contentWidth - renderer.getTextWidth(UI_12_FONT_ID, truncTitle.c_str(), EpdFontFamily::BOLD)) / 2; renderer.drawText(UI_12_FONT_ID, titleX, 15 + contentY, truncTitle.c_str(), true, EpdFontFamily::BOLD); // Menu Items diff --git a/src/activities/reader/EpubReaderMenuActivity.h b/src/activities/reader/EpubReaderMenuActivity.h index 9f25d75d..7e783ad0 100644 --- a/src/activities/reader/EpubReaderMenuActivity.h +++ b/src/activities/reader/EpubReaderMenuActivity.h @@ -16,8 +16,7 @@ class EpubReaderMenuActivity final : public ActivityWithSubactivity { enum class MenuAction { SELECT_CHAPTER, ROTATE_SCREEN, GO_HOME, DELETE_CACHE }; explicit EpubReaderMenuActivity(GfxRenderer& renderer, MappedInputManager& mappedInput, const std::string& title, - const uint8_t currentOrientation, - const std::function& onBack, + const uint8_t currentOrientation, const std::function& onBack, const std::function& onAction) : ActivityWithSubactivity("EpubReaderMenu", renderer, mappedInput), title(title), diff --git a/src/activities/reader/XtcReaderChapterSelectionActivity.cpp b/src/activities/reader/XtcReaderChapterSelectionActivity.cpp index a67e0acc..90d81247 100644 --- a/src/activities/reader/XtcReaderChapterSelectionActivity.cpp +++ b/src/activities/reader/XtcReaderChapterSelectionActivity.cpp @@ -1,8 +1,9 @@ #include "XtcReaderChapterSelectionActivity.h" -#include #include +#include + #include "MappedInputManager.h" #include "fontIds.h" @@ -146,15 +147,14 @@ void XtcReaderChapterSelectionActivity::renderScreen() { const int contentY = hintGutterHeight; const int pageItems = getPageItems(); // Manual centering to honor content gutters. - const int titleX = contentX + - (contentWidth - renderer.getTextWidth(UI_12_FONT_ID, "Select Chapter", EpdFontFamily::BOLD)) / 2; + const int titleX = + contentX + (contentWidth - renderer.getTextWidth(UI_12_FONT_ID, "Select Chapter", EpdFontFamily::BOLD)) / 2; renderer.drawText(UI_12_FONT_ID, titleX, 15 + contentY, "Select Chapter", true, EpdFontFamily::BOLD); const auto& chapters = xtc->getChapters(); if (chapters.empty()) { // Center the empty state within the gutter-safe content region. - const int emptyX = - contentX + (contentWidth - renderer.getTextWidth(UI_10_FONT_ID, "No chapters")) / 2; + const int emptyX = contentX + (contentWidth - renderer.getTextWidth(UI_10_FONT_ID, "No chapters")) / 2; renderer.drawText(UI_10_FONT_ID, emptyX, 120 + contentY, "No chapters"); renderer.displayBuffer(); return; @@ -166,8 +166,7 @@ void XtcReaderChapterSelectionActivity::renderScreen() { for (int i = pageStartIndex; i < static_cast(chapters.size()) && i < pageStartIndex + pageItems; i++) { const auto& chapter = chapters[i]; const char* title = chapter.name.empty() ? "Unnamed" : chapter.name.c_str(); - renderer.drawText(UI_10_FONT_ID, contentX + 20, 60 + contentY + (i % pageItems) * 30, title, - i != selectorIndex); + renderer.drawText(UI_10_FONT_ID, contentX + 20, 60 + contentY + (i % pageItems) * 30, title, i != selectorIndex); } const auto labels = mappedInput.mapLabels("« Back", "Select", "Up", "Down");