From 0bc31c6397e0a76afbdde9715497bab210bdf40e Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Sun, 18 Jun 2017 21:43:34 +0200 Subject: [PATCH 01/16] try to fix versio check for ffmpeg --- src/driver/audiodec/ffmpegdec.cpp | 8 ++++---- src/driver/record.cpp | 6 +++--- src/driver/streamts.cpp | 4 ++-- 3 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/driver/audiodec/ffmpegdec.cpp b/src/driver/audiodec/ffmpegdec.cpp index dc49aea02..19c48a9eb 100644 --- a/src/driver/audiodec/ffmpegdec.cpp +++ b/src/driver/audiodec/ffmpegdec.cpp @@ -223,7 +223,7 @@ CBaseDec::RetCode CFfmpegDec::Decoder(FILE *_in, int /*OutputFd*/, State* state, Status=DATA_ERR; return Status; } -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext *c = avc->streams[best_stream]->codec; #else AVCodecContext *c = avcodec_alloc_context3(codec); @@ -460,7 +460,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) if (!is_stream) { GetMeta(avc->metadata); for(unsigned int i = 0; i < avc->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) if (avc->streams[i]->codec->codec_type == AVMEDIA_TYPE_AUDIO) #else if (avc->streams[i]->codecpar->codec_type == AVMEDIA_TYPE_AUDIO) @@ -481,7 +481,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) DeInit(); return false; } -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) if (!codec) codec = avcodec_find_decoder(avc->streams[best_stream]->codec->codec_id); samplerate = avc->streams[best_stream]->codec->sample_rate; @@ -511,7 +511,7 @@ bool CFfmpegDec::SetMetaData(FILE *_in, CAudioMetaData* m, bool save_cover) printf("CFfmpegDec: format %s (%s) duration %ld\n", avc->iformat->name, type_info.c_str(), total_time); for(unsigned int i = 0; i < avc->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) if (avc->streams[i]->codec->bit_rate > 0) bitrate += avc->streams[i]->codec->bit_rate; #else diff --git a/src/driver/record.cpp b/src/driver/record.cpp index ace7de81e..83d9bd6a4 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1943,7 +1943,7 @@ void CStreamRec::FillMovieInfo(CZapitChannel * /*channel*/, APIDList & /*apid_li for (unsigned i = 0; i < ofcx->nb_streams; i++) { AVStream *st = ofcx->streams[i]; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext * codec = st->codec; #else AVCodecParameters * codec = st->codecpar; @@ -2176,7 +2176,7 @@ bool CStreamRec::Open(CZapitChannel * channel) stream_index = -1; int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -2232,7 +2232,7 @@ void CStreamRec::run() break; if (pkt.stream_index < 0) continue; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; diff --git a/src/driver/streamts.cpp b/src/driver/streamts.cpp index ee9438cce..79da7d7f0 100644 --- a/src/driver/streamts.cpp +++ b/src/driver/streamts.cpp @@ -850,7 +850,7 @@ bool CStreamStream::Open() av_dict_copy(&ofcx->metadata, ifcx->metadata, 0); int stid = 0x200; for (unsigned i = 0; i < ifcx->nb_streams; i++) { -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext * iccx = ifcx->streams[i]->codec; AVStream *ost = avformat_new_stream(ofcx, iccx->codec); avcodec_copy_context(ost->codec, iccx); @@ -923,7 +923,7 @@ void CStreamStream::run() if (pkt.stream_index < 0) continue; -#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,5,0 )) +#if (LIBAVFORMAT_VERSION_INT < AV_VERSION_INT( 57,25,101 )) AVCodecContext *codec = ifcx->streams[pkt.stream_index]->codec; #else AVCodecParameters *codec = ifcx->streams[pkt.stream_index]->codecpar; From ac46bb04929e596479df90e1bd4dffa1f5aef52a Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 18 Jun 2017 15:06:11 +0200 Subject: [PATCH 02/16] -progresswindow: fix progressbar if both bars have the same value (thx dbo) --- src/gui/widget/progresswindow.cpp | 16 +++++++--------- src/gui/widget/progresswindow.h | 1 - 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 68b416439..d1e0ae642 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -79,7 +79,7 @@ void CProgressWindow::Init( signal *statusSignal, if (globalSignal) *globalSignal->connect(mem_fun(*this, &CProgressWindow::showGlobalStatus)); - global_progress = local_progress = percent_progress = 0; + global_progress = local_progress = 0; showFooter(false); @@ -131,15 +131,13 @@ void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max { pBar->allowPaint(true); unsigned int cur_perc = prog*100/(max+1); - if (percent_progress != cur_perc || prog == 0){ - pBar->setValues(prog, (int)max); - if (!statusText.empty() && (cur_statusText != statusText)){ - showStatusMessageUTF(statusText); - cur_statusText = statusText; - } - pBar->paint(false); - percent_progress = cur_perc; + pBar->setValues(prog, (int)max); + if (!statusText.empty() && (cur_statusText != statusText)){ + showStatusMessageUTF(statusText); + cur_statusText = statusText; } + pBar->paint(false); + frameBuffer->blit(); } void CProgressWindow::showStatus(const unsigned int prog, const unsigned int max, const string &statusText) diff --git a/src/gui/widget/progresswindow.h b/src/gui/widget/progresswindow.h index 1be4255a9..da88911f3 100644 --- a/src/gui/widget/progresswindow.h +++ b/src/gui/widget/progresswindow.h @@ -39,7 +39,6 @@ class CProgressWindow : public CComponentsWindow, public CMenuTarget unsigned int global_progress; unsigned int local_progress; - unsigned int percent_progress; std::string cur_statusText; int h_height; void Init( sigc::signal *statusSignal, From 64396a1c5e9b831b13a6c252e9cd1cb2aa87c67c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 20 Jun 2017 09:54:52 +0200 Subject: [PATCH 03/16] CProgressWindow: remove unused variable fix for possible compiler error with -Werror=unused-variable --- src/gui/widget/progresswindow.cpp | 1 - 1 file changed, 1 deletion(-) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index d1e0ae642..983ff2aac 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -130,7 +130,6 @@ CProgressBar* CProgressWindow::getProgressItem() void CProgressWindow::initStatus(const unsigned int prog, const unsigned int max, const string &statusText, CProgressBar *pBar) { pBar->allowPaint(true); - unsigned int cur_perc = prog*100/(max+1); pBar->setValues(prog, (int)max); if (!statusText.empty() && (cur_statusText != statusText)){ showStatusMessageUTF(statusText); From cd6c123e561e569b7626202f3764cf1f347639ef Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 18 Jun 2017 23:27:45 +0200 Subject: [PATCH 04/16] - audioplayer: minor format changes in title box Signed-off-by: Thilo Graf --- src/gui/audioplayer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 1434f822c..2bf432701 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1730,13 +1730,13 @@ void CAudioPlayerGui::paintTitleBox() else if (g_settings.audioplayer_display == TITLE_ARTIST) { tmp = m_curr_audiofile.MetaData.title; - tmp += " / "; + tmp += " - "; tmp += m_curr_audiofile.MetaData.artist; } else //if (g_settings.audioplayer_display == ARTIST_TITLE) { tmp = m_curr_audiofile.MetaData.artist; - tmp += " / "; + tmp += " - "; tmp += m_curr_audiofile.MetaData.title; } w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(tmp); From c1460ef90515ab991cc3183e55d61b3ce06f2670 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Sun, 18 Jun 2017 23:54:43 +0200 Subject: [PATCH 05/16] - audioplayer: don't show not recognized bitrates Signed-off-by: Thilo Graf --- src/gui/audioplayer.cpp | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 2bf432701..cdfd4eb28 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1577,9 +1577,12 @@ void CAudioPlayerGui::paintItem(int pos) std::string tmp = sNr; getFileInfoToDisplay(tmp, m_playlist[currpos]); - char dura[9]; + char dura[9] = {0}; if (m_inetmode) - snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); + { + if (m_playlist[currpos].MetaData.total_time != 0) + snprintf(dura, 8, "%ldk", m_playlist[currpos].MetaData.total_time); + } else snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60); @@ -2070,7 +2073,7 @@ void CAudioPlayerGui::updateMetaData() paintCover(); } if (CAudioPlayer::getInstance()->hasMetaDataChanged() != 0) - updateLcd = true; + updateLcd = true; //printf("CAudioPlayerGui::updateMetaData: updateLcd %d\n", updateLcd); if (updateLcd) From 37e5f8032e07108ebf3f82b9a08a99cd9f286c70 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 09:33:11 +0200 Subject: [PATCH 06/16] - audioplayer: add shadow to gui-elements Signed-off-by: Thilo Graf --- src/gui/audioplayer.cpp | 29 ++++++++++++++++++++--------- 1 file changed, 20 insertions(+), 9 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index cdfd4eb28..0cc052a6f 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -297,8 +297,8 @@ int CAudioPlayerGui::exec(CMenuTarget* parent, const std::string &actionKey) m_info_height = 2*OFFSET_INNER_SMALL + 2*g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); m_button_height = ::paintButtons(AudioPlayerButtons[0], 4, 0, 0, 0, 0, 0, false, NULL, NULL); - m_listmaxshow = (m_height - m_title_height - OFFSET_INTER - m_header_height - 2*m_button_height - OFFSET_INTER - m_info_height) / (m_item_height); - m_height = m_title_height + OFFSET_INTER + m_header_height + m_listmaxshow*m_item_height + 2*m_button_height + OFFSET_INTER + m_info_height; // recalc height + m_listmaxshow = (m_height - m_title_height - OFFSET_SHADOW - OFFSET_INTER - m_header_height - 2*m_button_height - OFFSET_SHADOW - OFFSET_INTER - m_info_height - OFFSET_SHADOW) / (m_item_height); + m_height = m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + m_listmaxshow*m_item_height + 2*m_button_height + OFFSET_SHADOW + OFFSET_INTER + m_info_height + OFFSET_SHADOW; // recalc height m_x = getScreenStartX(m_width); if (m_x < DETAILSLINE_WIDTH) @@ -1547,7 +1547,7 @@ void CAudioPlayerGui::paintItem(int pos) if (!m_show_playlist) return; - int ypos = m_y + m_title_height + OFFSET_INTER + m_header_height + pos*m_item_height; + int ypos = m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + pos*m_item_height; unsigned int currpos = m_liststart + pos; bool i_selected = currpos == m_selected; @@ -1602,7 +1602,8 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.setCorner(RADIUS_MID, CORNER_TOP); if (m_inetmode) @@ -1628,7 +1629,10 @@ void CAudioPlayerGui::paintFoot() { NEUTRINO_ICON_BUTTON_INFO, LOCALE_PICTUREVIEWER_HEAD } }; - int button_y = m_y + m_height - m_info_height - OFFSET_INTER - 2*m_button_height; + int button_y = m_y + m_height - OFFSET_SHADOW - m_info_height - OFFSET_INTER - OFFSET_SHADOW - 2*m_button_height; + + // shadow + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, button_y + OFFSET_SHADOW, m_width, 2*m_button_height, COL_SHADOW_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); m_frameBuffer->paintBoxRel(m_x, button_y, m_width, 2*m_button_height, COL_MENUFOOT_PLUS_0, RADIUS_MID, (m_show_playlist ? CORNER_BOTTOM : CORNER_ALL)); @@ -1696,6 +1700,9 @@ void CAudioPlayerGui::paintTitleBox() m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_title_height); else { + // shadow + m_frameBuffer->paintBoxRel(m_x + OFFSET_SHADOW, m_y + OFFSET_SHADOW, m_width, m_title_height, COL_SHADOW_PLUS_0, RADIUS_MID); + m_frameBuffer->paintBoxRel(m_x, m_y, m_width, m_title_height, COL_MENUHEAD_PLUS_0, RADIUS_MID); m_frameBuffer->paintBoxFrame(m_x, m_y, m_width, m_title_height, OFFSET_INNER_MIN, COL_FRAME_PLUS_0, RADIUS_MID); @@ -1770,12 +1777,15 @@ void CAudioPlayerGui::paint() for (unsigned int count=0; countpaintBoxRel(m_x + m_width, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + OFFSET_SHADOW, OFFSET_SHADOW, m_item_height*m_listmaxshow, COL_SHADOW_PLUS_0); } paintTitleBox(); @@ -1791,8 +1801,8 @@ void CAudioPlayerGui::clearDetailsLine() void CAudioPlayerGui::paintDetailsLine(int pos) { int xpos = m_x - DETAILSLINE_WIDTH; - int ypos1 = m_y + m_title_height + OFFSET_INTER + m_header_height + pos*m_item_height; - int ypos2 = m_y + (m_height - m_info_height); + int ypos1 = m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + pos*m_item_height; + int ypos2 = m_y + (m_height - OFFSET_SHADOW - m_info_height); int ypos1a = ypos1 + (m_item_height / 2); int ypos2a = ypos2 + (m_info_height / 2); @@ -1819,6 +1829,7 @@ void CAudioPlayerGui::paintDetailsLine(int pos) m_infobox->setCorner(RADIUS_LARGE); m_infobox->setColorFrame(COL_FRAME_PLUS_0); m_infobox->setColorBody(COL_MENUCONTENTDARK_PLUS_0); + m_infobox->enableShadow(CC_SHADOW_ON, -1, true); m_infobox->forceTextPaint(false); } From 26d1cb31fa9c3743d27e418dacc16024971d2146 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 07/16] - pictureviewer: add shadow to gui-elements Signed-off-by: Thilo Graf --- src/gui/pictureviewer.cpp | 21 +++++++++++++++------ 1 file changed, 15 insertions(+), 6 deletions(-) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 50d9a7086..2cdd04039 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -170,8 +170,8 @@ int CPictureViewerGui::exec(CMenuTarget* parent, const std::string & actionKey) buttons2_height = ::paintButtons(0, 0, 0, PictureViewerButtons2Count, PictureViewerButtons2, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); footer_height = buttons1_height + buttons2_height; - listmaxshow = (height - header_height - footer_height)/item_height; - height = header_height + listmaxshow*item_height + footer_height; // recalc height + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW)/item_height; + height = header_height + listmaxshow*item_height + footer_height + OFFSET_SHADOW; // recalc height x=getScreenStartX(width); y=getScreenStartY(height); @@ -702,6 +702,7 @@ void CPictureViewerGui::paintItem(int pos) void CPictureViewerGui::paintHead() { CComponentsHeaderLocalized header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeaderLocalized::CC_BTN_HELP); + header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); #ifdef ENABLE_GUI_MOUNT header.setContextButton(NEUTRINO_ICON_BUTTON_MENU); @@ -719,15 +720,20 @@ void CPictureViewerGui::paintFoot() else PictureViewerButtons2[0].locale = LOCALE_PICTUREVIEWER_SORTORDER_DATE; - frameBuffer->paintBoxRel(x, y + (height - footer_height), width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + int footer_y = y + (height - footer_height - OFFSET_SHADOW); + + // shadow + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, footer_y + OFFSET_SHADOW, width, footer_height, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + + frameBuffer->paintBoxRel(x, footer_y, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); if (!playlist.empty()) { - ::paintButtons(x, y + (height - footer_height), 0, PictureViewerButtons1Count, PictureViewerButtons1, width); - ::paintButtons(x, y + (height - buttons2_height), 0, PictureViewerButtons2Count, PictureViewerButtons2, width); + ::paintButtons(x, footer_y, width, PictureViewerButtons1Count, PictureViewerButtons1, width, buttons1_height); + ::paintButtons(x, footer_y + buttons1_height, width, PictureViewerButtons2Count, PictureViewerButtons2, width, buttons2_height); } else - ::paintButtons(x, y + (height - footer_height), 0, 1, &(PictureViewerButtons1[1]), width); + ::paintButtons(x, footer_y, width, 1, &(PictureViewerButtons1[1]), width, buttons1_height); } //------------------------------------------------------------------------ @@ -755,6 +761,9 @@ void CPictureViewerGui::paint() paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + // shadow + frameBuffer->paintBoxRel(x + width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); + paintFoot(); paintInfo(); From cc42ee1e42ab2a9e2e6ccaada8a6caea272f5890 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 08/16] - audioplayer: fix coordinates in hide() function Signed-off-by: Thilo Graf --- src/gui/audioplayer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 0cc052a6f..abbab66c8 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1537,7 +1537,7 @@ void CAudioPlayerGui::hide() if (m_visible) { clearDetailsLine(); - m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width, m_height); + m_frameBuffer->paintBackgroundBoxRel(m_x, m_y, m_width + OFFSET_SHADOW, m_height + OFFSET_SHADOW); m_visible = false; } } From f5a91799573dd21b7088918cbc65b8d1198ec5f9 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 09/16] - filebrowser: add shadow to gui-elements Signed-off-by: Thilo Graf --- src/gui/filebrowser.cpp | 25 +++++++++++++++++-------- 1 file changed, 17 insertions(+), 8 deletions(-) diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index bb3677ece..1a489d7cb 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -277,10 +277,10 @@ void CFileBrowser::fontInit() smskey_width = fnt_foot->getRenderWidth("M") + OFFSET_INNER_MID; liststart = 0; - listmaxshow = std::max(1,(int)(height - header_height - footer_height)/item_height); + listmaxshow = std::max(1,(int)(height - header_height - footer_height - OFFSET_SHADOW)/item_height); //recalc height - height = header_height + listmaxshow * item_height + footer_height; + height = header_height + listmaxshow*item_height + footer_height + OFFSET_SHADOW; y = getScreenStartY(height); } @@ -1172,7 +1172,7 @@ void CFileBrowser::addRecursiveDir(CFileList * re_filelist, std::string rpath, b void CFileBrowser::hide() { - frameBuffer->paintBackgroundBoxRel(x,y, width,height); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); } void CFileBrowser::paintItem(unsigned int pos) @@ -1356,6 +1356,7 @@ void CFileBrowser::paintHead() i++; CComponentsHeader header(x, y, width, header_height, &l_name[i]); + header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.paint(CC_SAVE_SCREEN_NO); free(l_name); @@ -1435,12 +1436,16 @@ int CFileBrowser::paintFoot(bool show) return paintButtons(buttons_filelistmode, cnt, 0, 0, 0, 0, 0, false, NULL, NULL); } + int footer_y = y + height - OFFSET_SHADOW - footer_height; int footer_width = width - smskey_width; + // shadow + frameBuffer->paintBoxRel(x + OFFSET_SHADOW, footer_y + OFFSET_SHADOW, width, footer_height, COL_SHADOW_PLUS_0, RADIUS_MID, CORNER_BOTTOM); + if (filelist.empty()) { // show an empty footer - frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); + frameBuffer->paintBoxRel(x, footer_y, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); return footer_height; } @@ -1449,9 +1454,9 @@ int CFileBrowser::paintFoot(bool show) CComponentsFooter can't handle button_label_ext */ if (playlistmode) - res = paintButtons(buttons_playlistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); + res = paintButtons(buttons_playlistmode, cnt, x, footer_y, width, footer_height, footer_width); else - res = paintButtons(buttons_filelistmode, cnt, x, y + height - footer_height, width, footer_height, footer_width); + res = paintButtons(buttons_filelistmode, cnt, x, footer_y, width, footer_height, footer_width); paintSMSKey(); return res; @@ -1460,16 +1465,17 @@ int CFileBrowser::paintFoot(bool show) void CFileBrowser::paintSMSKey() { int smskey_height = fnt_foot->getHeight(); + int smskey_y = y + height - OFFSET_SHADOW - footer_height; //background - frameBuffer->paintBoxRel(x + width - smskey_width, y + height - footer_height, smskey_width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_RIGHT); + frameBuffer->paintBoxRel(x + width - smskey_width, smskey_y, smskey_width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM_RIGHT); if(m_SMSKeyInput.getOldKey()!=0) { char cKey[2] = {m_SMSKeyInput.getOldKey(), 0}; cKey[0] = toupper(cKey[0]); int len = fnt_foot->getRenderWidth(cKey); - fnt_foot->RenderString(x + width - smskey_width, y + height - footer_height + footer_height/2 + smskey_height/2, len, cKey, COL_MENUHEAD_TEXT); + fnt_foot->RenderString(x + width - smskey_width, smskey_y + footer_height/2 + smskey_height/2, len, cKey, COL_MENUHEAD_TEXT); } } @@ -1488,6 +1494,9 @@ void CFileBrowser::paint() getScrollBarData(&total_pages, ¤t_page, filelist.size(), listmaxshow, selected); paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + + // shadow + frameBuffer->paintBoxRel(x + width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); } void CFileBrowser::SMSInput(const neutrino_msg_t msg) From 7e89096c4ec22558deb940f5096734e81c8225f3 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 16:07:25 +0200 Subject: [PATCH 10/16] - epgplus: add shadow to gui-elements Signed-off-by: Thilo Graf --- src/gui/epgplus.cpp | 23 +++++++++++++++-------- 1 file changed, 15 insertions(+), 8 deletions(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index b5d209dd3..1c4107a65 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -114,6 +114,8 @@ void EpgPlus::Header::paint(const char * Name) this->head = new CComponentsHeader(); this->head->setContextButton(CComponentsHeader::CC_BTN_HELP); this->head->enableClock(true, "%H:%M", "%H %M", true); + this->head->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); + } if (this->head) @@ -220,6 +222,9 @@ void EpgPlus::TimeLine::paint(time_t _startTime, int pduration) toggleColor = !toggleColor; } + + // shadow + this->frameBuffer->paintBoxRel(this->x + this->width, this->y + OFFSET_SHADOW, OFFSET_SHADOW, this->getUsedHeight(), COL_SHADOW_PLUS_0); } void EpgPlus::TimeLine::paintGrid() @@ -560,7 +565,7 @@ EpgPlus::Footer::Footer(CFrameBuffer * pframeBuffer, int px, int py, int pwidth, this->width = pwidth; this->buttonHeight = pbuttonHeight; - this->buttonY = this->y - OFFSET_INTER - this->buttonHeight; + this->buttonY = this->y - OFFSET_INTER - OFFSET_SHADOW - this->buttonHeight; } EpgPlus::Footer::~Footer() @@ -591,6 +596,7 @@ void EpgPlus::Footer::paintEventDetails(const std::string & description, const s int frame_thickness = 2; // clear the whole footer + this->frameBuffer->paintBoxRel(this->x + OFFSET_SHADOW, yPos + OFFSET_SHADOW, this->width, this->getUsedHeight(), COL_SHADOW_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxRel(this->x, yPos, this->width, this->getUsedHeight(), COL_MENUCONTENTDARK_PLUS_0, RADIUS_LARGE); this->frameBuffer->paintBoxFrame(this->x, yPos, this->width, this->getUsedHeight(), frame_thickness, COL_FRAME_PLUS_0, RADIUS_LARGE); @@ -619,8 +625,9 @@ struct button_label buttonLabels[] = void EpgPlus::Footer::paintButtons(button_label * pbuttonLabels, int numberOfButtons) { int buttonWidth = (this->width); - CComponentsFooter _footer; - _footer.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); + CComponentsFooter foot; + foot.enableShadow(CC_SHADOW_ON, -1, true); + foot.paintButtons(this->x, this->buttonY, buttonWidth, buttonHeight, numberOfButtons, pbuttonLabels, buttonWidth/numberOfButtons); } EpgPlus::EpgPlus() @@ -828,10 +835,10 @@ void EpgPlus::init() int footerHeight = Footer::getUsedHeight(); - this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_INTER - footerHeight) / this->entryHeight; + this->maxNumberOfDisplayableEntries = (this->usableScreenHeight - headerHeight - timeLineHeight - buttonHeight - OFFSET_SHADOW - OFFSET_INTER - footerHeight - OFFSET_SHADOW) / this->entryHeight; this->bodyHeight = this->maxNumberOfDisplayableEntries * entryHeight; - this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_INTER + footerHeight; // recalc deltaY + this->usableScreenHeight = headerHeight + timeLineHeight + this->bodyHeight + buttonHeight + OFFSET_SHADOW + OFFSET_INTER + footerHeight + OFFSET_SHADOW; // recalc deltaY this->usableScreenX = getScreenStartX(this->usableScreenWidth); if (this->usableScreenX < DETAILSLINE_WIDTH) this->usableScreenX = DETAILSLINE_WIDTH; @@ -846,7 +853,7 @@ void EpgPlus::init() this->timeLineWidth = this->usableScreenWidth; this->footerX = usableScreenX; - this->footerY = this->usableScreenY + this->usableScreenHeight - footerHeight; + this->footerY = this->usableScreenY + this->usableScreenHeight - OFFSET_SHADOW - footerHeight; this->footerWidth = this->usableScreenWidth; this->channelsTableX = this->usableScreenX; @@ -1386,7 +1393,7 @@ void EpgPlus::hide() delete this->header->head; this->header->head = NULL; } - this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX - DETAILSLINE_WIDTH, this->usableScreenY, DETAILSLINE_WIDTH + this->usableScreenWidth, this->usableScreenHeight); + this->frameBuffer->paintBackgroundBoxRel(this->usableScreenX, this->usableScreenY, this->usableScreenWidth + OFFSET_SHADOW, this->usableScreenHeight + OFFSET_SHADOW); } void EpgPlus::paintChannelEntry(int position) @@ -1436,7 +1443,7 @@ void EpgPlus::paint() this->maxNumberOfDisplayableEntries, this->selectedChannelEntry == NULL ? 0 : this->selectedChannelEntry->index); - paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page); + paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_ON); } // -- EPG+ Menue Handler Class From 000edc2942e1aa89ee05cfc7f0ecf0e125c4dd9b Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 16:20:49 +0200 Subject: [PATCH 11/16] - simplify last shadow-changes ... I didn't know about the possibility to add a shadow directly to the scrollbar. Signed-off-by: Thilo Graf --- src/gui/audioplayer.cpp | 5 +---- src/gui/filebrowser.cpp | 6 +----- src/gui/pictureviewer.cpp | 6 +----- 3 files changed, 3 insertions(+), 14 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index abbab66c8..f3ff5f8b6 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1782,10 +1782,7 @@ void CAudioPlayerGui::paint() int current_page; getScrollBarData(&total_pages, ¤t_page, m_playlist.size(), m_listmaxshow, m_selected); - paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); - - // shadow - m_frameBuffer->paintBoxRel(m_x + m_width, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height + OFFSET_SHADOW, OFFSET_SHADOW, m_item_height*m_listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER + m_header_height, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page, CC_SHADOW_ON); } paintTitleBox(); diff --git a/src/gui/filebrowser.cpp b/src/gui/filebrowser.cpp index 1a489d7cb..9a49f973b 100644 --- a/src/gui/filebrowser.cpp +++ b/src/gui/filebrowser.cpp @@ -1492,11 +1492,7 @@ void CFileBrowser::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, filelist.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); - - // shadow - frameBuffer->paintBoxRel(x + width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); } void CFileBrowser::SMSInput(const neutrino_msg_t msg) diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 2cdd04039..9ccb9952f 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -758,11 +758,7 @@ void CPictureViewerGui::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, playlist.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); - - // shadow - frameBuffer->paintBoxRel(x + width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); paintFoot(); paintInfo(); From df46c1d6da6129f66788bd3a3957130050eda5ed Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 17:01:47 +0200 Subject: [PATCH 12/16] - bouquetlist: add shadow to gui-elements; simplify footer handling Signed-off-by: Thilo Graf --- src/gui/bouquetlist.cpp | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/gui/bouquetlist.cpp b/src/gui/bouquetlist.cpp index 024ea7ce0..73eb025dc 100644 --- a/src/gui/bouquetlist.cpp +++ b/src/gui/bouquetlist.cpp @@ -619,7 +619,7 @@ int CBouquetList::show(bool bShowChannelList) void CBouquetList::hide() { - frameBuffer->paintBackgroundBoxRel(x, y, width, height); + frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); CInfoClock::getInstance()->enableInfoClock(!CInfoClock::getInstance()->isBlocked()); } @@ -701,6 +701,7 @@ void CBouquetList::paintHead() { std::string icon(""); CComponentsHeader header(x, y, width, header_height, name, icon, CComponentsHeader::CC_BTN_LEFT | CComponentsHeader::CC_BTN_RIGHT | CComponentsHeader::CC_BTN_MENU); + header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); header.paint(CC_SAVE_SCREEN_NO); } @@ -721,18 +722,12 @@ void CBouquetList::paint() frameBuffer->paintBoxRel(x, y + header_height, width, height - header_height - footer_height, COL_MENUCONTENT_PLUS_0); - int numButtons = sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); + // no buttons in favonly mode + int numButtons = (favonly) ? 0 : sizeof(CBouquetListButtons)/sizeof(CBouquetListButtons[0]); - if (favonly) - { - // show an empty footer - frameBuffer->paintBoxRel(x, y + height - footer_height, width, footer_height, COL_MENUFOOT_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); - } - else - { - CComponentsFooter footer; - footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); - } + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + footer.paintButtons(x, y + height - footer_height, width, footer_height, numButtons, CBouquetListButtons); if (!Bouquets.empty()) { @@ -745,6 +740,5 @@ void CBouquetList::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, Bouquets.size(), listmaxshow, selected); - - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page, CC_SHADOW_ON); } From ddcda8be275fc5be276be6fc750f1899680473cc Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 17:21:33 +0200 Subject: [PATCH 13/16] - upnpbrowser: activate shadow on scrollbar Signed-off-by: Thilo Graf --- src/gui/upnpbrowser.cpp | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index a02596374..e4e62208a 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1003,10 +1003,7 @@ void CUpnpBrowserGui::paintDevices() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, m_devices.size(), m_listmaxshow, m_selecteddevice); - paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); - - //shadow - m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + OFFSET_SHADOW, OFFSET_SHADOW, m_item_height*m_listmaxshow, COL_SHADOW_PLUS_0); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page, CC_SHADOW_ON); // Foot footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM); @@ -1178,7 +1175,7 @@ void CUpnpBrowserGui::paintItems(std::vector *entry, unsigned int sel int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, max + offset, m_listmaxshow, selected + offset); - paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page); + paintScrollBar(m_x + m_width - SCROLLBAR_WIDTH, m_item_y, SCROLLBAR_WIDTH, m_item_height*m_listmaxshow, total_pages, current_page, CC_SHADOW_ON); // Foot buttons size_t numbuttons = sizeof(BrowseButtons)/sizeof(BrowseButtons[0]); From d357835b381fb642e8ca40074541118524f7124c Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 21:20:19 +0200 Subject: [PATCH 14/16] - upnpbrowser: center text in topbox Signed-off-by: Thilo Graf --- src/gui/upnpbrowser.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index e4e62208a..b8c3d5878 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -942,7 +942,7 @@ void CUpnpBrowserGui::paintDeviceInfo() topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); topbox.paint0(); } @@ -1144,7 +1144,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) } topbox.setCorner(RADIUS_LARGE); - topbox.setText(tmp, CTextBox::AUTO_WIDTH); + topbox.setText(tmp, CTextBox::AUTO_WIDTH | CTextBox::CENTER); topbox.paint0(); } From c93be1dfe71a68c1d4e176aacdfaade57fa49864 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 19 Jun 2017 20:02:24 +0200 Subject: [PATCH 15/16] - audioplayer: minor format changes in title box Signed-off-by: Thilo Graf --- src/gui/eventlist.cpp | 291 +++++++++++++++++++++--------------------- src/gui/eventlist.h | 51 ++++---- 2 files changed, 172 insertions(+), 170 deletions(-) diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 2bcd1094b..76c7d5cdf 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -110,18 +110,17 @@ CEventList::CEventList() m_search_fsk = 1; full_width = width = 0; height = 0; - x = y = 0; - cc_infozone = NULL; + infozone = NULL; infozone_text = ""; item_event_ID = 0; oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; header = NULL; pb = NULL; - Bottombox = NULL; + navibar = NULL; } CEventList::~CEventList() @@ -134,8 +133,8 @@ void CEventList::ResetModules() if (header){ delete header; header = NULL; } - if (Bottombox){ - delete Bottombox; Bottombox = NULL; + if (navibar){ + delete navibar; navibar = NULL; } if (pb){ delete pb; pb = NULL; @@ -318,38 +317,33 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna width = full_width; height = frameBuffer->getScreenHeightRel(); - // Calculate iheight (we assume the red button is the largest one?) - struct button_label tmp_button[1] = { { NEUTRINO_ICON_BUTTON_RED, LOCALE_EVENTLISTBAR_RECORDEVENT } }; - iheight = ::paintButtons(0, 0, 0, 1, tmp_button, 0, 0, "", false, COL_MENUFOOT_TEXT, NULL, 0, false); - - // Calculate theight - theight = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_TITLE]->getHeight(); + // Calculate header_height + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + footer_height = header_height; const int pic_h = 39; - theight = std::max(theight, pic_h); + header_height = std::max(header_height, pic_h); - fheight1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight(); + largefont_height = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->getHeight(); { int h1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getHeight(); int h2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getHeight(); - fheight2 = std::max( h1, h2 ); + smallfont_height = std::max(h1, h2); } unit_short_minute = g_Locale->getText(LOCALE_UNIT_SHORT_MINUTE); - fheight = fheight1 + fheight2 + OFFSET_INNER_MIN; - fwidth1 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth("DDD, :, ") + 4 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getMaxDigitWidth(); - //fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth("[ ] ") + 3 * g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getMaxDigitWidth() + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(unit_short_minute); + item_height = smallfont_height + OFFSET_INNER_MIN + largefont_height; - botboxheight = fheight1+2*OFFSET_INNER_MIN; + navibar_height = largefont_height+2*OFFSET_INNER_MIN; - listmaxshow = (height-theight-iheight-botboxheight-0)/fheight; - height = theight+iheight+botboxheight+0+listmaxshow*fheight; // recalc height + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW - navibar_height)/item_height; + height = header_height + footer_height + OFFSET_SHADOW + navibar_height + listmaxshow*item_height; // recalc height y = getScreenStartY(height); // calculate width of right info_zone infozone_width = full_width - width; // init right info_zone - if ((g_settings.eventlist_additional) && (cc_infozone == NULL)) - cc_infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y+theight, infozone_width-2*OFFSET_INNER_MID, listmaxshow*fheight); + if ((g_settings.eventlist_additional) && (infozone == NULL)) + infozone = new CComponentsText(x+width+OFFSET_INNER_MID, y + header_height, infozone_width-2*OFFSET_INNER_MID, listmaxshow*item_height); int res = menu_return::RETURN_REPAINT; //printf("CEventList::exec: channel_id %llx\n", channel_id); @@ -381,7 +375,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna bool dont_hide = false; paintHead(channel_id, channelname, channelname_prev, channelname_next); paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); int oldselected = selected; @@ -428,7 +422,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna else paintItem(selected - liststart, channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); } //sort else if (!showfollow && (msg == (neutrino_msg_t)g_settings.key_channelList_sort)) @@ -486,7 +480,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID); - showFunctionBar(evtlist[selected].channelID); + paintFoot(evtlist[selected].channelID); continue; } std::string recDir = g_settings.network_nfs_recordingdir; @@ -541,7 +535,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(used_id); - showFunctionBar(used_id); + paintFoot(used_id); } } else if ( msg == (neutrino_msg_t) g_settings.key_channelList_addremind )//add/remove zapto timer event @@ -553,7 +547,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID); - showFunctionBar(evtlist[selected].channelID); + paintFoot(evtlist[selected].channelID); continue; } @@ -565,7 +559,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna timerlist.clear(); g_Timerd->getTimerList (timerlist); paint(evtlist[selected].channelID ); - showFunctionBar(evtlist[selected].channelID ); + paintFoot(evtlist[selected].channelID ); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == (neutrino_msg_t)g_settings.key_channelList_cancel) @@ -576,7 +570,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, channelname); readEvents(epg_id); paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); } else { selected = oldselected; if(fader.StartFadeOut()) { @@ -595,7 +589,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna t_channel_id _channel_id = channel_id; getChannelNames(_channel_id, current_channel_name, prev_channel_name, next_channel_name, msg); if(_channel_id){ - bgRightBoxPaint = false; + infozone_background = false; loop = false; dont_hide = true; exec(_channel_id, current_channel_name, prev_channel_name, next_channel_name); @@ -613,9 +607,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, channelname); oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } else if (msg == CRCInput::RC_epg) @@ -656,9 +650,9 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna paintHead(channel_id, in_search ? search_head_name : channelname); oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; paint(channel_id); - showFunctionBar(channel_id); + paintFoot(channel_id); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } } @@ -667,7 +661,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna { oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; in_search = findEvents(channel_id, channelname); timeoutEnd = CRCInput::calcTimeoutEnd(g_settings.timing[SNeutrinoSettings::TIMING_EPG]); } @@ -691,12 +685,12 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna } } - if (cc_infozone) - delete cc_infozone; - cc_infozone = NULL; + if (infozone) + delete infozone; + infozone = NULL; oldIndex = -1; oldEventID = -1; - bgRightBoxPaint = false; + infozone_background = false; if(!dont_hide){ hide(); @@ -708,7 +702,7 @@ int CEventList::exec(const t_channel_id channel_id, const std::string& channelna void CEventList::hide() { ResetModules(); - frameBuffer->paintBackgroundBoxRel(x,y, full_width,height); + frameBuffer->paintBackgroundBoxRel(x, y, full_width + OFFSET_SHADOW, height + OFFSET_SHADOW); } CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChannelEvent * event, int * tID) @@ -737,7 +731,7 @@ CTimerd::CTimerEventTypes CEventList::isScheduled(t_channel_id channel_id, CChan void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { - int ypos = y+ theight + pos*fheight; + int ypos = y + header_height + pos*item_height; unsigned int currpos = liststart + pos; bool i_selected = currpos == selected; @@ -753,27 +747,27 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, width - SCROLLBAR_WIDTH, item_height, bgcolor, i_radius); if(currposgetText(CLocaleManager::getWeekday(tmStartZeit)); - datetime1_str += strftime(", %H:%M", tmStartZeit); - datetime1_str += strftime(", %d", tmStartZeit); - datetime1_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); + datetime_str = g_Locale->getText(CLocaleManager::getWeekday(tmStartZeit)); + datetime_str += strftime(", %H:%M", tmStartZeit); + datetime_str += strftime(", %d", tmStartZeit); + datetime_str += g_Locale->getText(CLocaleManager::getMonth(tmStartZeit)); if ( m_showChannel ) // show the channel if we made a event search only (which could be made through all channels ). { t_channel_id channel = evtlist[currpos].channelID; - datetime1_str += " "; - datetime1_str += CServiceManager::getInstance()->GetServiceName(channel); + datetime_str += " "; + datetime_str += CServiceManager::getInstance()->GetServiceName(channel); } snprintf(tmpstr,sizeof(tmpstr), "[%d %s]", evtlist[currpos].duration / 60, unit_short_minute); @@ -781,10 +775,10 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) } // 1st line - int fwidth1a=g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime1_str); - fwidth2 = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(duration_str); + int datetime_width = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->getRenderWidth(datetime_str); + int duration_width = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(duration_str); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + fheight2, fwidth1a, datetime1_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_DATETIME]->RenderString(x + OFFSET_INNER_SMALL, ypos + OFFSET_INNER_MIN + smallfont_height, datetime_width, datetime_str, color); int seit = ( evtlist[currpos].startTime - time(NULL) ) / 60; if ( (seit> 0) && (seit<100) && (!duration_str.empty()) ) @@ -792,9 +786,9 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) char beginnt[100]; snprintf(beginnt, sizeof(beginnt), "%s %d %s", g_Locale->getText(LOCALE_WORD_IN), seit, unit_short_minute); int w = g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->getRenderWidth(beginnt); - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - fwidth2 - w, ypos + OFFSET_INNER_MIN + fheight2, w, beginnt, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - duration_width - w, ypos + OFFSET_INNER_MIN + smallfont_height, w, beginnt, color); } - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - fwidth2, ypos + OFFSET_INNER_MIN + fheight2, fwidth2, duration_str, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMSMALL]->RenderString(x + width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - duration_width, ypos + OFFSET_INNER_MIN + smallfont_height, duration_width, duration_str, color); // 2nd line // set status icons @@ -811,7 +805,7 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) int iw = 0, ih = 0; if(icontype != 0) { frameBuffer->getIconSize(icontype, &iw, &ih); - frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); + frameBuffer->paintIcon(icontype, x + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + smallfont_height, largefont_height); iw += OFFSET_INNER_MID; } @@ -824,15 +818,14 @@ void CEventList::paintItem(unsigned int pos, t_channel_id channel_idI) { //paint_warning = true; frameBuffer->getIconSize(NEUTRINO_ICON_IMPORTANT, &i2w, &i2h); - frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + fheight2, fheight1); + frameBuffer->paintIcon(NEUTRINO_ICON_IMPORTANT, x + iw + OFFSET_INNER_MID, ypos + OFFSET_INNER_MIN + smallfont_height, largefont_height); iw += i2w + OFFSET_INNER_MID; } // paint 2nd line text - g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + fheight, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); + g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]->RenderString(x + iw + OFFSET_INNER_MID, ypos + item_height, width - iw - 2*OFFSET_INNER_MID, evtlist[currpos].description, color); - if (i_radius) - showProgressBar(currpos); + showProgressBar(currpos); } } @@ -858,6 +851,13 @@ void CEventList::paintDescription(int index) else CEitManager::getInstance()->getActualEPGServiceKey(evtlist[index].channelID, &epgData ); + infozone_text = ""; + if (!epgData.info1.empty() && !epgData.info2.empty() && (epgData.info2.find(epgData.info1) != 0)) { + infozone_text += epgData.info1; + infozone_text += "\n"; + infozone_text += epgData.info2; + } + else if(!epgData.info2.empty()){ infozone_text = epgData.info2; } @@ -867,11 +867,12 @@ void CEventList::paintDescription(int index) else infozone_text = g_Locale->getText(LOCALE_EPGLIST_NOEVENTS); - cc_infozone->setText(infozone_text, CTextBox::TOP, g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]); - cc_infozone->doPaintBg(false); - cc_infozone->doPaintTextBoxBg(true); - cc_infozone->forceTextPaint(); - cc_infozone->paint(CC_SAVE_SCREEN_NO); + infozone->setText(infozone_text, CTextBox::TOP, g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_EVENT]); + infozone->doPaintBg(false); + infozone->doPaintTextBoxBg(true); + //FIXME infozone->enableShadow(CC_SHADOW_RIGHT, -1, true); + infozone->forceTextPaint(); + infozone->paint(CC_SAVE_SCREEN_NO); } void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev, std::string _channelname_next) @@ -881,13 +882,15 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s header->getTextObject()->enableTboxSaveScreen(g_settings.theme.menu_Head_gradient);//enable screen save for title text if color gradient is in use header->enableClock(true, "%H:%M", "%H %M", true); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); - header->setDimensionsAll(x, y, full_width, theight); + header->setDimensionsAll(x, y, full_width, header_height); + header->enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); } //header->getClockObject()->setCorner(RADIUS_LARGE, CORNER_TOP_RIGHT); if (header->isPainted()) header->getChannelLogoObject()->hide(); - header->setChannelLogo(_channel_id,_channelname); + if (g_settings.channellist_show_channellogo) + header->setChannelLogo(_channel_id,_channelname); header->setCaption(_channelname, CCHeaderTypes::CC_TITLE_LEFT); header->paint(CC_SAVE_SCREEN_NO); @@ -896,22 +899,27 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s getChannelNames(_channel_id, _channelname, _channelname_prev, _channelname_next, 0); } - paintBottomBox(_channelname_prev, _channelname_next); + paintNaviBar(_channelname_prev, _channelname_next); } -void CEventList::paintBottomBox(std::string _channelname_prev, std::string _channelname_next) +void CEventList::paintNaviBar(std::string _channelname_prev, std::string _channelname_next) { - int by = y + height - iheight - botboxheight; + int navibar_y = y + height - OFFSET_SHADOW - footer_height - navibar_height; - if (!Bottombox){ - Bottombox = new CNaviBar(x, by, full_width, botboxheight); - Bottombox->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + if (!navibar) + { + navibar = new CNaviBar(x, navibar_y, full_width, navibar_height); + navibar->setFont(g_Font[SNeutrinoSettings::FONT_TYPE_EVENTLIST_ITEMLARGE]); + //FIXME navibar->enableShadow(CC_SHADOW_RIGHT, -1, true); } - Bottombox->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty()); - Bottombox->setText(_channelname_prev, _channelname_next); + navibar->enableArrows(!_channelname_prev.empty(), !_channelname_next.empty()); + navibar->setText(_channelname_prev, _channelname_next); - Bottombox->paint(false); + navibar->paint(false); + + // shadow + frameBuffer->paintBoxRel(x + full_width, navibar_y + OFFSET_SHADOW, OFFSET_SHADOW, navibar_height, COL_SHADOW_PLUS_0); } void CEventList::showProgressBar(int pos) @@ -926,10 +934,10 @@ void CEventList::showProgressBar(int pos) if (!pb) { - int pbw = 104; - int pbx = x + (full_width - pbw)/2; - int pbh = botboxheight - 12; - int pby = y + height -iheight - botboxheight + (botboxheight - pbh)/2; + int pbw = full_width/10; + int pbx = x + (full_width - pbw)/2; + int pbh = navibar_height - 2*OFFSET_INNER_SMALL; + int pby = y + height - OFFSET_SHADOW - footer_height - navibar_height + (navibar_height - pbh)/2; pb = new CProgressBar(pbx, pby, pbw, pbh); pb->setType(CProgressBar::PB_TIMESCALE); @@ -954,12 +962,13 @@ void CEventList::paint(t_channel_id channel_id) liststart = (selected/listmaxshow)*listmaxshow; // paint background for right box - if (g_settings.eventlist_additional && !bgRightBoxPaint) { - frameBuffer->paintBoxRel(x+width,y+theight,infozone_width,listmaxshow*fheight,COL_MENUCONTENT_PLUS_0); - bgRightBoxPaint = true; + if (g_settings.eventlist_additional && !infozone_background) + { + frameBuffer->paintBoxRel(x + width,y + header_height, infozone_width, item_height*listmaxshow, COL_MENUCONTENT_PLUS_0); + infozone_background = true; } - for(unsigned int count=0;countpaintBoxRel(x + full_width, y + header_height + OFFSET_SHADOW, OFFSET_SHADOW, item_height*listmaxshow, COL_SHADOW_PLUS_0); } -void CEventList::showFunctionBar(t_channel_id channel_id) +void CEventList::paintFoot(t_channel_id channel_id) { - int bx = x; - int bw = full_width; - int bh = iheight; - int by = y + height - bh; - CColorKeyHelper keyhelper; //user_menue.h neutrino_msg_t dummy = CRCInput::RC_nokey; const char * icon = NULL; - struct button_label buttons[5]; + struct button_label buttons[5]; //TODO dbt: add directly into footer object with setButtonLabels() int btn_cnt = 0; int tID = -1; //any value, not NULL @@ -1040,26 +1047,38 @@ void CEventList::showFunctionBar(t_channel_id channel_id) buttons[btn_cnt].locale = LOCALE_EPGMENU_EVENTINFO; btn_cnt++; } - ::paintButtons(bx, by, bw, btn_cnt, buttons, bw, bh); + +#if 0 + buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; + buttons[btn_cnt].locale = LOCALE_EPGPLUS_HEAD; + btn_cnt++; + + buttons[btn_cnt].button = NEUTRINO_ICON_BUTTON_0; + buttons[btn_cnt].locale = LOCALE_TIMERLIST_NAME; + btn_cnt++; +#endif + + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, full_width, footer_height, btn_cnt, buttons); } int CEventListHandler::exec(CMenuTarget* parent, const std::string &/*actionkey*/) { - int res = menu_return::RETURN_EXIT_ALL; - if (parent) { + int res = menu_return::RETURN_EXIT_ALL; + + if (parent) parent->hide(); - } + CEventList *e = new CEventList; CChannelList *channelList = CNeutrinoApp::getInstance()->channelList; - e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName()); // UTF-8 + e->exec(CZapit::getInstance()->GetCurrentChannelID(), channelList->getActiveChannelName()); delete e; return res; } -/************************************************************************************************/ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) -/************************************************************************************************/ { bool res = false; int event = 0; @@ -1070,19 +1089,19 @@ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) m_search_autokeyword = m_search_keyword; } - CEventFinderMenu menu( &event, - &m_search_epg_item, - &m_search_keyword, - &m_search_list, - &m_search_channel_id, - &m_search_bouquet_id, - &m_search_genre, - &m_search_fsk - ); + CEventFinderMenu menu(&event, + &m_search_epg_item, + &m_search_keyword, + &m_search_list, + &m_search_channel_id, + &m_search_bouquet_id, + &m_search_genre, + &m_search_fsk); + hide(); menu.exec(NULL,""); search_head_name = g_Locale->getText(LOCALE_EVENTFINDER_SEARCH); - if(event == 1) + if (event == 1) { res = true; m_showChannel = true; // force the event list to paint the channel name @@ -1183,16 +1202,15 @@ bool CEventList::findEvents(t_channel_id channel_id, std::string channelname) } } - if(event) + if (event) paintHead(0, search_head_name); else paintHead(channel_id, channelname); paint(); - showFunctionBar(channel_id); + paintFoot(channel_id); return(res); } -/************************************************************************************************/ /* class CSearchNotifier : public CChangeObserver { @@ -1208,7 +1226,7 @@ class CSearchNotifier : public CChangeObserver } }; */ -/************************************************************************************************ +/* bool CEventFinderMenuHandler::changeNotify(const neutrino_locale_t OptionName, void *Data) { if(OptionName == ) @@ -1266,36 +1284,29 @@ const CMenuOptionChooser::keyval SEARCH_EPG_OPTIONS[SEARCH_EPG_OPTION_COUNT] = { CEventList::SEARCH_EPG_ALL, LOCALE_EVENTFINDER_SEARCH_ALL_EPG } }; - - -/************************************************************************************************/ -CEventFinderMenu::CEventFinderMenu( int* event, - int* search_epg_item, - std::string* search_keyword, - int* search_list, - t_channel_id* search_channel_id, - t_bouquet_id* search_bouquet_id, - int* search_genre, - int* search_fsk - ) -/************************************************************************************************/ +CEventFinderMenu::CEventFinderMenu(int* event, + int* search_epg_item, + std::string* search_keyword, + int* search_list, + t_channel_id* search_channel_id, + t_bouquet_id* search_bouquet_id, + int* search_genre, + int* search_fsk) { - m_event = event; - m_search_epg_item = search_epg_item; + m_event = event; + m_search_epg_item = search_epg_item; m_search_keyword = search_keyword; - m_search_list = search_list; - m_search_channel_id = search_channel_id; - m_search_bouquet_id = search_bouquet_id; - m_search_genre = search_genre; - m_search_fsk = search_fsk; + m_search_list = search_list; + m_search_channel_id = search_channel_id; + m_search_bouquet_id = search_bouquet_id; + m_search_genre = search_genre; + m_search_fsk = search_fsk; + width = 40; selected = -1; } - -/************************************************************************************************/ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) -/************************************************************************************************/ { int res = menu_return::RETURN_REPAINT; @@ -1383,9 +1394,7 @@ int CEventFinderMenu::exec(CMenuTarget* parent, const std::string &actionkey) return res; } -/************************************************************************************************/ int CEventFinderMenu::showMenu(void) -/************************************************************************************************/ { int res = menu_return::RETURN_REPAINT; m_search_channelname_mf = NULL; @@ -1449,12 +1458,8 @@ int CEventFinderMenu::showMenu(void) return(res); } - -/************************************************************************************************/ bool CEventFinderMenu::changeNotify(const neutrino_locale_t OptionName, void *) -/************************************************************************************************/ { - if (ARE_LOCALES_EQUAL(OptionName, LOCALE_EVENTFINDER_SEARCH_WITHIN_LIST)) { if (*m_search_list == CEventList::SEARCH_LIST_CHANNEL) diff --git a/src/gui/eventlist.h b/src/gui/eventlist.h index 55401bff9..e6df12580 100644 --- a/src/gui/eventlist.h +++ b/src/gui/eventlist.h @@ -23,7 +23,6 @@ Boston, MA 02110-1301, USA. */ - #ifndef __EVENTLIST_HPP__ #define __EVENTLIST_HPP__ @@ -43,7 +42,6 @@ class CFramebuffer; class CEventList : public CListHelpers { - // Eventfinder start public: typedef enum { @@ -53,14 +51,16 @@ class CEventList : public CListHelpers SEARCH_EPG_INFO2, SEARCH_EPG_GENRE, SEARCH_EPG_ALL - }SEARCH_EPG; + } SEARCH_EPG; + typedef enum { SEARCH_LIST_NONE, SEARCH_LIST_CHANNEL, SEARCH_LIST_BOUQUET, SEARCH_LIST_ALL - }SEARCH_LIST; + } SEARCH_LIST; + private: int m_search_epg_item; std::string m_search_keyword; @@ -73,10 +73,8 @@ class CEventList : public CListHelpers bool m_showChannel; int oldIndex; event_id_t oldEventID; - bool bgRightBoxPaint; bool findEvents(t_channel_id channel_id, std::string channelname); - // Eventfinder end CFrameBuffer *frameBuffer; CChannelEventList evtlist; @@ -86,36 +84,36 @@ class CEventList : public CListHelpers unsigned int current_event; unsigned int liststart; unsigned int listmaxshow; - int fheight; // Fonthoehe Channellist-Inhalt - int fheight1,fheight2; - int fwidth1,fwidth2; - int theight; // Fonthoehe Channellist-Titel - int iheight; // Height info bar + int item_height; + int largefont_height, smallfont_height; + int header_height; + int footer_height; std::string search_head_name; int full_width, width, infozone_width; - int botboxheight; + int navibar_height; int height; int x; int y; std::string infozone_text; + bool infozone_background; int sort_mode; event_id_t item_event_ID; - CComponentsText *cc_infozone; + CComponentsText *infozone; CComponentsHeader *header; CProgressBar *pb; - CNaviBar *Bottombox; + CNaviBar *navibar; const char * unit_short_minute; void paintItem(unsigned pos, t_channel_id channel_id = 0); void paintDescription(int index); void paint(t_channel_id channel_id = 0); void paintHead(t_channel_id _channel_id, std::string _channelname, std::string _channelname_prev = "", std::string _channelname_next = ""); - void paintBottomBox(std::string _channelname_prev, std::string _channelname_next); + void paintNaviBar(std::string _channelname_prev, std::string _channelname_next); void showProgressBar(int pos); void hide(); - void showFunctionBar(t_channel_id channel_id); + void paintFoot(t_channel_id channel_id); void getChannelNames(t_channel_id &channel_id, std::string ¤t_channel_name, std::string &prev_channel_name, std::string &next_channel_name, neutrino_msg_t msg); int timerPre; @@ -136,7 +134,6 @@ class CEventListHandler : public CMenuTarget { public: int exec( CMenuTarget* parent, const std::string &actionkey); - }; class CEventFinderMenu : public CMenuTarget, CChangeObserver @@ -156,16 +153,16 @@ class CEventFinderMenu : public CMenuTarget, CChangeObserver int selected; int showMenu(void); public: - CEventFinderMenu( int* event, - int* search_epg_item, - std::string* search_keyword, - int* search_list, - t_channel_id* search_channel_id, - t_bouquet_id* search_bouquet_id, - int* search_genre, - int* search_fsk - ); - int exec( CMenuTarget* parent, const std::string &actionkey); + CEventFinderMenu(int* event, + int* search_epg_item, + std::string* search_keyword, + int* search_list, + t_channel_id* search_channel_id, + t_bouquet_id* search_bouquet_id, + int* search_genre, + int* search_fsk); + + int exec( CMenuTarget* parent, const std::string &actionkey); bool changeNotify(const neutrino_locale_t OptionName, void *); }; From cdf0123bea362c73e48d8b61e5dd5411001d9cce Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 30 May 2017 01:24:21 +0200 Subject: [PATCH 16/16] CComponentsScrollBar: overwrite default corner type Rounded corners are in mostly cases not required, because of possible pixel errors if scrollbars are used as embedded standalone part and is generated with external method paintScrollBar(). --- src/gui/components/cc_frm_scrollbar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_scrollbar.cpp b/src/gui/components/cc_frm_scrollbar.cpp index 5e4c046f3..2e59a630f 100644 --- a/src/gui/components/cc_frm_scrollbar.cpp +++ b/src/gui/components/cc_frm_scrollbar.cpp @@ -94,7 +94,7 @@ void CComponentsScrollBar::initVarSbForm(const int& count, const fb_pixel_t& col sb_down_obj = NULL; sb_segments_obj = NULL; - setCorner(RADIUS_MIN, CORNER_ALL); + corner_type = CORNER_NONE; sb_up_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_UP) ; sb_down_icon = frameBuffer->getIconPath(NEUTRINO_ICON_BUTTON_DOWN);