Screen area excluding the button hints
| 72 | |
| 73 | // Screen area excluding the button hints |
| 74 | Rect UITheme::getScreenSafeArea(const GfxRenderer& renderer, bool hasFrontButtonHints, bool hasSideButtonHints) { |
| 75 | auto orientation = renderer.getOrientation(); |
| 76 | const int screenWidth = renderer.getScreenWidth(); |
| 77 | const int screenHeight = renderer.getScreenHeight(); |
| 78 | Rect safeArea = Rect{0, 0, screenWidth, screenHeight}; |
| 79 | switch (orientation) { |
| 80 | case GfxRenderer::Orientation::Portrait: |
| 81 | if (hasFrontButtonHints) { |
| 82 | safeArea.height -= currentMetrics->buttonHintsHeight; |
| 83 | } |
| 84 | break; |
| 85 | case GfxRenderer::Orientation::LandscapeClockwise: |
| 86 | if (hasFrontButtonHints) { |
| 87 | safeArea.x += currentMetrics->buttonHintsHeight; |
| 88 | safeArea.width -= currentMetrics->buttonHintsHeight; |
| 89 | } |
| 90 | break; |
| 91 | case GfxRenderer::Orientation::PortraitInverted: |
| 92 | if (hasFrontButtonHints) { |
| 93 | safeArea.y += currentMetrics->buttonHintsHeight; |
| 94 | safeArea.height -= currentMetrics->buttonHintsHeight; |
| 95 | } |
| 96 | break; |
| 97 | case GfxRenderer::Orientation::LandscapeCounterClockwise: |
| 98 | if (hasFrontButtonHints) { |
| 99 | safeArea.width -= currentMetrics->buttonHintsHeight; |
| 100 | } |
| 101 | break; |
| 102 | } |
| 103 | return safeArea; |
| 104 | } |
| 105 | |
| 106 | std::string UITheme::getCoverThumbPath(std::string coverBmpPath, int coverHeight) { |
| 107 | size_t pos = coverBmpPath.find("[HEIGHT]", 0); |