summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-04-03 18:13:11 +0200
committerMartin Schirrmacher <vdr.skinflatplus@schirrmacher.eu>2014-04-03 18:13:11 +0200
commit9df36839398d1b3ddba93860cdb9d4923b55155c (patch)
treed7639cbff442b916adba9dea51bfbc12c3429a43
parentf1050be7475b98f2a3a094c1451f7360d18663e4 (diff)
downloadskin-flatplus-9df36839398d1b3ddba93860cdb9d4923b55155c.tar.gz
skin-flatplus-9df36839398d1b3ddba93860cdb9d4923b55155c.tar.bz2
wide format channel logos in menu and topbar
-rw-r--r--README5
-rw-r--r--baserender.c11
-rw-r--r--displaychannel.c18
-rw-r--r--displaymenu.c147
4 files changed, 111 insertions, 70 deletions
diff --git a/README b/README
index d8eef6c4..5c51ed70 100644
--- a/README
+++ b/README
@@ -30,9 +30,8 @@ Installation wie bei allen VDR Plugins.
make
make install
-Für die Kanallogos empfehle ich die Logos von 3PO Repo (https://github.com/3PO/Senderlogos).
-Diese können mit folgendem Befehl heruntergeladen werden:
- git clone https://github.com/3PO/Senderlogos.git logos
+Für die Kanallogos empfehle ich die Logos von CReimer: http://creimer.net/channellogos/
+Ich nutze "nopacity-logos-white"
Die Logos müssen im folgenden Ordner zur Verfügung gestellt werden:
<vdrconfigdir>/plugins/skinflat/logos/
diff --git a/baserender.c b/baserender.c
index b857f111..a0805baf 100644
--- a/baserender.c
+++ b/baserender.c
@@ -214,25 +214,26 @@ void cFlatBaseRender::TopBarUpdate(void) {
if( topBarMenuLogoSet && Config.TopBarMenuIconShow ) {
topBarIconPixmap->Fill(clrTransparent);
int IconLeft = marginItem;
- int imageBGWidth = 999;
int imageBGHeight = topBarHeight - marginItem*2;
+ int imageBGWidth = imageBGHeight*1.34;
int iconTop = 0;
cImage *imgBG = imgLoader.LoadIcon("logo_background", imageBGWidth, imageBGHeight);
if( imgBG ) {
- iconTop = (topBarHeight / 2 - imgBG->Height()/2);
imageBGHeight = imgBG->Height();
imageBGWidth = imgBG->Width();
+ iconTop = (topBarHeight / 2 - imgBG->Height()/2);
topBarIconBGPixmap->DrawImage( cPoint(IconLeft, iconTop), *imgBG );
}
- cImage *img = imgLoader.LoadLogo(*topBarMenuLogo, imageBGWidth, imageBGHeight);
+ cImage *img = imgLoader.LoadLogo(*topBarMenuLogo, imageBGWidth - 4, imageBGHeight - 4);
if( img ) {
iconTop += (imageBGHeight - img->Height())/2;
+ IconLeft += (imageBGWidth - img->Width())/2;
topBarIconPixmap->DrawImage(cPoint(IconLeft, iconTop), *img);
- MenuIconWidth = img->Width()+marginItem*2;
- TitleWidthLeft -= MenuIconWidth + marginItem*3;
}
+ MenuIconWidth = imageBGWidth+marginItem*2;
+ TitleWidthLeft -= MenuIconWidth + marginItem*3;
}
time_t t;
diff --git a/displaychannel.c b/displaychannel.c
index 71338395..6c84c841 100644
--- a/displaychannel.c
+++ b/displaychannel.c
@@ -140,7 +140,7 @@ void cFlatDisplayChannel::SetChannel(const cChannel *Channel, int Number) {
int imageBGWidth = imageHeight;
int imageLeft = marginItem*2;
int imageTop = marginItem;
- cImage *imgBG = imgLoader.LoadIcon("logo_background", imageHeight*1.3, imageHeight);
+ cImage *imgBG = imgLoader.LoadIcon("logo_background", imageHeight*1.34, imageHeight);
if( imgBG ) {
imageBGHeight = imgBG->Height();
imageBGWidth = imgBG->Width();
@@ -547,15 +547,23 @@ void cFlatDisplayChannel::Flush(void) {
void cFlatDisplayChannel::PreLoadImages(void) {
int height = (fontHeight*2) + (fontSmlHeight*2) + marginItem - marginItem*2;
imgLoader.LoadIcon("logo_background", height, height);
- imgLoader.LoadIcon("radio", height, height);
- imgLoader.LoadIcon("tv", height, height);
-
+ int imageBGHeight, imageBGWidth;
+ imageBGHeight = imageBGWidth = height;
+
+ cImage *imgBG = imgLoader.LoadIcon("logo_background", height*1.34, height);
+ if( imgBG ) {
+ imageBGHeight = imgBG->Height();
+ imageBGWidth = imgBG->Width();
+ }
+ imgLoader.LoadIcon("radio", imageBGWidth - 10, imageBGHeight - 10);
+ imgLoader.LoadIcon("tv", imageBGWidth - 10, imageBGHeight - 10);
+
int index = 0;
height = ((fontHeight*2) + (fontSmlHeight*2) + marginItem) - marginItem*2;
cImage *img = NULL;
for(cChannel *Channel = Channels.First(); Channel && index < LOGO_PRE_CACHE; Channel = Channels.Next(Channel) )
{
- img = imgLoader.LoadLogo(Channel->Name(), height, height);
+ img = imgLoader.LoadLogo(Channel->Name(), imageBGWidth - 4, imageBGHeight - 4);
if( img )
index++;
}
diff --git a/displaymenu.c b/displaymenu.c
index 334798f8..f8f93c5d 100644
--- a/displaymenu.c
+++ b/displaymenu.c
@@ -687,42 +687,51 @@ bool cFlatDisplayMenu::SetItemChannel(const cChannel *Channel, int Index, bool C
int imageHeight = fontHeight;
int imageLeft = Left;
int imageTop = Top;
+ int imageBGHeight = imageHeight;
+ int imageBGWidth = imageHeight*1.34;
if( !Channel->GroupSep() ) {
- cImage *imgBG = imgLoader.LoadIcon("logo_background", imageHeight, imageHeight);
+ cImage *imgBG = imgLoader.LoadIcon("logo_background", imageHeight*1.34, imageHeight);
if( imgBG ) {
+ imageBGHeight = imgBG->Height();
+ imageBGWidth = imgBG->Width();
imageTop = Top + (fontHeight - imgBG->Height()) / 2;
menuIconsBGPixmap->DrawImage( cPoint(imageLeft, imageTop), *imgBG );
}
}
- cImage *img = imgLoader.LoadLogo(Channel->Name(), imageHeight, imageHeight);
+ cImage *img = imgLoader.LoadLogo(Channel->Name(), imageBGWidth - 4, imageBGHeight - 4);
if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
+
menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
- Left += imageHeight + marginItem * 2;
+ Left += imageBGWidth + marginItem * 2;
} else {
bool isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false;
if( isRadioChannel ) {
- img = imgLoader.LoadIcon("radio", imageHeight, imageHeight);
+ img = imgLoader.LoadIcon("radio", imageBGWidth - 10, imageBGHeight - 10);
if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
- Left += imageHeight + marginItem * 2;
+ Left += imageBGWidth + marginItem * 2;
}
} else if( Channel->GroupSep() ) {
- img = imgLoader.LoadIcon("changroup", imageHeight, imageHeight);
+ img = imgLoader.LoadIcon("changroup", imageBGWidth - 10, imageBGHeight - 10);
if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
- Left += imageHeight + marginItem * 2;
+ Left += imageBGWidth + marginItem * 2;
}
} else {
- img = imgLoader.LoadIcon("tv", imageHeight, imageHeight);
+ img = imgLoader.LoadIcon("tv", imageBGWidth - 10, imageBGHeight - 10);
if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
- Left += imageHeight + marginItem * 2;
+ Left += imageBGWidth + marginItem * 2;
}
}
}
@@ -1016,40 +1025,49 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current
imageLeft = Left;
- cImage *imgBG = imgLoader.LoadIcon("logo_background", imageHeight, imageHeight);
+ int imageBGHeight = imageHeight;
+ int imageBGWidth = imageHeight*1.34;
+
+ cImage *imgBG = imgLoader.LoadIcon("logo_background", imageBGWidth, imageBGHeight);
if( imgBG ) {
+ imageBGHeight = imgBG->Height();
+ imageBGWidth = imgBG->Width();
imageTop = Top + (fontHeight - imgBG->Height()) / 2;
menuIconsBGPixmap->DrawImage( cPoint(imageLeft, imageTop), *imgBG );
}
- img = imgLoader.LoadLogo(Channel->Name(), imageHeight, imageHeight);
+ img = imgLoader.LoadLogo(Channel->Name(), imageBGWidth - 4, imageBGHeight - 4);
if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
} else {
bool isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false;
if( isRadioChannel ) {
- img = imgLoader.LoadIcon("radio", imageHeight, imageHeight);
+ img = imgLoader.LoadIcon("radio", imageBGWidth - 10, imageBGHeight - 10);
if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
}
} else if( Channel->GroupSep() ) {
- img = imgLoader.LoadIcon("changroup", imageHeight, imageHeight);
+ img = imgLoader.LoadIcon("changroup", imageBGWidth - 10, imageBGHeight - 10);
if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
}
} else {
- img = imgLoader.LoadIcon("tv", imageHeight, imageHeight);
+ img = imgLoader.LoadIcon("tv", imageBGWidth - 10, imageBGHeight - 10);
if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
}
}
}
- Left += imageHeight + marginItem * 2;
+ Left += imageBGWidth + marginItem * 2;
cString day, name("");
if (Timer->WeekDays())
@@ -1191,42 +1209,50 @@ bool cFlatDisplayMenu::SetItemEvent(const cEvent *Event, int Index, bool Current
}
Left += w + marginItem;
+ int imageLeft = Left;
+ int imageBGHeight = fontHeight;
+ int imageBGWidth = fontHeight*1.34;
if( !Channel->GroupSep() ) {
- cImage *imgBG = imgLoader.LoadIcon("logo_background", fontHeight, fontHeight);
+ cImage *imgBG = imgLoader.LoadIcon("logo_background", imageBGWidth, imageBGHeight);
if( imgBG ) {
+ imageBGHeight = imgBG->Height();
+ imageBGWidth = imgBG->Width();
imageTop = Top + (fontHeight - imgBG->Height()) / 2;
- menuIconsBGPixmap->DrawImage( cPoint(Left, imageTop), *imgBG );
+ menuIconsBGPixmap->DrawImage( cPoint(imageLeft, imageTop), *imgBG );
}
- }
- img = imgLoader.LoadLogo(Channel->Name(), fontHeight, fontHeight);
- if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
- menuIconsPixmap->DrawImage( cPoint(Left, imageTop), *img );
- } else {
- bool isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false;
-
- if( isRadioChannel ) {
- img = imgLoader.LoadIcon("radio", fontHeight, fontHeight);
- if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
- menuIconsPixmap->DrawImage( cPoint(Left, imageTop), *img );
- }
- } else if( Channel->GroupSep() ) {
- img = imgLoader.LoadIcon("changroup", fontHeight, fontHeight);
- if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
- menuIconsPixmap->DrawImage( cPoint(Left, imageTop), *img );
- }
+ img = imgLoader.LoadLogo(Channel->Name(), imageBGWidth - 4, imageBGHeight - 4);
+ if( img ) {
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
+ menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
} else {
- img = imgLoader.LoadIcon("tv", fontHeight, fontHeight);
- if( img ) {
- imageTop = Top + (fontHeight - img->Height()) / 2;
- menuIconsPixmap->DrawImage( cPoint(Left, imageTop), *img );
+ bool isRadioChannel = ((!Channel->Vpid())&&(Channel->Apid(0))) ? true : false;
+
+ if( isRadioChannel ) {
+ img = imgLoader.LoadIcon("radio", imageBGWidth - 10, imageBGHeight - 10);
+ if( img ) {
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
+ menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
+ }
+ } else if( Channel->GroupSep() ) {
+ img = imgLoader.LoadIcon("changroup", imageBGWidth - 10, imageBGHeight - 10);
+ if( img ) {
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
+ menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
+ }
+ } else {
+ img = imgLoader.LoadIcon("tv", imageBGWidth - 10, imageBGHeight - 10);
+ if( img ) {
+ imageTop = Top + (imageBGHeight - img->Height()) / 2;
+ imageLeft = Left + (imageBGWidth - img->Width()) / 2;
+ menuIconsPixmap->DrawImage( cPoint(imageLeft, imageTop), *img );
+ }
}
}
- }
-
- Left += fontHeight + marginItem * 2;
+ }
+ Left += imageBGWidth + marginItem * 2;
LeftSecond = Left;
w = menuWidth / 10 * 2;
@@ -2438,10 +2464,17 @@ void cFlatDisplayMenu::PreLoadImages(void) {
imgLoader.LoadIcon("menuIcons/blank", fontHeight - marginItem*2, fontHeight - marginItem*2);
int imageHeight = fontHeight;
- imgLoader.LoadIcon("logo_background", imageHeight, imageHeight);
- imgLoader.LoadIcon("radio", imageHeight, imageHeight);
- imgLoader.LoadIcon("changroup", imageHeight, imageHeight);
- imgLoader.LoadIcon("tv", imageHeight, imageHeight);
+ int imageBGHeight = imageHeight;
+ int imageBGWidth = imageHeight*1.34;
+ cImage *imgBG = imgLoader.LoadIcon("logo_background", imageBGWidth, imageBGHeight);
+ if( imgBG ) {
+ imageBGHeight = imgBG->Height();
+ imageBGWidth = imgBG->Width();
+ }
+
+ imgLoader.LoadIcon("radio", imageBGWidth - 10, imageBGHeight - 10);
+ imgLoader.LoadIcon("changroup", imageBGWidth - 10, imageBGHeight - 10);
+ imgLoader.LoadIcon("tv", imageBGWidth - 10, imageBGHeight - 10);
imgLoader.LoadIcon("timerInactive", imageHeight, imageHeight);
imgLoader.LoadIcon("timerRecording", imageHeight, imageHeight);
imgLoader.LoadIcon("timerActive", imageHeight, imageHeight);
@@ -2450,7 +2483,7 @@ void cFlatDisplayMenu::PreLoadImages(void) {
cImage *img = NULL;
for(cChannel *Channel = Channels.First(); Channel && index < LOGO_PRE_CACHE; Channel = Channels.Next(Channel))
{
- img = imgLoader.LoadLogo(Channel->Name(), fontHeight - marginItem*2, fontHeight - marginItem*2);
+ img = imgLoader.LoadLogo(Channel->Name(), imageBGWidth - 4, imageBGHeight - 4);
if( img )
index++;
}