diff options
-rw-r--r-- | displaymessage.c | 2 | ||||
-rw-r--r-- | helpers.c | 10 | ||||
-rw-r--r-- | textwindow.c | 13 |
3 files changed, 17 insertions, 8 deletions
diff --git a/displaymessage.c b/displaymessage.c index aa15005..894d8d8 100644 --- a/displaymessage.c +++ b/displaymessage.c @@ -57,7 +57,7 @@ void cNopacityDisplayMessage::SetMessage(eMessageType Type, const char *Text) { pixmap->DrawImage(cPoint(1, 1), imgLoader.GetImage()); } if (config.roundedCorners) { - DrawRoundedCornersWithBorder(pixmap, col, config.cornerRadius, width, height); + DrawRoundedCornersWithBorder(pixmap, col, config.cornerRadius, width, height, pixmapBackground); } int textWidth = font->Width(Text); pixmap->DrawText(cPoint((width - textWidth) / 2, (height - font->Height()) / 2), Text, colFont, (config.doBlending)?clrTransparent:col, font); @@ -49,20 +49,28 @@ static void DrawRoundedCorners(cPixmap *p, int radius, int x, int y, int width, } } -static void DrawRoundedCornersWithBorder(cPixmap *p, tColor borderColor, int radius, int width, int height) { +static void DrawRoundedCornersWithBorder(cPixmap *p, tColor borderColor, int radius, int width, int height, cPixmap *pBack = NULL) { if (radius < 3) return; p->DrawEllipse(cRect(0,0,radius,radius), borderColor, -2); p->DrawEllipse(cRect(-1,-1,radius,radius), clrTransparent, -2); + if (pBack) + pBack->DrawEllipse(cRect(-1,-1,radius,radius), clrTransparent, -2); p->DrawEllipse(cRect(width-radius,0,radius,radius), borderColor, -1); p->DrawEllipse(cRect(width-radius+1,-1,radius,radius), clrTransparent, -1); + if (pBack) + pBack->DrawEllipse(cRect(width-radius+1,-1,radius,radius), clrTransparent, -1); p->DrawEllipse(cRect(0,height-radius,radius,radius), borderColor, -3); p->DrawEllipse(cRect(-1,height-radius+1,radius,radius), clrTransparent, -3); + if (pBack) + pBack->DrawEllipse(cRect(-1,height-radius+1,radius,radius), clrTransparent, -3); p->DrawEllipse(cRect(width-radius,height-radius,radius,radius), borderColor, -4); p->DrawEllipse(cRect(width-radius+1,height-radius+1,radius,radius), clrTransparent, -4); + if (pBack) + pBack->DrawEllipse(cRect(width-radius+1,height-radius+1,radius,radius), clrTransparent, -4); } diff --git a/textwindow.c b/textwindow.c index 6273c9e..0277f29 100644 --- a/textwindow.c +++ b/textwindow.c @@ -253,6 +253,7 @@ void cNopacityTextWindow::SetRecording(const cRecording *recording) { int widthTextHeader = width - 2 * border; int widthText = widthTextHeader; int y = border; + //Image cImageLoader imgLoader; bool recImageFound = false; if (hasManualPoster) { @@ -291,7 +292,7 @@ void cNopacityTextWindow::SetRecording(const cRecording *recording) { int maxHeight = height - y; if ((hasPoster || hasManualPoster) && (y < (border + posterHeight))) { int heightNarrow = border + posterHeight - y; - DrawTextWrapperFloat(recording->Info()->Description(), + DrawTextWrapperFloat(recording->Info()->Description(), widthTextHeader, widthText, y, heightNarrow, border, font, Theme.Color(clrMenuFontDetailViewText), maxHeight); } else if (recImageFound && (y < (border + config.epgImageHeight))) { @@ -325,21 +326,22 @@ int cNopacityTextWindow::DrawTextWrapperFloat(const char *text, int widthSmall, tColor color, int maxHeight) { int lineHeight = font->Height(); int numLinesNarrow = heightNarrow / lineHeight + 1; - cTextWrapper test; test.Set(text, font, widthSmall); std::stringstream sstrTextTall; std::stringstream sstrTextFull; bool drawFull = false; + int numEmptyLinesAtEnd = 0; for (int line = 0; line < test.Lines(); line++) { bool lineWrap = false; - if (font->Width(test.GetLine(line)) < (widthSmall - 100)) + if (font->Width(test.GetLine(line)) < (widthSmall - 100)) { lineWrap = true; + } if (line < numLinesNarrow) { sstrTextTall << test.GetLine(line); - if (lineWrap) + if (lineWrap) { sstrTextTall << "\n"; - else + } else sstrTextTall << " "; } else { drawFull = true; @@ -350,7 +352,6 @@ int cNopacityTextWindow::DrawTextWrapperFloat(const char *text, int widthSmall, sstrTextFull << " "; } } - cTextWrapper wrapperNarrow; wrapperNarrow.Set(sstrTextTall.str().c_str(), font, widthSmall); int height = 2*font->Height(); |