-
-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #230 from TcMenu/main-themebuilder-fix
#229 theme builder fix for card layout
- Loading branch information
Showing
7 changed files
with
74 additions
and
47 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#ifndef TCMENU_THEME_MONO_INVERSE | ||
#define TCMENU_THEME_MONO_INVERSE | ||
|
||
#include <graphics/TcThemeBuilder.h> | ||
|
||
color_t defaultItemPaletteMono[] = {1, 0, 1, 1}; | ||
color_t defaultTitlePaletteMono[] = {0, 1, 0, 0}; | ||
|
||
#define TITLE_PADDING 2 | ||
#define TITLE_SPACING 2 | ||
|
||
/** | ||
* This is one of the stock themes, you can modify it to meet your requirements, and it will not be updated by tcMenu | ||
* Designer unless you delete it. This sets up the fonts, spacing and padding for all items. | ||
* @param gr the graphical renderer | ||
* @param itemFont the font for items | ||
* @param titleFont the font for titles | ||
* @param needEditingIcons if editing icons are needed | ||
*/ | ||
void installMonoInverseTitleTheme(GraphicsDeviceRenderer& gr, const MenuFontDef& itemFont, const MenuFontDef& titleFont, | ||
bool needEditingIcons, BaseGraphicalRenderer::TitleMode titleMode, bool useUnicode) { | ||
TcThemeBuilder themeBuilder(gr); | ||
themeBuilder.withSelectedColors(0, 2) | ||
.dimensionsFromRenderer() | ||
.withItemPadding(MenuPadding(1)) | ||
.withRenderingSettings(titleMode, false) | ||
.withPalette(defaultItemPaletteMono) | ||
.withNativeFont(itemFont.fontData, itemFont.fontMag) | ||
.withSpacing(1); | ||
|
||
if(needEditingIcons) { | ||
themeBuilder.withStandardLowResCursorIcons(); | ||
} | ||
|
||
if(useUnicode) { | ||
themeBuilder.enablingTcUnicode(); | ||
} | ||
|
||
themeBuilder.defaultTitleProperties() | ||
.withNativeFont(titleFont.fontData, titleFont.fontMag) | ||
.withPalette(defaultTitlePaletteMono) | ||
.withPadding(MenuPadding(TITLE_PADDING)) | ||
.withJustification(tcgfx::GridPosition::JUSTIFY_TITLE_LEFT_WITH_VALUE) | ||
.withSpacing(TITLE_SPACING) | ||
.apply(); | ||
|
||
themeBuilder.defaultActionProperties() | ||
.withJustification(tcgfx::GridPosition::JUSTIFY_TITLE_LEFT_WITH_VALUE) | ||
.apply(); | ||
|
||
themeBuilder.defaultItemProperties() | ||
.withJustification(tcgfx::GridPosition::JUSTIFY_TITLE_LEFT_VALUE_RIGHT) | ||
.apply(); | ||
|
||
themeBuilder.apply(); | ||
} | ||
|
||
#endif //TCMENU_THEME_MONO_INVERSE |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters