summaryrefslogtreecommitdiff
path: root/menuitem.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-09-09 17:30:32 +0200
committerlouis <louis.braun@gmx.de>2013-09-09 17:30:32 +0200
commit58cd765519e4f0c8d07a048521282dd72db8448f (patch)
tree4a692f2557bab5ab29ff8b39fca079e95f20f0ee /menuitem.c
parentec3e7d3688b83c611a01ec16a2ef0f13d51e2e68 (diff)
downloadskin-nopacity-58cd765519e4f0c8d07a048521282dd72db8448f.tar.gz
skin-nopacity-58cd765519e4f0c8d07a048521282dd72db8448f.tar.bz2
Added option to display plain channels and EPG information without time in channels menu (closes Feature 1377)
Diffstat (limited to 'menuitem.c')
-rw-r--r--menuitem.c51
1 files changed, 45 insertions, 6 deletions
diff --git a/menuitem.c b/menuitem.c
index 7851d54..1516481 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -563,6 +563,13 @@ void cNopacityScheduleMenuItem::DrawRemaining(int x, int y, int width) {
cNopacityChannelMenuItem::cNopacityChannelMenuItem(cOsd *osd, const cChannel *Channel, bool sel, cRect *vidWin) : cNopacityMenuItem (osd, "", sel) {
this->Channel = Channel;
this->vidWin = vidWin;
+ strEntry = "";
+ strEntryFull = "";
+ strChannelSource = "";
+ strChannelInfo = "";
+ strEpgInfo = "";
+ strEpgInfoFull = "";
+ strTimeInfo = "";
}
cNopacityChannelMenuItem::~cNopacityChannelMenuItem(void) {
@@ -617,20 +624,52 @@ int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) {
void cNopacityChannelMenuItem::SetTextFull(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
- pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntryFull.c_str(), clrFont, clrTransparent, font);
+ int heightChannelName = 0;
+ if (config.menuChannelDisplayMode == 2) {
+ heightChannelName = (height - font->Height())/2;
+ } else {
+ heightChannelName = (height/2 - font->Height())/2;
+ }
+ pixmapTextScroller->DrawText(cPoint(5, heightChannelName), strEntryFull.c_str(), clrFont, clrTransparent, font);
if (config.menuChannelDisplayMode == 1) {
- pixmapTextScroller->DrawText(cPoint(5, height/2 + (height/4 - fontSmall->Height())/2), strTimeInfo.c_str(), clrFont, clrTransparent, fontSmall);
- pixmapTextScroller->DrawText(cPoint(5, 3*height/4 + (height/4 - fontSmall->Height())/2), strEpgInfoFull.c_str(), clrFont, clrTransparent, fontSmall);
+ int heightTimeInfo = 0;
+ int heightEPGInfo = 0;
+ if (config.menuChannelDisplayTime) {
+ heightTimeInfo = height/2 + (height/4 - fontSmall->Height())/2;
+ heightEPGInfo = 3*height/4 + (height/4 - fontSmall->Height())/2;
+ } else {
+ heightEPGInfo = height/2 + (height/4 - fontSmall->Height())/2;
+ }
+ if (config.menuChannelDisplayTime) {
+ pixmapTextScroller->DrawText(cPoint(5, heightTimeInfo), strTimeInfo.c_str(), clrFont, clrTransparent, fontSmall);
+ }
+ pixmapTextScroller->DrawText(cPoint(5, heightEPGInfo), strEpgInfoFull.c_str(), clrFont, clrTransparent, fontSmall);
}
}
void cNopacityChannelMenuItem::SetTextShort(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
- pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font);
+ int heightChannelName = 0;
+ if (config.menuChannelDisplayMode == 2) {
+ heightChannelName = (height - font->Height())/2;
+ } else {
+ heightChannelName = (height/2 - font->Height())/2;
+ }
+ pixmapTextScroller->DrawText(cPoint(5, heightChannelName), strEntry.c_str(), clrFont, clrTransparent, font);
if (config.menuChannelDisplayMode == 1) {
- pixmapTextScroller->DrawText(cPoint(5, height/2 + (height/4 - fontSmall->Height())/2), strTimeInfo.c_str(), clrFont, clrTransparent, fontSmall);
- pixmapTextScroller->DrawText(cPoint(5, 3*height/4 + (height/4 - fontSmall->Height())/2), strEpgInfo.c_str(), clrFont, clrTransparent, fontSmall);
+ int heightTimeInfo = 0;
+ int heightEPGInfo = 0;
+ if (config.menuChannelDisplayTime) {
+ heightTimeInfo = height/2 + (height/4 - fontSmall->Height())/2;
+ heightEPGInfo = 3*height/4 + (height/4 - fontSmall->Height())/2;
+ } else {
+ heightEPGInfo = height/2 + (height/4 - fontSmall->Height())/2;
+ }
+ if (config.menuChannelDisplayTime) {
+ pixmapTextScroller->DrawText(cPoint(5, heightTimeInfo), strTimeInfo.c_str(), clrFont, clrTransparent, fontSmall);
+ }
+ pixmapTextScroller->DrawText(cPoint(5, heightEPGInfo), strEpgInfo.c_str(), clrFont, clrTransparent, fontSmall);
}
}