Skip to content

Commit 44ef11c

Browse files
committed
#229 theme builder did not copy icons
1 parent 402a49f commit 44ef11c

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

src/graphics/GraphicsDeviceRenderer.cpp

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -494,6 +494,8 @@ namespace tcgfx {
494494
void GraphicsDeviceRenderer::enableCardLayout(const DrawableIcon& left, const DrawableIcon& right, MenuTouchScreenManager* touchScreenManager, bool monoDisplay) {
495495
if(cardLayoutPane == nullptr) {
496496
cardLayoutPane = new CardLayoutPane(&left, &right, touchScreenManager, monoDisplay);
497+
} else {
498+
serlogF(SER_TCMENU_INFO, "Card already init");
497499
}
498500
}
499501

src/graphics/TcThemeBuilder.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,10 +102,9 @@ ThemePropertiesBuilder &TcThemeBuilder::menuItemOverride(MenuItem &item) {
102102
}
103103

104104
TcThemeBuilder& TcThemeBuilder::enableCardLayoutWithXbmImages(Coord iconSize, const uint8_t *leftIcon, const uint8_t *rightIcon, bool isMono) {
105-
renderer.enableCardLayout(
106-
DrawableIcon(-1, iconSize, tcgfx::DrawableIcon::ICON_XBITMAP, leftIcon, nullptr),
107-
DrawableIcon(-1, iconSize, tcgfx::DrawableIcon::ICON_XBITMAP, rightIcon, nullptr),
108-
nullptr, isMono);
105+
auto left = new DrawableIcon(-1, iconSize, tcgfx::DrawableIcon::ICON_XBITMAP, leftIcon, nullptr);
106+
auto right = new DrawableIcon(-1, iconSize, tcgfx::DrawableIcon::ICON_XBITMAP, rightIcon, nullptr);
107+
renderer.enableCardLayout(*left, *right, nullptr, isMono);
109108
return *this;
110109
}
111110

@@ -137,3 +136,4 @@ TcThemeBuilder& TcThemeBuilder::manualDimensions(int x, int y) {
137136
renderer.setDisplayDimensions(x, y);
138137
return *this;
139138
}
139+

src/graphics/TcThemeBuilder.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ namespace tcgfx {
9393
* @param mag the magnification value
9494
* @return reference to itself for chaining
9595
*/
96-
ThemePropertiesBuilder& withNativeFont(void* data, uint8_t mag) {
96+
ThemePropertiesBuilder& withNativeFont(const void* data, uint8_t mag) {
9797
fontData = data;
9898
fontMag = mag;
9999
needsProps();
@@ -349,7 +349,7 @@ namespace tcgfx {
349349
* @param mag the native mag value
350350
* @return reference to itself for chaining
351351
*/
352-
TcThemeBuilder& withNativeFont(void* data, uint8_t mag) {
352+
TcThemeBuilder& withNativeFont(const void* data, uint8_t mag) {
353353
fontData = data;
354354
fontMag = mag;
355355
return *this;

0 commit comments

Comments
 (0)