From ae1bbd7cd08849d532cf7ff0fc8743c75b65291d Mon Sep 17 00:00:00 2001 From: Stefan Seyfried Date: Sun, 10 Mar 2013 00:04:23 +0100 Subject: [PATCH] bouquetlist: only show active buttons Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/d6260e38625b68862bc9604e551798e264592897 Author: Stefan Seyfried Date: 2013-03-10 (Sun, 10 Mar 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/bouquetlist.cpp | 7 ++++++- src/gui/bouquetlist.h | 2 ++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 23b9ab881..a810861e5 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -62,6 +62,7 @@ CBouquetList::CBouquetList(const char * const Name) frameBuffer = CFrameBuffer::getInstance(); selected = 0; liststart = 0; + favonly = false; if(Name == NULL) name = g_Locale->getText(LOCALE_BOUQUETLIST_HEAD); else @@ -325,6 +326,7 @@ int CBouquetList::show(bool bShowChannelList) int icol_w, icol_h; int w_max_text = 0; int w_max_icon = 0; + favonly = !bShowChannelList; for(unsigned int count = 0; count < sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]);count++){ int w_text = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_SMALL]->getRenderWidth(g_Locale->getText (CBouquetListButtons[count].locale),true); @@ -599,7 +601,10 @@ void CBouquetList::paint() frameBuffer->paintBoxRel(x, y+theight, width, height - theight - footerHeight, COL_MENUCONTENT_PLUS_0); - ::paintButtons(x, y + (height - footerHeight), width, sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]), CBouquetListButtons, width, footerHeight); + int numbuttons = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); + if (favonly) /* this actually shows favorites and providers button, but both are active anyway */ + numbuttons = 2; + ::paintButtons(x, y + (height - footerHeight), width, numbuttons, CBouquetListButtons, width, footerHeight); if(!Bouquets.empty()) { diff --git a/src/gui/bouquetlist.h b/src/gui/bouquetlist.h index 41e76a07b..bad5fd4f2 100644 --- a/src/gui/bouquetlist.h +++ b/src/gui/bouquetlist.h @@ -94,6 +94,8 @@ class CBouquetList int x; int y; + bool favonly; + void paintItem(int pos); void paint(); void paintHead();