diff options
author | louis <louis.braun@gmx.de> | 2013-01-05 17:57:29 +0100 |
---|---|---|
committer | louis <louis.braun@gmx.de> | 2013-01-05 17:57:29 +0100 |
commit | 52867d5436198d9f9e8d020b1bfb4037450e60ea (patch) | |
tree | 55c70bf38f8d82889046d54285be3c2a1a319488 /menuitem.c | |
parent | a4201ae9e8ddb33a3644d049b64ea8de04bb2ce1 (diff) | |
download | skin-nopacity-52867d5436198d9f9e8d020b1bfb4037450e60ea.tar.gz skin-nopacity-52867d5436198d9f9e8d020b1bfb4037450e60ea.tar.bz2 |
Added Separator Items for Schedule Menus
Diffstat (limited to 'menuitem.c')
-rw-r--r-- | menuitem.c | 16 |
1 files changed, 11 insertions, 5 deletions
@@ -3,7 +3,6 @@ #include <sstream> #include <algorithm> - // cNopacityMenuItem ------------- cNopacityMenuItem::cNopacityMenuItem(cOsd *osd, const char *text, bool sel) { @@ -95,7 +94,12 @@ void cNopacityMenuItem::DrawDelimiter(const char *del, const char *icon, int han drawn = true; } std::string delimiter = del; - delimiter.erase(delimiter.find_last_not_of("-")+1); + try { + if (delimiter.find_first_not_of("-") > 0) + delimiter.erase(0, delimiter.find_first_not_of("-")+1); + if (delimiter.find_last_not_of("-") != std::string::npos) + delimiter.erase(delimiter.find_last_not_of("-")+1); + } catch (...) {} int x = config.iconHeight + 3; int y = (height - font->Height()) / 2; pixmap->DrawText(cPoint(x, y), delimiter.c_str(), Theme.Color(clrMenuFontMenuItemSep), clrTransparent, font); @@ -425,9 +429,11 @@ void cNopacityScheduleMenuItem::Render() { infoTextWindow->Start(); } } else { - int handleBgrd = (current)?handleBackgrounds[5]:handleBackgrounds[4]; - pixmap->Fill(Theme.Color(clrMenuBorder)); - pixmap->DrawImage(cPoint(1, 1), handleBgrd); + if (Event) { + DrawDelimiter(Event->Title(), "daydelimiter", handleBackgrounds[4]); + } else if (Channel) { + DrawDelimiter(Channel->Name(), "Channelseparator", handleBackgrounds[4]); + } } } |