Added SystemVersion to the homescreen

This commit is contained in:
Ericvf 2021-07-22 19:33:36 +02:00
parent 5c85dd784b
commit 678173744e
3 changed files with 17 additions and 0 deletions

View File

@ -88,6 +88,7 @@ typedef enum
ThemeLayoutId_MenuActiveEntryName,
ThemeLayoutId_MenuActiveEntryAuthor,
ThemeLayoutId_MenuActiveEntryVersion,
ThemeLayoutId_SystemVersion,
ThemeLayoutId_Total,
} ThemeLayoutId;

View File

@ -565,6 +565,13 @@ void drawNetwork(int tmpX, AssetId id) {
if (layoutobj->visible) drawIcon(layoutobj->posType ? tmpX + layoutobj->posStart[0] : layoutobj->posStart[0], layoutobj->posStart[1], data->imageSize[0], data->imageSize[1], data->buffer, themeCurrent.textColor);
}
void drawSystemVersion(){
char tmpstr[32];
u32 currentVersion = hosversionGet();
snprintf(tmpstr, sizeof(tmpstr)-1, "System v%d.%d.%d", HOSVER_MAJOR(currentVersion), HOSVER_MINOR(currentVersion), HOSVER_MICRO(currentVersion));
DrawTextFromLayout(ThemeLayoutId_SystemVersion, themeCurrent.textColor, tmpstr);
}
u32 drawStatus() {
bool netstatusFlag=0;
bool temperatureFlag=0;
@ -598,6 +605,8 @@ u32 drawStatus() {
}
}
drawSystemVersion();
return tmpX;
}

View File

@ -404,6 +404,13 @@ void themeStartup(ThemePreset preset) {
.posStart = {1280 - 790, 135+10 + 28 + 30 + 18 + 6 + 18},
.font = interuiregular14,
},
[ThemeLayoutId_SystemVersion] = {
.visible = true,
.posType = false,
.posStart = {40 + 2, 0 + 47 + 10 + 21 + 8},
.font = interuiregular14,
},
},
};