summaryrefslogtreecommitdiff
path: root/interface.c
diff options
context:
space:
mode:
authorKlaus Schmidinger <vdr@tvdr.de>2000-11-05 13:04:23 +0100
committerKlaus Schmidinger <vdr@tvdr.de>2000-11-05 13:04:23 +0100
commitea0bd668c8326a90cc4727004780abe14bab1edc (patch)
tree668685e52e23210bdfb6c977eb6ed3b3794209c7 /interface.c
parent88253cfba73ed92f85af7be47b5d05f88226859b (diff)
downloadvdr-ea0bd668c8326a90cc4727004780abe14bab1edc.tar.gz
vdr-ea0bd668c8326a90cc4727004780abe14bab1edc.tar.bz2
Date and time in the title of an event info page are now always right adjusted
Diffstat (limited to 'interface.c')
-rw-r--r--interface.c23
1 files changed, 18 insertions, 5 deletions
diff --git a/interface.c b/interface.c
index 810270fe..ee8a78cb 100644
--- a/interface.c
+++ b/interface.c
@@ -4,7 +4,7 @@
* See the main source file 'vdr.c' for copyright information and
* how to reach the author.
*
- * $Id: interface.c 1.28 2000/11/01 15:27:52 kls Exp $
+ * $Id: interface.c 1.29 2000/11/05 12:50:44 kls Exp $
*/
#include "interface.h"
@@ -238,11 +238,24 @@ void cInterface::WriteText(int x, int y, const char *s, eDvbColor FgColor, eDvbC
void cInterface::Title(const char *s)
{
- int x = (Width() - strlen(s)) / 2;
- if (x < 0)
- x = 0;
ClearEol(0, 0, clrCyan);
- Write(x, 0, s, clrBlack, clrCyan);
+ const char *t = strchr(s, '\t');
+ if (t) {
+ char buffer[Width() + 1];
+ unsigned int n = t - s;
+ if (n >= sizeof(buffer))
+ n = sizeof(buffer) - 1;
+ strn0cpy(buffer, s, n);
+ Write(1, 0, buffer, clrBlack, clrCyan);
+ t++;
+ Write(-(cDvbApi::PrimaryDvbApi->WidthInCells(t) + 1), 0, t, clrBlack, clrCyan);
+ }
+ else {
+ int x = (Width() - strlen(s)) / 2;
+ if (x < 0)
+ x = 0;
+ Write(x, 0, s, clrBlack, clrCyan);
+ }
}
void cInterface::Status(const char *s, eDvbColor FgColor, eDvbColor BgColor)