skinclassic suggestions

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



    Hi!

I have a little suggestion about skinclassic - attached patch.
It looks much better :)

                                     Boguslaw Juza
-------------- next part --------------
--- skinclassic.c.orig	2006-10-03 17:20:26.000000000 +0200
+++ skinclassic.c	2006-10-07 20:34:21.000000000 +0200
@@ -112,14 +112,35 @@
 
 void cSkinClassicDisplayChannel::SetEvents(const cEvent *Present, const cEvent *Following)
 {
+  char *src, descr[60];
+  int a;
+
   osd->DrawRectangle(0, lineHeight, timeWidth - 1, osd->Height(), Theme.Color(clrChannelEpgTimeBg));
   osd->DrawRectangle(timeWidth, lineHeight, osd->Width() - 1, osd->Height(), Theme.Color(clrBackground));
   for (int i = 0; i < 2; i++) {
       const cEvent *e = !i ? Present : Following;
       if (e) {
+         src=(char *)e->ShortText();
+         if(!src)src=(char *)e->Description();
+         if((src)&&(strlen(src)>55)) {
+           for(a=55;a>0;a--)if(src[a]=='.')break;
+           if(a>0) {
+             memcpy(descr,src,a+1);
+             descr[a+1]=0;
+           }
+           else {
+             for(a=53;a>0;a--)if(src[a]==' ')break;
+             memcpy(descr,src,a);
+             strcpy(descr+a,"...");
+           }
+         }
+         else {
+           if(src)strcpy(descr,src);
+           else descr[0]=0;
+         }  
          osd->DrawText(             2, (2 * i + 1) * lineHeight, e->GetTimeString(), Theme.Color(clrChannelEpgTimeFg), Theme.Color(clrChannelEpgTimeBg), cFont::GetFont(fontOsd));
          osd->DrawText(timeWidth + 10, (2 * i + 1) * lineHeight, e->Title(), Theme.Color(clrChannelEpgTitle), Theme.Color(clrBackground), cFont::GetFont(fontOsd));
-         osd->DrawText(timeWidth + 10, (2 * i + 2) * lineHeight, e->ShortText(), Theme.Color(clrChannelEpgShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml));
+         osd->DrawText(timeWidth + 10, (2 * i + 2) * lineHeight, descr, Theme.Color(clrChannelEpgShortText), Theme.Color(clrBackground), cFont::GetFont(fontSml));
          }
       }
 }
@@ -315,7 +336,8 @@
   ts.Set(osd, xl, y, x1 - xl, y3 - y, Event->Title(), font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
   y += ts.Height();
   if (!isempty(Event->ShortText())) {
-     const cFont *font = cFont::GetFont(fontSml);
+     y += font->Height();
+//     const cFont *font = cFont::GetFont(fontSml);
      ts.Set(osd, xl, y, x1 - xl, y3 - y, Event->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
      y += ts.Height();
      }
@@ -346,7 +368,8 @@
   ts.Set(osd, xl, y, x1 - xl, y3 - y, Title, font, Theme.Color(clrMenuEventTitle), Theme.Color(clrBackground));
   y += ts.Height();
   if (!isempty(Info->ShortText())) {
-     const cFont *font = cFont::GetFont(fontSml);
+     y += font->Height();
+//     const cFont *font = cFont::GetFont(fontSml);
      ts.Set(osd, xl, y, x1 - xl, y3 - y, Info->ShortText(), font, Theme.Color(clrMenuEventShortText), Theme.Color(clrBackground));
      y += ts.Height();
      }

[Index of Archives]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Util Linux NG]     [Xfree86]     [Big List of Linux Books]     [Fedora Users]     [Fedora Women]     [ALSA Devel]     [Linux USB]

  Powered by Linux