Truncate title and path

This commit is contained in:
Sahin Habermann 2018-02-24 17:04:17 +01:00 committed by Adubbz
parent 2e4b00f458
commit 443e912294

View File

@ -188,7 +188,7 @@ static void drawEntry(menuEntry_s* me, int off_x, int is_active) {
start_x = 1280 - 790; start_x = 1280 - 790;
start_y = 135; start_y = 135;
DrawText(interuimedium30, start_x, start_y, themeCurrent.textColor, me->name); DrawTextTruncate(interuimedium30, start_x, start_y, themeCurrent.textColor, me->name, 1280 - start_x - 120 ,"...");
if (me->type != ENTRY_TYPE_FOLDER) { if (me->type != ENTRY_TYPE_FOLDER) {
memset(tmpstr, 0, sizeof(tmpstr)); memset(tmpstr, 0, sizeof(tmpstr));
@ -285,7 +285,7 @@ void drawBackBtn(menu_s* menu, bool emptyDir) {
x_text = 1280 - 90 - 30; x_text = 1280 - 90 - 30;
} }
#ifdef SWITCH #ifdef SWITCH
if (strcmp( menu->dirname, "sdmc:/") != 0) if (strcmp( menu->dirname, "sdmc:/") != 0)
#else #else
if (strcmp( menu->dirname, "/") != 0) if (strcmp( menu->dirname, "/") != 0)
@ -315,11 +315,10 @@ void menuLoop() {
drawImage(40, 20, 140, 60, themeCurrent.hbmenuLogoImage, IMAGE_MODE_RGBA32); drawImage(40, 20, 140, 60, themeCurrent.hbmenuLogoImage, IMAGE_MODE_RGBA32);
DrawText(interuiregular14, 180, 46, themeCurrent.textColor, "v2.0.0"); DrawText(interuiregular14, 180, 46, themeCurrent.textColor, "v2.0.0");
DrawText(interuiregular18, 40, 720 - 47, themeCurrent.textColor, menu->dirname); DrawTextTruncate(interuiregular18, 40, 720 - 47, themeCurrent.textColor, menu->dirname, 918, "...");
//drawTime(); //drawTime();
if (menu->nEntries==0) if (menu->nEntries==0)
{ {
DrawText(interuiregular14, 64, 128, themeCurrent.textColor, textGetString(StrId_NoAppsFound_Msg)); DrawText(interuiregular14, 64, 128, themeCurrent.textColor, textGetString(StrId_NoAppsFound_Msg));