| 384 | } |
| 385 | |
| 386 | void BaseTheme::drawSubHeader(const GfxRenderer& renderer, Rect rect, const char* label, const char* rightLabel) const { |
| 387 | constexpr int maxListValueWidth = 200; |
| 388 | |
| 389 | int currentX = rect.x + BaseMetrics::values.contentSidePadding; |
| 390 | int rightSpace = BaseMetrics::values.contentSidePadding; |
| 391 | if (rightLabel) { |
| 392 | auto truncatedRightLabel = |
| 393 | renderer.truncatedText(SMALL_FONT_ID, rightLabel, maxListValueWidth, EpdFontFamily::REGULAR); |
| 394 | int rightLabelWidth = renderer.getTextWidth(SMALL_FONT_ID, truncatedRightLabel.c_str()); |
| 395 | renderer.drawText(SMALL_FONT_ID, rect.x + rect.width - BaseMetrics::values.contentSidePadding - rightLabelWidth, |
| 396 | rect.y + 7, truncatedRightLabel.c_str()); |
| 397 | rightSpace += rightLabelWidth + 10; |
| 398 | } |
| 399 | |
| 400 | auto truncatedLabel = renderer.truncatedText( |
| 401 | UI_12_FONT_ID, label, rect.width - BaseMetrics::values.contentSidePadding - rightSpace, EpdFontFamily::REGULAR); |
| 402 | renderer.drawText(UI_12_FONT_ID, currentX, rect.y, truncatedLabel.c_str(), true, EpdFontFamily::REGULAR); |
| 403 | } |
| 404 | |
| 405 | void BaseTheme::drawTabBar(const GfxRenderer& renderer, const Rect rect, const std::vector<TabInfo>& tabs, |
| 406 | bool selected) const { |