summaryrefslogtreecommitdiff
path: root/watch.c
diff options
context:
space:
mode:
authoranbr <vdr07@deltab.de>2014-05-04 11:23:50 +0200
committeranbr <vdr07@deltab.de>2014-05-04 11:23:50 +0200
commit3d87cc0b6a062a39b9385f33bdec88ee25967776 (patch)
tree3c907421cacd9ee7bd8d56e4e85f986d3b45bef1 /watch.c
parentf110173bb35f84b8b6bca4dfd84b910b7deac1ef (diff)
downloadvdr-plugin-targavfd-3d87cc0b6a062a39b9385f33bdec88ee25967776.tar.gz
vdr-plugin-targavfd-3d87cc0b6a062a39b9385f33bdec88ee25967776.tar.bz2
Dual-Line-Mode: Eclipse long channel names (Closes: #1815)
Diffstat (limited to 'watch.c')
-rw-r--r--watch.c28
1 files changed, 21 insertions, 7 deletions
diff --git a/watch.c b/watch.c
index e103284..6e7f4da 100644
--- a/watch.c
+++ b/watch.c
@@ -423,11 +423,20 @@ bool cVFDWatch::RenderScreenSinglePage(bool bReDraw) {
if(scRender) {
int iRet = -1;
+ int w = pFont->Width(*scRender);
if(theSetup.m_nRenderMode == eRenderMode_DualLine) {
iRet = this->DrawText(0 - m_nScrollOffset,pFont->Height(), *scRender);
+ if((w - m_nScrollOffset) == iRet)
+ iRet = 0; // Text fits into screen
+ else
+ iRet = 1; // Text large then screen
} else {
int nTop = (theSetup.m_cHeight - pFont->Height())/2;
iRet = this->DrawText(0 - m_nScrollOffset,nTop<0?0:nTop, *scRender);
+ if((w - m_nScrollOffset) == iRet)
+ iRet = 0; // Text fits into screen
+ else
+ iRet = 1; // Text large then screen
}
if(m_bScrollNeeded) {
switch(iRet) {
@@ -456,14 +465,13 @@ bool cVFDWatch::RenderScreenSinglePage(bool bReDraw) {
}
if(scHeader && theSetup.m_nRenderMode == eRenderMode_DualLine) {
+ int t = 0;
if(bAllowCurrentTime && currentTime) {
- int t = pFont->Width(*currentTime);
- int w = pFont->Width(*scHeader);
- if((w + t + 3) < theSetup.m_cWidth && t < theSetup.m_cWidth) {
- this->DrawText(theSetup.m_cWidth - t, 0, *currentTime);
- }
+ t = pFont->Width(*currentTime);
+ this->DrawText(theSetup.m_cWidth - t, 0, *currentTime);
+ t += 1;
}
- this->DrawText(0, 0, *scHeader);
+ this->DrawTextEclipsed(0, 0, *scHeader, theSetup.m_cWidth - t);
}
m_bUpdateScreen = false;
@@ -539,11 +547,17 @@ bool cVFDWatch::RenderText(bool bForce, bool bReDraw, cString* scText) {
if(scText) {
int iRet = -1;
int nTop = (theSetup.m_cHeight - pFont->Height())/2;
- int nAlign = (this->Width() - pFont->Width(*scText)) / 2;
+ int w = pFont->Width(*scText);
+ int nAlign = (this->Width() - w) / 2;
if(nAlign < 0) {
nAlign = 0;
}
iRet = this->DrawText(nAlign - m_nScrollOffset,nTop<0?0:nTop, *scText);
+ if((nAlign + (w - m_nScrollOffset)) == iRet)
+ iRet = 0; // Text fits into screen
+ else
+ iRet = 1; // Text large then screen
+
if(m_bScrollNeeded) {
switch(iRet) {
case 0: