Skip to content

Commit 243a8fc

Browse files
author
dave
committed
Update examples
1 parent 4a0c629 commit 243a8fc

20 files changed

Lines changed: 878 additions & 431 deletions

examples/esp/esp32s2Saola/ThemeMonoInverseBuilder.h renamed to examples/arduino32/mkrEthernetOled/ThemeMonoBorderedBuilder.h

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@
33

44
#include <graphics/TcThemeBuilder.h>
55

6-
color_t defaultItemPaletteMono[] = {1, 0, 1, 1};
7-
color_t defaultTitlePaletteMono[] = {0, 1, 0, 0};
6+
color_t defaultItemPaletteMono[] = {WHITE, BLACK, WHITE, WHITE};
87

9-
#define TITLE_PADDING 2
8+
#define TITLE_BORDER_THICKNESS 2
109
#define TITLE_SPACING 2
1110

1211
/**
@@ -17,10 +16,12 @@ color_t defaultTitlePaletteMono[] = {0, 1, 0, 0};
1716
* @param titleFont the font for titles
1817
* @param needEditingIcons if editing icons are needed
1918
*/
20-
void installMonoInverseTitleTheme(GraphicsDeviceRenderer& gr, const MenuFontDef& itemFont, const MenuFontDef& titleFont,
21-
bool needEditingIcons, BaseGraphicalRenderer::TitleMode titleMode, bool useUnicode) {
19+
void installMonoBorderTitleTheme(GraphicsDeviceRenderer& gr, const MenuFontDef& itemFont, const MenuFontDef& titleFont,
20+
bool needEditingIcons, BaseGraphicalRenderer::TitleMode titleMode, bool useUnicode) {
21+
22+
// See https://tcmenu.github.io/documentation/arduino-libraries/tc-menu/themes/rendering-with-themes-icons-grids/
2223
TcThemeBuilder themeBuilder(gr);
23-
themeBuilder.withSelectedColors(0, 2)
24+
themeBuilder.withSelectedColors(0, 1)
2425
.dimensionsFromRenderer()
2526
.withItemPadding(MenuPadding(1))
2627
.withRenderingSettings(titleMode, false)
@@ -33,15 +34,14 @@ void installMonoInverseTitleTheme(GraphicsDeviceRenderer& gr, const MenuFontDef&
3334
}
3435

3536
if(useUnicode) {
36-
themeBuilder.enablingTcUnicode();
37+
themeBuilder.enableTcUnicode();
3738
}
3839

3940
themeBuilder.defaultTitleProperties()
4041
.withNativeFont(titleFont.fontData, titleFont.fontMag)
41-
.withPalette(defaultTitlePaletteMono)
42-
.withPadding(MenuPadding(TITLE_PADDING))
4342
.withJustification(tcgfx::GridPosition::JUSTIFY_TITLE_LEFT_WITH_VALUE)
4443
.withSpacing(TITLE_SPACING)
44+
.withBorder(MenuBorder(0, 0, TITLE_BORDER_THICKNESS, 0))
4545
.apply();
4646

4747
themeBuilder.defaultActionProperties()

0 commit comments

Comments
 (0)