summaryrefslogtreecommitdiff
path: root/menuitem.c
diff options
context:
space:
mode:
authorlouis <louis.braun@gmx.de>2013-01-12 17:58:59 +0100
committerlouis <louis.braun@gmx.de>2013-01-12 17:58:59 +0100
commitd0837be96f032dec191fb56a28f6376efc4dbc4c (patch)
tree58ba57a81a609f14211de42ca6833690e4782e64 /menuitem.c
parentf73517cef1405ad496dda3cd30838f637cd64524 (diff)
downloadskin-nopacity-d0837be96f032dec191fb56a28f6376efc4dbc4c.tar.gz
skin-nopacity-d0837be96f032dec191fb56a28f6376efc4dbc4c.tar.bz2
Added some more information (encrypted, source, transponder, frequency) to channels menu
Diffstat (limited to 'menuitem.c')
-rw-r--r--menuitem.c31
1 files changed, 27 insertions, 4 deletions
diff --git a/menuitem.c b/menuitem.c
index dc05670..89ecc60 100644
--- a/menuitem.c
+++ b/menuitem.c
@@ -519,6 +519,12 @@ void cNopacityChannelMenuItem::CreatePixmapTextScroller(int totalWidth) {
void cNopacityChannelMenuItem::CreateText() {
strEntry = Channel->Name();
+ const cSource *source = Sources.Get(Channel->Source());
+ if (source)
+ strChannelSource = cString::sprintf("%s - %s", *cSource::ToString(source->Code()), source->Description());
+ else
+ strChannelSource = "";
+ strChannelInfo = cString::sprintf("%s %d, %d MHz", tr("Transp."), Channel->Transponder(), Channel->Frequency());
}
int cNopacityChannelMenuItem::CheckScrollable(bool hasIcon) {
@@ -538,13 +544,31 @@ 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 - font->Height())/2), strEntryFull.c_str(), clrFont, clrTransparent, font);
+ pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntryFull.c_str(), clrFont, clrTransparent, font);
}
void cNopacityChannelMenuItem::SetTextShort(void) {
tColor clrFont = (current)?Theme.Color(clrMenuFontMenuItemHigh):Theme.Color(clrMenuFontMenuItem);
pixmapTextScroller->Fill(clrTransparent);
- pixmapTextScroller->DrawText(cPoint(5, (height - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font);
+ pixmapTextScroller->DrawText(cPoint(5, (height/2 - font->Height())/2), strEntry.c_str(), clrFont, clrTransparent, font);
+}
+
+void cNopacityChannelMenuItem::DrawBackground(int handleBackground) {
+ pixmap->Fill(Theme.Color(clrMenuBorder));
+ pixmap->DrawImage(cPoint(1, 1), handleBackground);
+
+ int encryptedSize = height/4-2;
+ int sourceX = config.menuItemLogoWidth + 15;
+
+ pixmap->DrawText(cPoint(sourceX, 3*height/4 + (height/4 - fontSmall->Height())/2), *strChannelInfo, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall);
+ if (Channel->Ca()) {
+ cImageLoader imgLoader;
+ if (imgLoader.LoadIcon("encrypted", encryptedSize)) {
+ pixmapIcon->DrawImage(cPoint(sourceX, height/2+1), imgLoader.GetImage());
+ sourceX += encryptedSize + 10;
+ }
+ }
+ pixmap->DrawText(cPoint(sourceX, height/2 + (height/4 - fontSmall->Height())/2), *strChannelSource, Theme.Color(clrMenuFontMenuItem), clrTransparent, fontSmall);
}
void cNopacityChannelMenuItem::Render() {
@@ -552,10 +576,9 @@ void cNopacityChannelMenuItem::Render() {
int handleBgrd = (current)?handleBackgrounds[5]:handleBackgrounds[4];
if (selectable) { //Channels
- pixmap->Fill(Theme.Color(clrMenuBorder));
+ DrawBackground(handleBgrd);
int logoWidth = config.menuItemLogoWidth;
int logoHeight = config.menuItemLogoHeight;
- pixmap->DrawImage(cPoint(1, 1), handleBgrd);
if (!drawn) {
cImageLoader imgLoader;
if (imgLoader.LoadLogo(Channel->Name(), logoWidth, logoHeight)) {