diff options
author | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-05-09 20:03:25 +0200 |
---|---|---|
committer | Martin Schirrmacher <vdr.skinflatplus@schirrmacher.eu> | 2014-05-09 20:03:25 +0200 |
commit | f43a6dbc80812511b8ab46f9199f58d454ba976f (patch) | |
tree | 26a09aa0f72dc42b1dacef1dd03757d3d2d40845 | |
parent | e8a3a94827dd62d73fae46d3d90eeb800546ad08 (diff) | |
download | skin-flatplus-f43a6dbc80812511b8ab46f9199f58d454ba976f.tar.gz skin-flatplus-f43a6dbc80812511b8ab46f9199f58d454ba976f.tar.bz2 |
parse tilde in timer menu in short view
-rw-r--r-- | HISTORY | 2 | ||||
-rw-r--r-- | displaymenu.c | 30 |
2 files changed, 29 insertions, 3 deletions
@@ -7,6 +7,7 @@ VDR Plugin 'skinflatplus' Revision History - [fix] recording menu with cutted recordings an % - [update] channel logo in wide format (like 3PO or Copperhead logos) - [update] complete rewrite multiline content +- [update] draw timer menu with a straight table - [add] show reruns in epg info (lent code from nopacity, thanks!) - [add] TVScraper support - show poster images of movies and series @@ -16,6 +17,7 @@ VDR Plugin 'skinflatplus' Revision History - [add] horizontal line and group icon in SetItemEvent for group channels - [add] new fnu_anthra_themes (thank You fnu/Frank) - [add] eventsview-flatplus.sql for epgd to prevent double information in epg-text, please see wiki for more information +- [add] parse tilde in timer menu and draw text after tilde with clrMenuItemExtraTextFont 2014-25-03: Version 0.2.1 - [fix] epgsearch progessbar in SetItemEvent, if epg start time is after now (2 minutes tolerance) diff --git a/displaymenu.c b/displaymenu.c index 8cf0bcc0..cef2d9a9 100644 --- a/displaymenu.c +++ b/displaymenu.c @@ -1167,7 +1167,7 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current menuPixmap->DrawText(cPoint(Left, Top), first.c_str(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem); int l = font->Width( first.c_str() ); - menuPixmap->DrawText(cPoint(Left + l, Top), first.c_str(), Theme.Color(clrMenuItemExtraTextFont), ColorBg, font, menuItemWidth - Left - l - marginItem); + menuPixmap->DrawText(cPoint(Left + l, Top), second.c_str(), Theme.Color(clrMenuItemExtraTextFont), ColorBg, font, menuItemWidth - Left - l - marginItem); } else if ( found2 != string::npos ) { std::string first = tilde.substr(0, found2); std::string second = tilde.substr(found2 +1, tilde.length() ); @@ -1175,7 +1175,7 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current menuPixmap->DrawText(cPoint(Left, Top), first.c_str(), ColorFg, ColorBg, font, menuItemWidth - Left - marginItem); int l = font->Width( first.c_str() ); l += font->Width("X"); - menuPixmap->DrawText(cPoint(Left + l, Top), first.c_str(), Theme.Color(clrMenuItemExtraTextFont), ColorBg, font, menuItemWidth - Left - l - marginItem); + menuPixmap->DrawText(cPoint(Left + l, Top), second.c_str(), Theme.Color(clrMenuItemExtraTextFont), ColorBg, font, menuItemWidth - Left - l - marginItem); } else menuPixmap->DrawText(cPoint(Left, Top), File, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem); } else { @@ -1187,7 +1187,31 @@ bool cFlatDisplayMenu::SetItemTimer(const cTimer *Timer, int Index, bool Current Timer->Start() / 100, Timer->Start() % 100, Timer->Stop() / 100, Timer->Stop() % 100); menuPixmap->DrawText(cPoint(Left, Top), buffer, ColorFg, ColorBg, font, menuItemWidth - Left - marginItem); - menuPixmap->DrawText(cPoint(Left, Top + fontHeight), File, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem); + + if( Config.MenuItemParseTilde ) { + std::string tilde = File; + size_t found = tilde.find(" ~ "); + size_t found2 = tilde.find("~"); + if( found != string::npos ) { + std::string first = tilde.substr(0, found); + std::string second = tilde.substr(found +2, tilde.length() ); + + menuPixmap->DrawText(cPoint(Left, Top + fontHeight), first.c_str(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem); + int l = fontSml->Width( first.c_str() ); + menuPixmap->DrawText(cPoint(Left + l, Top + fontHeight), second.c_str(), Theme.Color(clrMenuItemExtraTextFont), ColorBg, fontSml, menuItemWidth - Left - l - marginItem); + } else if ( found2 != string::npos ) { + std::string first = tilde.substr(0, found2); + std::string second = tilde.substr(found2 +1, tilde.length() ); + + menuPixmap->DrawText(cPoint(Left, Top + fontHeight), first.c_str(), ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem); + int l = fontSml->Width( first.c_str() ); + l += fontSml->Width("X"); + menuPixmap->DrawText(cPoint(Left + l, Top + fontHeight), second.c_str(), Theme.Color(clrMenuItemExtraTextFont), ColorBg, fontSml, menuItemWidth - Left - l - marginItem); + } else + menuPixmap->DrawText(cPoint(Left, Top + fontHeight), File, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem); + } else { + menuPixmap->DrawText(cPoint(Left, Top + fontHeight), File, ColorFg, ColorBg, fontSml, menuItemWidth - Left - marginItem); + } } sDecorBorder ib; |