mirror of
https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
synced 2023-10-05 15:01:48 +02:00
Changed the size and location of the channel logos to better fit in place
This leads to a better positioning of the channel logos if they are displayed in the EPG grid
This commit is contained in:
parent
936db4a087
commit
e2d67769dc
10
headergrid.c
10
headergrid.c
@ -56,7 +56,8 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
|
|||||||
cImage *logo = imgCache.GetLogo(channel);
|
cImage *logo = imgCache.GetLogo(channel);
|
||||||
if (logo) {
|
if (logo) {
|
||||||
const int logoheight = logo->Height();
|
const int logoheight = logo->Height();
|
||||||
pixmapLogo->DrawImage(cPoint(logoX, (Height() - logoheight) / 2), *logo);
|
const int logowidth = logo->Width();
|
||||||
|
pixmapLogo->DrawImage(cPoint(logoX + ((logoWidth - logowidth) / 2), (Height() - logoheight) / 2), *logo);
|
||||||
logoFound = true;
|
logoFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -81,7 +82,6 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) {
|
|||||||
// Draw Channel vertical view
|
// Draw Channel vertical view
|
||||||
|
|
||||||
void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
|
void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
|
||||||
int logoWidth = geoManager.logoWidth;
|
|
||||||
int logoHeight = geoManager.logoHeight;
|
int logoHeight = geoManager.logoHeight;
|
||||||
cTextWrapper tw;
|
cTextWrapper tw;
|
||||||
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
|
cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name());
|
||||||
@ -93,8 +93,10 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) {
|
|||||||
if (!config.hideChannelLogos) {
|
if (!config.hideChannelLogos) {
|
||||||
cImage *logo = imgCache.GetLogo(channel);
|
cImage *logo = imgCache.GetLogo(channel);
|
||||||
if (logo) {
|
if (logo) {
|
||||||
pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo);
|
const int logoheight = logo->Height();
|
||||||
logoFound = true;
|
const int logowidth = logo->Width();
|
||||||
|
pixmapLogo->DrawImage(cPoint((Width() - logowidth) / 2, (logoHeight - logoheight) / 2), *logo);
|
||||||
|
logoFound = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
bool drawText = false;
|
bool drawText = false;
|
||||||
|
@ -357,7 +357,7 @@ cImage *cImageCache::GetLogo(const cChannel *channel) {
|
|||||||
delete tempStaticLogo;
|
delete tempStaticLogo;
|
||||||
tempStaticLogo = NULL;
|
tempStaticLogo = NULL;
|
||||||
}
|
}
|
||||||
tempStaticLogo = CreateImage(geoManager.logoWidth, geoManager.logoHeight);
|
tempStaticLogo = CreateImage(geoManager.logoWidth * 0.8, geoManager.logoHeight * 0.8);
|
||||||
return tempStaticLogo;
|
return tempStaticLogo;
|
||||||
} else {
|
} else {
|
||||||
//add requested logo to cache
|
//add requested logo to cache
|
||||||
@ -609,7 +609,7 @@ bool cImageCache::LoadLogo(const cChannel *channel) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void cImageCache::InsertIntoLogoCache(std::string channelID) {
|
void cImageCache::InsertIntoLogoCache(std::string channelID) {
|
||||||
cImage *image = CreateImage(geoManager.logoWidth, geoManager.logoHeight);
|
cImage *image = CreateImage(geoManager.logoWidth * 0.8, geoManager.logoHeight * 0.8);
|
||||||
logoCache.insert(std::pair<std::string, cImage*>(channelID, image));
|
logoCache.insert(std::pair<std::string, cImage*>(channelID, image));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
3
view.c
3
view.c
@ -108,7 +108,8 @@ void cView::DrawHeader(void) {
|
|||||||
if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) {
|
if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) {
|
||||||
cImage logo = imgLoader.GetImage();
|
cImage logo = imgLoader.GetImage();
|
||||||
const int logoheight = logo.Height();
|
const int logoheight = logo.Height();
|
||||||
pixmapHeaderLogo->DrawImage(cPoint(border / 2, ((headerHeight - logoHeight) / 2 + (logoHeight - logoheight) / 2)), logo);
|
const int logowidth = logo.Width();
|
||||||
|
pixmapHeaderLogo->DrawImage(cPoint(xText + ((logoWidth - logowidth) / 2), ((headerHeight - logoheight) / 2)), logo);
|
||||||
xText += logoWidth + border / 2;
|
xText += logoWidth + border / 2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user