mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
				synced 2023-10-05 13:01:48 +00: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:
		
							
								
								
									
										10
									
								
								headergrid.c
									
									
									
									
									
								
							
							
						
						
									
										10
									
								
								headergrid.c
									
									
									
									
									
								
							| @@ -56,7 +56,8 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) { | ||||
|         cImage *logo = imgCache.GetLogo(channel); | ||||
|         if (logo) { | ||||
|             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; | ||||
|         } | ||||
|     } | ||||
| @@ -81,7 +82,6 @@ void cHeaderGrid::drawChannelHorizontal(const cChannel *channel) { | ||||
| // Draw Channel vertical view | ||||
|  | ||||
| void cHeaderGrid::drawChannelVertical(const cChannel *channel) { | ||||
|     int logoWidth = geoManager.logoWidth; | ||||
|     int logoHeight = geoManager.logoHeight; | ||||
|     cTextWrapper tw; | ||||
|     cString headerText = cString::sprintf("%d - %s", channel->Number(), channel->Name()); | ||||
| @@ -93,8 +93,10 @@ void cHeaderGrid::drawChannelVertical(const cChannel *channel) { | ||||
|     if (!config.hideChannelLogos) { | ||||
|         cImage *logo = imgCache.GetLogo(channel); | ||||
|         if (logo) { | ||||
|                 pixmapLogo->DrawImage(cPoint((Width() - logoWidth) / 2, 6), *logo); | ||||
|                 logoFound = true; | ||||
|             const int logoheight = logo->Height(); | ||||
|             const int logowidth = logo->Width(); | ||||
|             pixmapLogo->DrawImage(cPoint((Width() - logowidth) / 2, (logoHeight - logoheight) / 2), *logo); | ||||
|             logoFound = true; | ||||
|         } | ||||
|     } | ||||
|     bool drawText = false; | ||||
|   | ||||
| @@ -357,7 +357,7 @@ cImage *cImageCache::GetLogo(const cChannel *channel) { | ||||
|                     delete tempStaticLogo; | ||||
|                     tempStaticLogo = NULL; | ||||
|                 } | ||||
|                 tempStaticLogo = CreateImage(geoManager.logoWidth, geoManager.logoHeight); | ||||
|                 tempStaticLogo = CreateImage(geoManager.logoWidth * 0.8, geoManager.logoHeight * 0.8); | ||||
|                 return tempStaticLogo; | ||||
|             } else { | ||||
|             //add requested logo to cache | ||||
| @@ -609,7 +609,7 @@ bool cImageCache::LoadLogo(const cChannel *channel) { | ||||
| } | ||||
|  | ||||
| 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)); | ||||
| } | ||||
|  | ||||
|   | ||||
							
								
								
									
										3
									
								
								view.c
									
									
									
									
									
								
							
							
						
						
									
										3
									
								
								view.c
									
									
									
									
									
								
							| @@ -108,7 +108,8 @@ void cView::DrawHeader(void) { | ||||
|         if (imgLoader.LoadLogo(channel, logoWidth, logoHeight)) { | ||||
|             cImage logo = imgLoader.GetImage(); | ||||
|             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; | ||||
|         } | ||||
|     } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user