perf: UITheme::getMetrics const and const-ref usage (#1094)

## Summary

**What is the goal of this PR?**

Small cleanup to make getTheme and getMetrics methods on UITheme const.
They return const refs, so updated call sites to use `const auto&`.

Realistically this won't make much performance difference, but it better
conveys the nature of theme metrics being shared const state.

---

### AI Usage

While CrossPoint doesn't have restrictions on AI tools in contributing,
please be transparent about their usage as it
helps set the right context for reviewers.

Did you use AI tools to help write this code? _**NO**_
This commit is contained in:
Zach Nelson
2026-02-23 06:29:18 -06:00
committed by GitHub
parent a6aead660a
commit 410c70ab89
19 changed files with 25 additions and 25 deletions

View File

@@ -526,7 +526,7 @@ void EpubReaderActivity::render(Activity::RenderLock&& lock) {
orientedMarginRight += SETTINGS.screenMargin;
orientedMarginBottom += SETTINGS.screenMargin;
auto metrics = UITheme::getInstance().getMetrics();
const auto& metrics = UITheme::getInstance().getMetrics();
// Add status bar margin
if (SETTINGS.statusBar != CrossPointSettings::STATUS_BAR_MODE::NONE) {
@@ -713,7 +713,7 @@ void EpubReaderActivity::renderContents(std::unique_ptr<Page> page, const int or
void EpubReaderActivity::renderStatusBar(const int orientedMarginRight, const int orientedMarginBottom,
const int orientedMarginLeft) const {
auto metrics = UITheme::getInstance().getMetrics();
const auto& metrics = UITheme::getInstance().getMetrics();
// determine visible status bar elements
const bool showProgressPercentage = SETTINGS.statusBar == CrossPointSettings::STATUS_BAR_MODE::FULL;