From 01926b2824345c669b3445e2ba2e082fed3745cd Mon Sep 17 00:00:00 2001 From: GetAway Date: Thu, 12 Oct 2017 14:44:07 +0200 Subject: [PATCH] fix position of hintbox for other resolutions --- shellexec.c | 6 +++--- text.c | 15 ++++++++------- 2 files changed, 11 insertions(+), 10 deletions(-) diff --git a/shellexec.c b/shellexec.c index 328c241..fa53880 100644 --- a/shellexec.c +++ b/shellexec.c @@ -12,7 +12,7 @@ #include "pngw.h" -#define SH_VERSION 2.12 +#define SH_VERSION 2.13 static char CFG_FILE[128]="/var/tuxbox/config/shellexec.conf"; @@ -1804,8 +1804,8 @@ int main (int argc, char **argv) memcpy(lfb, lbb, var_screeninfo.xres*var_screeninfo.yres*sizeof(uint32_t)); //blit(); - startx = sx + (((ex-sx) - (fix_screeninfo.line_length-scale2res(200)))/2); - starty = sy + (((ey-sy) - (var_screeninfo.yres-scale2res(150)))/2); + startx = sx; + starty = sy; /* scale to resolution */ FSIZE_BIG = scale2res(FSIZE_BIG); diff --git a/text.c b/text.c index 384ef99..59fcb2a 100644 --- a/text.c +++ b/text.c @@ -493,11 +493,11 @@ void ShowMessage(char *mtitle, char *message, int wait) int ixw=scale2res(420); int iyw=wait?scale2res(327):scale2res(300); int lx=startx; - //int ly=starty; + int ly=starty; char *tdptr; - startx = sx + (((ex-sx) - ixw)/2); - //starty=sy; + startx = sx + ((ex-sx) - ixw)/2; + starty = sy + ((ey-sy) - iyw)/2 - iyw/2; //layout RenderBox(0+OFFSET_SMALL, scale2res(178)+OFFSET_SMALL, ixw+OFFSET_SMALL, iyw+OFFSET_SMALL, radius, COL_SHADOW_PLUS_0); @@ -515,15 +515,16 @@ void ShowMessage(char *mtitle, char *message, int wait) free(tdptr); if(wait) - { int offs=2*OFFSET_MED+OFFSET_SMALL; // 35 + { + int offs=3*OFFSET_MED+OFFSET_SMALL; RenderBox(ixw/2-offs+OFFSET_SMALL, scale2res(286)+OFFSET_SMALL, ixw/2+offs+OFFSET_SMALL, scale2res(310)+OFFSET_SMALL, radius_small, COL_SHADOW_PLUS_0); RenderBox(ixw/2-offs, scale2res(286), ixw/2+offs, scale2res(310), radius_small, CMCS); - RenderString("OK", ixw/2-scale2res(25), scale2res(312), scale2res(50), CENTER, FSIZE_MED, CMCT); + RenderString("OK", ixw/2-scale2res(25), scale2res(310), scale2res(50), CENTER, FSIZE_MED, CMCT); } memcpy(lfb, lbb, var_screeninfo.xres*var_screeninfo.yres*sizeof(uint32_t)); while(wait && (GetRCCode(300) != RC_OK)); - startx=lx; - //starty=ly; + startx = lx; + starty = ly; } -- 2.39.5