feat(theme): add roundedraff theme and fix sleep cover crop grid artifacts (#918)
## Summary - Add new `roundedraff` theme. - Fix sleep screen artifact where book cover showed grid lines in `Cover` mode with `Crop`. ## Additional Context ## Key changes - Added `src/components/themes/roundedraff/` theme implementation. - Updated sleep cover rendering logic in: - `src/activities/boot_sleep/SleepActivity.cpp` - `src/activities/boot_sleep/SleepActivity.h` - Improved cover generation/regeneration paths in: - `lib/Epub/Epub.cpp` - `lib/Epub/Epub.h` - `lib/Txt/Txt.cpp` - `lib/Txt/Txt.h` ## Verification - Sleep screen set to Book cover - Sleep screen cover mode set to Crop - Confirmed grid artifacts no longer appear on cover sleep screen. ### 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? _**< YES >**_ --------- Co-authored-by: CaptainFrito <yzq6x5zypy@privaterelay.appleid.com> Co-authored-by: Zach Nelson <zach@zdnelson.com> Co-authored-by: Uri Tauber <142022451+Uri-Tauber@users.noreply.github.com>
This commit is contained in:
co-authored by
CaptainFrito
Zach Nelson
Uri Tauber
parent
33386953d9
commit
b8a51522ca
@@ -0,0 +1,64 @@
|
||||
#pragma once
|
||||
|
||||
#include "components/themes/BaseTheme.h"
|
||||
|
||||
class GfxRenderer;
|
||||
|
||||
namespace RoundedRaffMetrics {
|
||||
constexpr ThemeMetrics values = {.batteryWidth = 15,
|
||||
.batteryHeight = 12,
|
||||
.topPadding = 0,
|
||||
.batteryBarHeight = 20,
|
||||
.headerHeight = 45,
|
||||
.verticalSpacing = 10,
|
||||
.contentSidePadding = 20,
|
||||
.listRowHeight = 42,
|
||||
.listWithSubtitleRowHeight = 69,
|
||||
.menuRowHeight = 42,
|
||||
.menuSpacing = 6,
|
||||
.tabSpacing = 10,
|
||||
.tabBarHeight = 50,
|
||||
.scrollBarWidth = 4,
|
||||
.scrollBarRightOffset = 5,
|
||||
.homeTopPadding = 55,
|
||||
// Smaller cover tile so the home menu sits higher (fits 5 items without overlap).
|
||||
.homeCoverHeight = 300,
|
||||
.homeCoverTileHeight = 350,
|
||||
.homeRecentBooksCount = 1,
|
||||
.homeContinueReadingInMenu = true,
|
||||
.homeMenuTopOffset = 20,
|
||||
.buttonHintsHeight = 40,
|
||||
.sideButtonHintsWidth = 30,
|
||||
.progressBarHeight = 16,
|
||||
.progressBarMarginTop = 1,
|
||||
.statusBarHorizontalMargin = 5,
|
||||
.statusBarVerticalMargin = 19,
|
||||
.keyboardKeyWidth = 22,
|
||||
.keyboardKeyHeight = 30,
|
||||
.keyboardKeySpacing = 10,
|
||||
.keyboardBottomAligned = false,
|
||||
.keyboardCenteredText = false};
|
||||
}
|
||||
|
||||
class RoundedRaffTheme : public BaseTheme {
|
||||
public:
|
||||
void drawHeader(const GfxRenderer& renderer, Rect rect, const char* title,
|
||||
const char* subtitle = nullptr) const override;
|
||||
void drawTabBar(const GfxRenderer& renderer, Rect rect, const std::vector<TabInfo>& tabs,
|
||||
bool selected) const override;
|
||||
void drawRecentBookCover(GfxRenderer& renderer, Rect rect, const std::vector<RecentBook>& recentBooks,
|
||||
int selectorIndex, bool& coverRendered, bool& coverBufferStored, bool& bufferRestored,
|
||||
std::function<bool()> storeCoverBuffer) const override;
|
||||
void drawButtonMenu(GfxRenderer& renderer, Rect rect, int buttonCount, int selectedIndex,
|
||||
const std::function<std::string(int index)>& buttonLabel,
|
||||
const std::function<UIIcon(int index)>& rowIcon) const override;
|
||||
void drawList(const GfxRenderer& renderer, Rect rect, int itemCount, int selectedIndex,
|
||||
const std::function<std::string(int index)>& rowTitle,
|
||||
const std::function<std::string(int index)>& rowSubtitle = nullptr,
|
||||
const std::function<UIIcon(int index)>& rowIcon = nullptr,
|
||||
const std::function<std::string(int index)>& rowValue = nullptr,
|
||||
bool highlightValue = false) const override;
|
||||
void drawButtonHints(GfxRenderer& renderer, const char* btn1, const char* btn2, const char* btn3,
|
||||
const char* btn4) const override;
|
||||
bool homeMenuShowsContinueReading() const { return true; }
|
||||
};
|
||||
Reference in New Issue
Block a user