diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-05-07 18:03:38 +0200 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-05-07 18:03:38 +0200 |
commit | 4054a186825adeb71f11a10789bbb9ce18b1d856 (patch) | |
tree | 77a8c2b6890ce08f0ca0a6188d5454d7fbd84c86 | |
parent | 4b3dfaf108a2b1e9f48aa342c4be99e055922041 (diff) | |
download | skin-flatplus-4054a186825adeb71f11a10789bbb9ce18b1d856.tar.gz skin-flatplus-4054a186825adeb71f11a10789bbb9ce18b1d856.tar.bz2 |
fix floated text, actor images
-rw-r--r-- | complexcontent.c | 7 | ||||
-rw-r--r-- | displaymenu.c | 23 |
2 files changed, 20 insertions, 10 deletions
diff --git a/complexcontent.c b/complexcontent.c index 621f00da..4be08db1 100644 --- a/complexcontent.c +++ b/complexcontent.c @@ -152,15 +152,18 @@ void cComplexContent::AddImageWithFloatedText(cImage *image, int imageAlignment, AddImage(image, ImagePos); } else { int NumChars = 0; - for( int i = 0; i < Lines && i <= FloatLines; i++) { + for( int i = 0; i < Lines && i < FloatLines; i++) { NumChars += strlen(WrapperFloat.GetLine(i)); } - + // detect end of last word + for(; text[NumChars] != ' ' && text[NumChars] != '\0'; NumChars++) + ; char *FloatedText; FloatedText = new char[NumChars+1]; memset(FloatedText, '\0', NumChars+1); strncpy(FloatedText, text, NumChars); + NumChars++; char *SecondText; SecondText = new char[strlen(text) - NumChars + 2]; memset(SecondText, '\0', strlen(text) - NumChars + 2); diff --git a/displaymenu.c b/displaymenu.c index 85d2d5a2..06504e59 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -2030,9 +2030,12 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) { mediaPath = call.posters[0].path; } for( unsigned int i = 0; i < call.actors.size(); i++ ) { - actors_path.push_back(call.actors[i].thumb.path); - actors_name.push_back(call.actors[i].name); - actors_role.push_back(call.actors[i].role); + cImage *img = imgLoader.LoadFile(call.actors[i].thumb.path.c_str(), 100, 100); + if( img ) { + actors_path.push_back(call.actors[i].thumb.path); + actors_name.push_back(call.actors[i].name); + actors_role.push_back(call.actors[i].role); + } } } } @@ -2099,11 +2102,12 @@ void cFlatDisplayMenu::SetEvent(const cEvent *Event) { ComplexContent.AddImage(img, cRect(x, y, 0, 0)); std::string name = actors_name[actor]; std::stringstream sstrRole; - sstrRole << "\"" << actors_role[actor] << "\""; + if( actors_role[actor].length() > 0 ) + sstrRole << "\"" << actors_role[actor] << "\""; std::string role = sstrRole.str(); ComplexContent.AddText(name.c_str(), false, cRect(x, y + img->Height() + marginItem, actorWidth, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, actorWidth, fontSmlHeight, taCenter); ComplexContent.AddText(role.c_str(), false, cRect(x, y + img->Height() + marginItem + fontSmlHeight, actorWidth, 0), Theme.Color(clrMenuEventFontInfo), Theme.Color(clrMenuEventBg), fontSml, actorWidth, fontSmlHeight, taCenter); - } + } x += actorWidth + actorMargin; actor++; } @@ -2802,9 +2806,12 @@ void cFlatDisplayMenu::SetRecording(const cRecording *Recording) { mediaPath = call.posters[0].path; } for( unsigned int i = 0; i < call.actors.size(); i++ ) { - actors_path.push_back(call.actors[i].thumb.path); - actors_name.push_back(call.actors[i].name); - actors_role.push_back(call.actors[i].role); + cImage *img = imgLoader.LoadFile(call.actors[i].thumb.path.c_str(), 100, 100); + if( img ) { + actors_path.push_back(call.actors[i].thumb.path); + actors_name.push_back(call.actors[i].name); + actors_role.push_back(call.actors[i].role); + } } } } |