Refactor ui content rect

This commit is contained in:
jpirnay
2026-03-10 19:11:30 +01:00
parent 0a4a369d25
commit 2008060a81
30 changed files with 304 additions and 303 deletions
+3 -2
View File
@@ -14,7 +14,8 @@ void ConfirmationActivity::onEnter() {
inputArmed = false;
lineHeight = renderer.getLineHeight(fontId);
const int maxWidth = renderer.getScreenWidth() - (margin * 2);
const Rect contentRect = UITheme::getContentRect(renderer, true, false);
const int maxWidth = contentRect.width - (margin * 2);
if (!heading.empty()) {
safeHeading = renderer.truncatedText(fontId, heading.c_str(), maxWidth, EpdFontFamily::BOLD);
@@ -28,7 +29,7 @@ void ConfirmationActivity::onEnter() {
if (!safeBody.empty()) totalHeight += lineHeight;
if (!safeHeading.empty() && !safeBody.empty()) totalHeight += spacing;
startY = (renderer.getScreenHeight() - totalHeight) / 2;
startY = contentRect.y + (contentRect.height - totalHeight) / 2;
requestUpdate(true);
}