summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkamel5 <vdr.kamel5 (at) gmx (dot) net>2020-07-29 13:14:26 +0200
committerkamel5 <vdr.kamel5 (at) gmx (dot) net>2020-08-06 12:47:03 +0200
commit78d6e980eee9f879a33782ec4efa427623f75880 (patch)
tree9c3734f3cbcb2042b897c1c3c10ec3fa67c9830e
parent69356e9c4351cd2d47ba4630af6aec34e2aebddd (diff)
downloadvdr-plugin-tvguide-78d6e980eee9f879a33782ec4efa427623f75880.tar.gz
vdr-plugin-tvguide-78d6e980eee9f879a33782ec4efa427623f75880.tar.bz2
Wrap title in detailview header
-rw-r--r--view.c13
-rw-r--r--view.h1
2 files changed, 10 insertions, 4 deletions
diff --git a/view.c b/view.c
index 31174bf..59e940b 100644
--- a/view.c
+++ b/view.c
@@ -113,12 +113,18 @@ void cView::DrawHeader(void) {
}
}
//Date and Time, Title, Subtitle
+ int textWidthMax = headerWidth - xText - border / 2;
+ wrapper.Set(title.c_str(), fontHeaderLarge, textWidthMax);
+ int lineHeight = fontHeaderLarge->Height();
+ int textLines = wrapper.Lines();
int yDateTime = border / 2;
- int yTitle = (headerHeight - fontHeaderLarge->Height()) / 2;
+ int yTitle = (headerHeight - textLines * lineHeight) / 2;
int ySubtitle = headerHeight - fontHeader->Height() - border / 3;
- int textWidthMax = headerWidth - xText - border / 2;
+
pixmapHeader->DrawText(cPoint(xText, yDateTime), CutText(dateTime, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
- pixmapHeader->DrawText(cPoint(xText, yTitle), CutText(title, textWidthMax, fontHeaderLarge).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
+ for (int i = 0; i < textLines; i++) {
+ pixmapHeader->DrawText(cPoint(xText, yTitle + i * lineHeight), wrapper.GetLine(i), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeaderLarge);
+ }
pixmapHeader->DrawText(cPoint(xText, ySubtitle), CutText(subTitle, textWidthMax, fontHeader).c_str(), theme.Color(clrFont), theme.Color(clrStatusHeader), fontHeader);
//REC Icon
eTimerMatch timerMatch = tmNone;
@@ -481,7 +487,6 @@ bool cView::KeyUp(void) {
if (!scrollable)
return false;
int aktHeight = pixmapContent->DrawPort().Point().Y();
-// int lineHeight = font->Height();
if (aktHeight >= 0) {
return false;
}
diff --git a/view.h b/view.h
index e3f2fe7..88b821d 100644
--- a/view.h
+++ b/view.h
@@ -51,6 +51,7 @@ protected:
int contentHeight;
int tabHeight;
int scrollbarWidth;
+ cTextWrapper wrapper;
std::vector<std::string> tabs;
std::string title;
std::string subTitle;