Fix contentRect for X3

This commit is contained in:
jpirnay
2026-04-14 20:49:52 +02:00
parent 2565042e1f
commit a57fc5b5fd
2 changed files with 27 additions and 5 deletions
+21
View File
@@ -2,6 +2,7 @@
#include <FsHelpers.h> #include <FsHelpers.h>
#include <GfxRenderer.h> #include <GfxRenderer.h>
#include <HalGPIO.h>
#include <I18n.h> #include <I18n.h>
#include <Logging.h> #include <Logging.h>
@@ -77,19 +78,39 @@ Rect UITheme::getContentRect(const GfxRenderer& renderer, bool hasBottomHints, b
switch (renderer.getOrientation()) { switch (renderer.getOrientation()) {
case GfxRenderer::Portrait: case GfxRenderer::Portrait:
bottom = bh; bottom = bh;
if (gpio.deviceIsX3() && hasSideHints) {
left = sw;
right = sw; right = sw;
} else {
right = sw;
}
break; break;
case GfxRenderer::PortraitInverted: case GfxRenderer::PortraitInverted:
top = bh; top = bh;
if (gpio.deviceIsX3() && hasSideHints) {
left = sw; left = sw;
right = sw;
} else {
left = sw;
}
break; break;
case GfxRenderer::LandscapeClockwise: case GfxRenderer::LandscapeClockwise:
left = bh; left = bh;
if (gpio.deviceIsX3() && hasSideHints) {
top = sw;
bottom = sw; bottom = sw;
} else {
bottom = sw;
}
break; break;
case GfxRenderer::LandscapeCounterClockwise: case GfxRenderer::LandscapeCounterClockwise:
right = bh; right = bh;
if (gpio.deviceIsX3() && hasSideHints) {
top = sw; top = sw;
bottom = sw;
} else {
top = sw;
}
break; break;
} }
+2 -1
View File
@@ -55,7 +55,8 @@ class UITheme {
static std::function<bool(int)> makeSelectablePredicate(int total, std::function<std::string(int)> titleGetter); static std::function<bool(int)> makeSelectablePredicate(int total, std::function<std::string(int)> titleGetter);
// Returns the drawable content Rect accounting for screen orientation and visible button hints. // Returns the drawable content Rect accounting for screen orientation and visible button hints.
// Bottom hints occupy the physical bottom edge; side hints occupy the physical right edge. // Bottom hints occupy the physical bottom edge.
// Side hints occupy the physical right edge on X4, and both physical sides on X3.
// The mapping to logical edges is orientation-dependent. // The mapping to logical edges is orientation-dependent.
static Rect getContentRect(const GfxRenderer& renderer, bool hasBottomHints, bool hasSideHints); static Rect getContentRect(const GfxRenderer& renderer, bool hasBottomHints, bool hasSideHints);
static std::string getCoverThumbPath(std::string coverBmpPath, int coverHeight); static std::string getCoverThumbPath(std::string coverBmpPath, int coverHeight);