From f68f9fed9573e856842e2f86039b09fa77e33afe Mon Sep 17 00:00:00 2001 From: seife Date: Sun, 31 Jan 2010 12:27:52 +0000 Subject: [PATCH] neutrino: allow to toggle the epgplus fontsize with the epg key git-svn-id: file:///home/bas/coolstream_public_svn/THIRDPARTY/applications/neutrino-experimental@234 e54a6e83-5905-42d5-8d5c-058d10e6a962 --- src/gui/epgplus.cpp | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index e7908792c..bc3641e84 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -90,6 +90,8 @@ static EpgPlus::SizeSetting sizeSettingTable[] = { {EpgPlus::EPGPlus_vergap2_width, 4}, }; +static bool bigfont = false; + Font *EpgPlus::Header::font = NULL; EpgPlus::Header::Header (CFrameBuffer * pframeBuffer, int px, int py, int pwidth) @@ -498,6 +500,7 @@ void EpgPlus::Footer::paintButtons (button_label * pbuttonLabels, int numberOfBu EpgPlus::EpgPlus () { + selectedChannelEntry = NULL; this->init (); } @@ -636,11 +639,16 @@ void EpgPlus::init () std::string FileName = std::string (g_settings.font_file); for (size_t i = 0; i < NumberOfFontSettings; ++i) { + int size = fontSettingTable[i].size; + if (bigfont && (fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelentry_font || + fontSettingTable[i].settingID == EpgPlus::EPGPlus_channelevententry_font)) { + size = size * 3 / 2; /* increase font size for channel name and event title */ + } std::string family = g_fontRenderer->getFamily (FileName.c_str ()); - Font *font = g_fontRenderer->getFont (family.c_str (), fontSettingTable[i].style, fontSettingTable[i].size); + Font *font = g_fontRenderer->getFont(family.c_str(), fontSettingTable[i].style, size); if (font == NULL) - font = g_fontRenderer->getFont (family.c_str (), "Regular", fontSettingTable[i].size); + font = g_fontRenderer->getFont(family.c_str(), "Regular", size); fonts[i] = font; } @@ -655,8 +663,6 @@ void EpgPlus::init () ChannelEventEntry::init (); Footer::init (); - this->selectedChannelEntry = NULL; - channelsTableWidth = sizes[EPGPlus_channelentry_width]; sliderWidth = sizes[EPGPlus_slider_width]; @@ -787,6 +793,15 @@ int EpgPlus::exec (CChannelList * pchannelList, int selectedChannelIndex, CBouqu if (msg <= CRCInput::RC_MaxRC) timeoutEnd = CRCInput::calcTimeoutEnd (g_settings.timing[SNeutrinoSettings::TIMING_CHANLIST]); + if (msg == CRCInput::RC_epg) { + //fprintf(stderr, "RC_Epg, bigfont = %d\n", bigfont); + hide(); + bigfont = !bigfont; + free(); + init(); + refreshAll = true; + break; + } if ((msg == CRCInput::RC_page_down) || (msg == CRCInput::RC_yellow)) { switch (this->currentSwapMode) { case SwapMode_ByPage: