mirror of
				https://projects.vdr-developer.org/git/vdr-plugin-tvguide.git
				synced 2023-10-05 13:01:48 +00:00 
			
		
		
		
	Show inactive timer
This commit is contained in:
		
							
								
								
									
										28
									
								
								epggrid.c
									
									
									
									
									
								
							
							
						
						
									
										28
									
								
								epggrid.c
									
									
									
									
									
								
							| @@ -33,7 +33,6 @@ void cEpgGrid::SetViewportHeight() { | |||||||
| } | } | ||||||
|  |  | ||||||
| void cEpgGrid::PositionPixmap() { | void cEpgGrid::PositionPixmap() { | ||||||
|     int x0, y0; |  | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (tvguideConfig.displayMode == eVertical) { | ||||||
|         int x0 = column->getX(); |         int x0 = column->getX(); | ||||||
|         int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; |         int y0 = geoManager.statusHeaderHeight + geoManager.channelHeaderHeight + geoManager.channelGroupsHeight; | ||||||
| @@ -70,8 +69,13 @@ void cEpgGrid::SetTimer() { | |||||||
|             hasTimer = true; |             hasTimer = true; | ||||||
| 	else | 	else | ||||||
| 	    hasTimer = false; | 	    hasTimer = false; | ||||||
|  | #if VDRVERSNUM >= 20301 | ||||||
|  |     } else if (event->HasTimer()) { | ||||||
|  |         hasTimer = true; | ||||||
|  | #else | ||||||
|     } else if (column->HasTimer()) { |     } else if (column->HasTimer()) { | ||||||
|         hasTimer = event->HasTimer(); |         hasTimer = event->HasTimer(); | ||||||
|  | #endif | ||||||
|     } else { |     } else { | ||||||
|         hasTimer = false; |         hasTimer = false; | ||||||
|     } |     } | ||||||
| @@ -105,6 +109,16 @@ void cEpgGrid::drawText() { | |||||||
|         colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack); |         colorTextBack = (active)?theme.Color(clrGridActiveFontBack):theme.Color(clrGridFontBack); | ||||||
|     else |     else | ||||||
|         colorTextBack = clrTransparent; |         colorTextBack = clrTransparent; | ||||||
|  | /*    if (hasSwitchTimer) | ||||||
|  |        colorTextBack = theme.Color(clrButtonYellow); | ||||||
|  |     if (hasTimer) { | ||||||
|  |        LOCK_TIMERS_READ; | ||||||
|  |        timer = Timers->GetMatch(event); | ||||||
|  |        if (timer && timer->HasFlags(tfActive)) | ||||||
|  |           colorTextBack = theme.Color(clrButtonRed); | ||||||
|  |        else | ||||||
|  |           colorTextBack = theme.Color(clrButtonGreen); | ||||||
|  |        }*/ | ||||||
|     if (tvguideConfig.displayMode == eVertical) { |     if (tvguideConfig.displayMode == eVertical) { | ||||||
|         if (Height()/geoManager.minutePixel < 6) |         if (Height()/geoManager.minutePixel < 6) | ||||||
|             return; |             return; | ||||||
| @@ -139,8 +153,16 @@ void cEpgGrid::drawText() { | |||||||
|     } |     } | ||||||
|     if (hasSwitchTimer)  |     if (hasSwitchTimer)  | ||||||
|         drawIcon("Switch", theme.Color(clrButtonYellow)); |         drawIcon("Switch", theme.Color(clrButtonYellow)); | ||||||
|     if (hasTimer)  |     if (hasTimer) { | ||||||
|         drawIcon("REC", theme.Color(clrButtonRed)); |         const cTimer *timer = NULL; | ||||||
|  |         LOCK_TIMERS_READ; | ||||||
|  |         timer = Timers->GetMatch(event); | ||||||
|  |         if (timer) | ||||||
|  |            if (timer->HasFlags(tfActive)) | ||||||
|  |               drawIcon("REC", theme.Color(clrButtonRed)); | ||||||
|  |            else | ||||||
|  |               drawIcon("REC", theme.Color(clrButtonGreen)); | ||||||
|  |         } | ||||||
| } | } | ||||||
|  |  | ||||||
| void cEpgGrid::drawIcon(cString iconText, tColor color) { | void cEpgGrid::drawIcon(cString iconText, tColor color) { | ||||||
|   | |||||||
| @@ -8,6 +8,7 @@ | |||||||
|  |  | ||||||
| class cEpgGrid : public cGrid { | class cEpgGrid : public cGrid { | ||||||
| private: | private: | ||||||
|  |     const cTimer *timer; | ||||||
|     const cEvent *event; |     const cEvent *event; | ||||||
|     cTextWrapper *extText; |     cTextWrapper *extText; | ||||||
|     cString timeString; |     cString timeString; | ||||||
| @@ -29,4 +30,4 @@ public: | |||||||
|     void debug(); |     void debug(); | ||||||
| }; | }; | ||||||
|  |  | ||||||
| #endif //__TVGUIDE_EPGGRID_H | #endif //__TVGUIDE_EPGGRID_H | ||||||
|   | |||||||
		Reference in New Issue
	
	Block a user