From 710951a5af47877d572bf787cf83c364e95bcfdf Mon Sep 17 00:00:00 2001 From: TangoCash Date: Sun, 18 Jun 2017 15:06:11 +0200 Subject: [PATCH 01/46] progresswindow: fix progressbar if both bars have the same value (thx dbo) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ac46bb04929e596479df90e1bd4dffa1f5aef52a Author: TangoCash Date: 2017-06-18 (Sun, 18 Jun 2017) Origin message was: ------------------ -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 a0fdcb78c6b2b7c97e8baf1798e2294a29b5fc01 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 20 Jun 2017 09:54:52 +0200 Subject: [PATCH 02/46] CProgressWindow: remove unused variable fix for possible compiler error with -Werror=unused-variable Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/64396a1c5e9b831b13a6c252e9cd1cb2aa87c67c Author: Thilo Graf Date: 2017-06-20 (Tue, 20 Jun 2017) --- 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 a9dcef0b0adb2c58871649634cb423610864d2f1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 18 Jun 2017 23:27:45 +0200 Subject: [PATCH 03/46] audioplayer: minor format changes in title box Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cd6c123e561e569b7626202f3764cf1f347639ef Author: vanhofen Date: 2017-06-18 (Sun, 18 Jun 2017) Origin message was: ------------------ - 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 6d8978b9947c94afc9fdbcb8e42827a927b0f883 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 18 Jun 2017 23:54:43 +0200 Subject: [PATCH 04/46] audioplayer: don't show not recognized bitrates Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c1460ef90515ab991cc3183e55d61b3ce06f2670 Author: vanhofen Date: 2017-06-18 (Sun, 18 Jun 2017) Origin message was: ------------------ - 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 8afe19e7599382b48e1a428dfd4549987bcc1197 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 09:33:11 +0200 Subject: [PATCH 05/46] audioplayer: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/37e5f8032e07108ebf3f82b9a08a99cd9f286c70 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 13cdd45b478911b5ffb74a54450df77b75e4dbf4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 06/46] pictureviewer: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/26d1cb31fa9c3743d27e418dacc16024971d2146 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 e6c030a894b0afa01326448d23470bc26f8d558e Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 07/46] audioplayer: fix coordinates in hide() function Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cc42ee1e42ab2a9e2e6ccaada8a6caea272f5890 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 de1d66cba0655cabd1efcf223318f7f195bf9b74 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 13:00:05 +0200 Subject: [PATCH 08/46] filebrowser: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f5a91799573dd21b7088918cbc65b8d1198ec5f9 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 916e2e1c5a304bd19144c63f8b2fd9e52896c3c3 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 16:07:25 +0200 Subject: [PATCH 09/46] epgplus: add shadow to gui-elements Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e89096c4ec22558deb940f5096734e81c8225f3 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 e00aebb6f44f55c8f2658413919bc4af5c1a7f9d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 16:20:49 +0200 Subject: [PATCH 10/46] simplify last shadow-changes ... I didn't know about the possibility to add a shadow directly to the scrollbar. Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/000edc2942e1aa89ee05cfc7f0ecf0e125c4dd9b Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 b295834d9aa32ed95c178a0d89c8c95fb55b23b2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 17:01:47 +0200 Subject: [PATCH 11/46] bouquetlist: add shadow to gui-elements; simplify footer handling Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/df46c1d6da6129f66788bd3a3957130050eda5ed Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 edbade16843d729a408a885208ed416039729a5c Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 17:21:33 +0200 Subject: [PATCH 12/46] upnpbrowser: activate shadow on scrollbar Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ddcda8be275fc5be276be6fc750f1899680473cc Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 0b9047bfd0eb79a6308c1fd934853e49f16b8b97 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 21:20:19 +0200 Subject: [PATCH 13/46] upnpbrowser: center text in topbox Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d357835b381fb642e8ca40074541118524f7124c Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 8b6b7c854b07b8245e65da1cf6205c19494eb42d Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Jun 2017 20:02:24 +0200 Subject: [PATCH 14/46] audioplayer: minor format changes in title box Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c93be1dfe71a68c1d4e176aacdfaade57fa49864 Author: vanhofen Date: 2017-06-19 (Mon, 19 Jun 2017) Origin message was: ------------------ - 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 0f3b5e5eaf001439f7fa3f37cc86c35a6f628cd8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 30 May 2017 01:24:21 +0200 Subject: [PATCH 15/46] 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(). Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/cdf0123bea362c73e48d8b61e5dd5411001d9cce Author: Thilo Graf Date: 2017-05-30 (Tue, 30 May 2017) --- 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); From a95ede26498e407e8108e348c790840181279710 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 20 Jun 2017 14:16:14 +0200 Subject: [PATCH 16/46] timerlist: small design reworks ... * re-align item contents * rename some variables * use CComponentsFooter * blinking clock in header (shameless stolen from TangoCash) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/86067e6e4417fcd94f54dbdd813c4010db919259 Author: vanhofen Date: 2017-06-20 (Tue, 20 Jun 2017) Origin message was: ------------------ - timerlist: small design reworks ... * re-align item contents * rename some variables * use CComponentsFooter * blinking clock in header (shameless stolen from TangoCash) --- src/gui/timerlist.cpp | 189 +++++++++++++++++++++--------------------- src/gui/timerlist.h | 8 +- 2 files changed, 101 insertions(+), 96 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 8746ed2c2..ff4bb43a2 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -272,11 +272,14 @@ CTimerList::CTimerList() visible = false; x = y = 0; width = height = 0; - fheight = theight = 0; - footerHeight = 0; + header_height = 0; + font_height = 0; + item_height = 0; + footer_height = 0; selected = 0; liststart = 0; listmaxshow = 0; + header = NULL; Timer = new CTimerdClient(); timerNew_message = ""; timerNew_pluginName = ""; @@ -672,27 +675,23 @@ void CTimerList::updateEvents(void) RemoteBoxTimerList (timerlist); sort(timerlist.begin(), timerlist.end()); - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - //get footerHeight from paintButtons - footerHeight = ::paintButtons(TimerListButtons, TimerListButtonsCount, 0, 0, 0, 0, 0, false); + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + font_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + item_height = 2*font_height; + footer_height = header_height; - //width = w_max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth()*56, 20); - width = frameBuffer->getScreenWidth()*0.9; - height = frameBuffer->getScreenHeight() - (2*theight); // max height - - listmaxshow = (height-theight)/(fheight*2); - height = theight+listmaxshow*fheight*2+footerHeight; // recalc height + width = frameBuffer->getScreenWidth()/100 * 90; + height = frameBuffer->getScreenHeight(); + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW) / item_height; if (timerlist.size() < listmaxshow) - { - listmaxshow=timerlist.size(); - height = theight+listmaxshow*fheight*2+footerHeight; // recalc height - } + listmaxshow = timerlist.size(); + + height = header_height + item_height*listmaxshow + footer_height + OFFSET_SHADOW; // recalc height if (!timerlist.empty() && selected == (int)timerlist.size()) { - selected=timerlist.size()-1; + selected = timerlist.size() - 1; liststart = (selected/listmaxshow)*listmaxshow; } @@ -1084,6 +1083,12 @@ void CTimerList::hide() { if (visible) { + if (header) + { + header->kill(); + delete header; + header = NULL; + } frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); visible = false; } @@ -1129,12 +1134,12 @@ bool CTimerList::RemoteBoxSetup() void CTimerList::paintItem(int pos) { - int ypos = y+ theight+ pos*fheight*2; + int ypos = y + header_height + pos*item_height; - int real_width=width; + int real_width = width; if (timerlist.size() > listmaxshow) { - real_width -= SCROLLBAR_WIDTH; //scrollbar + real_width -= SCROLLBAR_WIDTH; } unsigned int currpos = liststart + pos; @@ -1153,10 +1158,16 @@ void CTimerList::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); //shadow - frameBuffer->paintBoxRel(x + width, ypos, OFFSET_SHADOW, 2*fheight, COL_SHADOW_PLUS_0); + frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); + + int line1_y = ypos + 1*font_height; + int line2_y = ypos + 2*font_height; + + int digit_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getMaxDigitWidth(); + int time_width = 8*digit_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(".. :"); // keep in sync with strftime-lines below if (currpos < timerlist.size()) { @@ -1169,33 +1180,34 @@ void CTimerList::paintItem(int pos) } char zAlarmTime[25] = {0}; struct tm *alarmTime = localtime(&(timer.alarmTime)); - strftime(zAlarmTime,20,"%d.%m. %H:%M",alarmTime); + strftime(zAlarmTime, 20, "%d.%m. %H:%M", alarmTime); char zStopTime[25] = {0}; struct tm *stopTime = localtime(&(timer.stopTime)); - strftime(zStopTime,20,"%d.%m. %H:%M",stopTime); - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, fw*12, zAlarmTime, color, fheight); - if (timer.stopTime != 0) - { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, fw*12, zStopTime, color, fheight); - } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+fheight, (real_width-fw*13)/2-5, convertTimerRepeat2String(timer.eventRepeat), color, fheight); + strftime(zStopTime, 20, "%d.%m. %H:%M", stopTime); + // paint start/stop times + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, line1_y, time_width, zAlarmTime, color, font_height); + if (timer.stopTime != 0) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, line2_y, time_width, zStopTime, color, font_height); + + // paint timer-type + std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID + time_width + OFFSET_INNER_MID, line1_y, real_width - time_width - 3*OFFSET_INNER_MID, t_type, color, font_height); + + // paint repeat-type/count + std::string t_repeat = convertTimerRepeat2String(timer.eventRepeat); if (timer.eventRepeat != CTimerd::TIMERREPEAT_ONCE) { - char srepeatcount[25] = {0}; if (timer.repeatCount == 0) - { - // Unicode 8734 (hex: 221E) not available in all fonts - //sprintf(srepeatcount,"∞"); - sprintf(srepeatcount,"00"); - } + t_repeat += ", oo"; // Unicode 8734 (hex: 221E) not available in all fonts else - sprintf(srepeatcount,"%ux",timer.repeatCount); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight); + t_repeat += ", " + to_string(timer.repeatCount) + "x"; } - std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, t_type, color, fheight); + int t_repeat_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(t_repeat); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + real_width - OFFSET_INNER_MID - t_repeat_width, line1_y, t_repeat_width, t_repeat, color, font_height); + + int icon_w, icon_h; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icon_w, &icon_h); // paint rec icon when recording in progress if ((timer.eventType == CTimerd::TIMER_RECORD) && (CRecordManager::getInstance()->RecordingStatus(timer.channel_id))) @@ -1205,23 +1217,14 @@ void CTimerList::paintItem(int pos) recinfo.eventID = timer.eventID; if (CRecordManager::getInstance()->IsRecording(&recinfo)) { - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); - if ((icol_w > 0) && (icol_h > 0)) - { - frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); - } + if (icon_w && icon_h) + frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + real_width - OFFSET_INNER_MID - icon_w, line1_y, font_height); } } - - if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) + else if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) { - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); - if ((icol_w > 0) && (icol_h > 0)) - { - frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); - } + if (icon_w && icon_h) + frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + real_width - OFFSET_INNER_MID - icon_w, line1_y, font_height); } std::string zAddData(""); @@ -1347,46 +1350,47 @@ void CTimerList::paintItem(int pos) default: {} } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+2*fheight, real_width-(fw*13+5), zAddData, color, fheight); + + // paint timer-name + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID + time_width + OFFSET_INNER_MID, line2_y, real_width - time_width - 3*OFFSET_INNER_MID, zAddData, color, font_height); + // LCD Display if (currpos == (unsigned) selected) { - std::string line1 = convertTimerType2String(timer.eventType); // UTF-8 - //std::string line2 = zAlarmTime; + std::string line1 = convertTimerType2String(timer.eventType); switch (timer.eventType) { - case CTimerd::TIMER_RECORD : - // line2+= " -"; - // line2+= zStopTime+6; - //case CTimerd::TIMER_NEXTPROGRAM : - case CTimerd::TIMER_ZAPTO : - { - line1 += ' '; - line1 += convertChannelId2String(timer.channel_id); // UTF-8 + case CTimerd::TIMER_RECORD : + case CTimerd::TIMER_ZAPTO : + { + line1 += ' '; + line1 += convertChannelId2String(timer.channel_id); + break; + } + case CTimerd::TIMER_STANDBY : + { + if (timer.standby_on) + line1 += " ON"; + else + line1 += " OFF"; + break; + } + default: + ; } - break; - case CTimerd::TIMER_STANDBY : - { - if (timer.standby_on) - line1+=" ON"; - else - line1+=" OFF"; - } - break; - default: - ; - } - CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); // UTF-8 - //CVFD::getInstance()->showMenuText(1, line2.c_str(), -1, true); // UTF-8 + CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); } } } void CTimerList::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); - header.enableClock(true, " %d.%m.%Y %H:%M "); - header.paint(CC_SAVE_SCREEN_NO); + if (header == NULL) + { + header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(LOCALE_TIMERLIST_NAME), NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); + header->enableClock(true, " %d.%m.%Y, %H:%M ", " %d.%m.%Y, %H.%M ", true); + } + header->paint(CC_SAVE_SCREEN_NO); } void CTimerList::paintFoot() @@ -1396,24 +1400,25 @@ void CTimerList::paintFoot() CTimerd::responseGetTimer* timer=&timerlist[selected]; if (timer != NULL) { - //replace info button with dummy if timer is not type REC or ZAP + //replace info button with dummy if timer is not type REC or ZAP if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_ZAPTO) //NI TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; else TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; } } - //shadow - frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + height - footerHeight, width, footerHeight + OFFSET_SHADOW, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); int c = TimerListButtonsCount; if (g_settings.timer_remotebox_ip.size() == 0) c--; // reduce play button + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + if (timerlist.empty()) - ::paintButtons(x, y + height - footerHeight, width, 2, &(TimerListButtons[1]), width); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, 2, &(TimerListButtons[1])); else - ::paintButtons(x, y + height - footerHeight, width, c, TimerListButtons, width); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, c, TimerListButtons); } void CTimerList::paint() @@ -1425,8 +1430,6 @@ void CTimerList::paint() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_TIMERLIST_NAME)); paintHead(); - frameBuffer->paintBoxRel(x, y + theight, width, height - theight - footerHeight, COL_MENUCONTENT_PLUS_0); //NI - paintFoot(); //NI for (unsigned int count=0; count Date: Tue, 20 Jun 2017 15:55:42 +0200 Subject: [PATCH 17/46] cc_frm_header: remove CComponentsHeaderLocalized() subclass use another constructor of CComponentsHeader() instead Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/92ceac6a5de9287ce1e2b6d3ef66b60167d1a01b Author: vanhofen Date: 2017-06-20 (Tue, 20 Jun 2017) Origin message was: ------------------ - cc_frm_header: remove CComponentsHeaderLocalized() subclass use another constructor of CComponentsHeader() instead --- src/gui/audioplayer.cpp | 2 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bookmarkmanager.cpp | 2 +- src/gui/components/cc_frm_header.cpp | 27 +++++++++------------ src/gui/components/cc_frm_header.h | 31 +++++++++--------------- src/gui/epgview.cpp | 9 ++++--- src/gui/motorcontrol.cpp | 2 +- src/gui/pictureviewer.cpp | 2 +- src/gui/scan.cpp | 4 +-- src/gui/timerlist.cpp | 2 +- src/gui/upnpbrowser.cpp | 2 +- 11 files changed, 37 insertions(+), 48 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index 75ac7e24c..6c3f02371 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1638,7 +1638,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeader 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); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index fc2eb5994..6c8486bc0 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -133,7 +133,7 @@ void CBEBouquetWidget::paint() void CBEBouquetWidget::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeaderLocalized::CC_BTN_EXIT); + CComponentsHeader header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeader::CC_BTN_EXIT); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index f91b47469..383ee2555 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -411,7 +411,7 @@ void CBookmarkManager::hide() //------------------------------------------------------------------------ void CBookmarkManager::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeader header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeader::CC_BTN_HELP); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 7a91fd8c5..a74875e72 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -65,21 +65,18 @@ CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const initVarHeader(x_pos, y_pos, w, h, caption, icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); } -CComponentsHeaderLocalized::CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h, - neutrino_locale_t caption_locale, - const std::string& icon_name, - const int& buttons, - CComponentsForm* parent, - int shadow_mode, - fb_pixel_t color_frame, - fb_pixel_t color_body, - fb_pixel_t color_shadow) - :CComponentsHeader( x_pos, y_pos, w, h, - g_Locale->getText(caption_locale), - icon_name, buttons, - parent, - shadow_mode, - color_frame, color_body, color_shadow){}; +CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t caption_locale, + const std::string& icon_name, + const int& buttons, + CComponentsForm* parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) +{ + initVarHeader(x_pos, y_pos, w, h, g_Locale->getText(caption_locale), icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); +}; void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 1ba972777..d054bf886 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -170,7 +170,17 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsHeader(CComponentsForm *parent = NULL); CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, const std::string& caption = std::string(), - const std::string& = std::string(), + const std::string& icon_name = std::string(), + const int& buttons = 0, + CComponentsForm *parent = NULL, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + + CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, + const std::string& icon_name = std::string(), const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, @@ -346,23 +356,4 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsChannelLogoScalable* getChannelLogoObject(){return cch_logo_obj;} }; -//! Sub class of CComponentsHeader. -/*! -CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows -Caption is defined with locales. -*/ -class CComponentsHeaderLocalized : public CComponentsHeader -{ - public: - CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, - const std::string& = "", - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); -}; - #endif diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 7fd2883de..1d759cc2d 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -883,14 +883,15 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // show the epg // header + logo - if (!header){ - header = new CComponentsHeader(sx, sy, ox, toph); + if (!header) + { + header = new CComponentsHeader(); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->enableClock(true, "%H:%M", "%H %M", true); - }else - header->setDimensionsAll(sx, sy, ox, toph); + } + header->setDimensionsAll(sx, sy, ox, toph); header->setCaptionFont(font_title); header->setCaption(epgData.title); diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 67adbf805..1b9e38e36 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -455,7 +455,7 @@ void CMotorControl::paintStatus() void CMotorControl::paintHead() { - CComponentsHeaderLocalized header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); + CComponentsHeader header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 4f7502b6b..8b61d9a5f 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -712,7 +712,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); + CComponentsHeader header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeader::CC_BTN_HELP); header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); #ifdef ENABLE_GUI_MOUNT diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 1709db61e..358cbd8bf 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -345,7 +345,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); } if(!test) { - CComponentsHeaderLocalized header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); + CComponentsHeader header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); header.paint(CC_SAVE_SCREEN_NO); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(0xFFFF); do { @@ -506,7 +506,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt) void CScanTs::paint(bool fortest) { - CComponentsHeaderLocalized header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); + CComponentsHeader header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); header.setCaptionAlignment(CCHeaderTypes::CC_TITLE_CENTER); header.paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ff4bb43a2..c40e7c004 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1387,7 +1387,7 @@ void CTimerList::paintHead() { if (header == NULL) { - header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(LOCALE_TIMERLIST_NAME), NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); + header = new CComponentsHeader(x, y, width, header_height, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); header->enableClock(true, " %d.%m.%Y, %H:%M ", " %d.%m.%Y, %H.%M ", true); } header->paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index c30b0b7ca..c1eb3e524 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -992,7 +992,7 @@ void CUpnpBrowserGui::paintDevices() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device"); // Head - CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + CComponentsHeader header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); From 9e625173a224db6d8285b0aeb06a6587074118fa Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 20 Jun 2017 16:25:52 +0200 Subject: [PATCH 18/46] timerlist: align header's clock format to the other header-clocks Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/c357993cb9608beb9f1ffb3438cf4592de06a139 Author: vanhofen Date: 2017-06-20 (Tue, 20 Jun 2017) Origin message was: ------------------ - timerlist: align header's clock format to the other header-clocks --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index c40e7c004..945bb63b9 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1388,7 +1388,7 @@ void CTimerList::paintHead() if (header == NULL) { header = new CComponentsHeader(x, y, width, header_height, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); - header->enableClock(true, " %d.%m.%Y, %H:%M ", " %d.%m.%Y, %H.%M ", true); + header->enableClock(true, " %d.%m.%Y, %H:%M ", " %d.%m.%Y, %H %M ", true); } header->paint(CC_SAVE_SCREEN_NO); } From 6a4d47260028437bbc6708f0841ca552ef6bb1f6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 20 Jun 2017 21:16:55 +0200 Subject: [PATCH 19/46] timermanager: don't set stoptime for timers without a stop-event Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a0a48335b54f579e3635853963e4e9d9a832ce90 Author: vanhofen Date: 2017-06-20 (Tue, 20 Jun 2017) Origin message was: ------------------ - timermanager: don't set stoptime for timers without a stop-event --- src/timerd/timermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index feb437eb5..3b610bbb0 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -332,7 +332,7 @@ int CTimerManager::modifyEvent(int peventID, time_t announceTime, time_t alarmTi CTimerEvent *event = events[peventID]; event->announceTime = announceTime; event->alarmTime = alarmTime; - event->stopTime = stopTime; + event->stopTime = (event->eventType == CTimerd::TIMER_RECORD) ? stopTime : 0; if(event->eventState==CTimerd::TIMERSTATE_PREANNOUNCE) event->eventState = CTimerd::TIMERSTATE_SCHEDULED; event->eventRepeat = evrepeat; From 49b94a015db47e7e47e0634595fd9d9a79d9dac4 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 20 Jun 2017 21:25:57 +0200 Subject: [PATCH 20/46] timerlist: add space between channelname and "(CI)" string Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/ba149575e8b9e95cf94c5e4e72bfee0a8a151b83 Author: vanhofen Date: 2017-06-20 (Tue, 20 Jun 2017) Origin message was: ------------------ - timerlist: add space between channelname and "(CI)" string --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 945bb63b9..ab6e728ab 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1235,7 +1235,7 @@ void CTimerList::paintItem(int pos) case CTimerd::TIMER_RECORD : { zAddData = convertChannelId2String(timer.channel_id); // UTF-8 - zAddData += timer.channel_ci?"(CI)":""; //NI + zAddData += timer.channel_ci ? " (CI)" : ""; //NI if (timer.apids != TIMERD_APIDS_CONF) { std::string sep = ""; From 37e730f7a8b32b243135936780ffa796f18871db Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 20 Jun 2017 22:13:49 +0200 Subject: [PATCH 21/46] moviebrowser: fix deletion of cursor_only movie via "menu" -> "yellow" Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3e053e7728c3d75e91dfbd87828fd534eddab09c Author: vanhofen Date: 2017-06-20 (Tue, 20 Jun 2017) Origin message was: ------------------ - moviebrowser: fix deletion of cursor_only movie via "menu" -> "yellow" --- src/gui/moviebrowser/mb.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 9bcf061cb..85cfcfbc8 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2583,13 +2583,20 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; - filelist_it = filelist.end(); - if (!cursor_only && getSelectedFiles(filelist, movielist)) - filelist_it = filelist.begin(); - if (filelist.empty()) { //just add the m_movieSelectionHandler + + if (cursor_only) + { + filelist.clear(); + movielist.clear(); + + // just add the m_movieSelectionHandler filelist.push_back(m_movieSelectionHandler->file); movielist.push_back(m_movieSelectionHandler); } + else + { + getSelectedFiles(filelist, movielist); + } MI_MOVIE_LIST dellist; MI_MOVIE_LIST::iterator dellist_it; From 7a10a093f7eccbea3089b5e573740130e95e5e74 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Tue, 20 Jun 2017 22:56:12 +0200 Subject: [PATCH 22/46] moviebrowser: clearify deletion-locale; add movie-title to menu Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/b6b4286c99f64d30f057f853c0659b122c99507b Author: vanhofen Date: 2017-06-20 (Tue, 20 Jun 2017) Origin message was: ------------------ - moviebrowser: clearify deletion-locale; add movie-title to menu --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/moviebrowser/mb.cpp | 6 +++--- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 10cc8e647..32850895e 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1853,6 +1853,7 @@ moviebrowser.cut_failed Fehler beim Schneiden. Sind Sprungmarken und genug freie moviebrowser.cutting Schneide Film, bitte warten ... moviebrowser.delete_all Alle markierten Filme ohne weitere Nachfrage löschen? moviebrowser.delete_info Lösche Dateien, bitte warten ... +moviebrowser.delete_movie Film löschen moviebrowser.delete_screenshot Lösche Screenshot? moviebrowser.dir Pfad moviebrowser.directories Verzeichnisse diff --git a/data/locale/english.locale b/data/locale/english.locale index 6f697d541..28b74cf62 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1853,6 +1853,7 @@ moviebrowser.cut_failed Cut failed, are there jump bookmarks and enough free spa moviebrowser.cutting Cutting movie, please wait ... moviebrowser.delete_all Delete all selected movies without any questions? moviebrowser.delete_info Delete files, please wait ... +moviebrowser.delete_movie Delete movie moviebrowser.delete_screenshot Delete screenshot? moviebrowser.dir Path moviebrowser.directories Directories diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 85cfcfbc8..63d0912c8 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3427,12 +3427,10 @@ int CMovieBrowser::showMovieCutMenu() movieCutMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD); CMenuForwarder *mf; -#if 0 mf = new CMenuForwarder(m_movieSelectionHandler->epgTitle, false); mf->setHint(NEUTRINO_ICON_HINT_MOVIE, NONEXISTANT_LOCALE); movieCutMenu.addItem(mf); movieCutMenu.addItem(GenericMenuSeparator); -#endif mf = new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_COPY_ONEFILE, true, NULL, this, "copy_onefile", CRCInput::RC_red); mf->setHint(NEUTRINO_ICON_HINT_MOVIE, LOCALE_MOVIEBROWSER_HINT_COPY_ONEFILE); @@ -3559,9 +3557,11 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green)); - mainMenu.addItem(new CMenuForwarder(LOCALE_FILEBROWSER_DELETE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_DELETE_MOVIE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); mainMenu.addItem(GenericMenuSeparatorLine); mainMenu.addItem(new CMenuForwarder(LOCALE_EPGPLUS_OPTIONS, true, NULL, &optionsMenu,NULL, CRCInput::RC_1)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, true, NULL, &dirMenu, NULL, CRCInput::RC_2)); diff --git a/src/system/locals.h b/src/system/locals.h index 590eb8b0d..7673ac49d 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1880,6 +1880,7 @@ typedef enum LOCALE_MOVIEBROWSER_CUTTING, LOCALE_MOVIEBROWSER_DELETE_ALL, LOCALE_MOVIEBROWSER_DELETE_INFO, + LOCALE_MOVIEBROWSER_DELETE_MOVIE, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, LOCALE_MOVIEBROWSER_DIR, LOCALE_MOVIEBROWSER_DIRECTORIES, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 6026eb803..67055ca4a 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1880,6 +1880,7 @@ const char * locale_real_names[] = "moviebrowser.cutting", "moviebrowser.delete_all", "moviebrowser.delete_info", + "moviebrowser.delete_movie", "moviebrowser.delete_screenshot", "moviebrowser.dir", "moviebrowser.directories", From 1d32d07224eb6690b8561f4a0247d260ec878d83 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 23/46] timerlist: small design reworks ... * re-align item contents * rename some variables * use CComponentsFooter * blinking clock in header (shameless stolen from TangoCash) Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/915410e5715f89a5713a73acc63f4da7bcaa45ab Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - timerlist: small design reworks ... * re-align item contents * rename some variables * use CComponentsFooter * blinking clock in header (shameless stolen from TangoCash) Signed-off-by: Thilo Graf --- src/gui/timerlist.cpp | 185 ++++++++++++++++++++++-------------------- src/gui/timerlist.h | 8 +- 2 files changed, 100 insertions(+), 93 deletions(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 2b6c5f59f..ffa203a09 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -272,11 +272,14 @@ CTimerList::CTimerList() visible = false; x = y = 0; width = height = 0; - fheight = theight = 0; - footerHeight = 0; + header_height = 0; + font_height = 0; + item_height = 0; + footer_height = 0; selected = 0; liststart = 0; listmaxshow = 0; + header = NULL; Timer = new CTimerdClient(); timerNew_message = ""; timerNew_pluginName = ""; @@ -672,27 +675,23 @@ void CTimerList::updateEvents(void) RemoteBoxTimerList (timerlist); sort(timerlist.begin(), timerlist.end()); - theight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); - fheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - //get footerHeight from paintButtons - footerHeight = ::paintButtons(TimerListButtons, TimerListButtonsCount, 0, 0, 0, 0, 0, false); + header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); + font_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); + item_height = 2*font_height; + footer_height = header_height; - //width = w_max(g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth()*56, 20); - width = frameBuffer->getScreenWidth()*0.9; - height = frameBuffer->getScreenHeight() - (2*theight); // max height - - listmaxshow = (height-theight)/(fheight*2); - height = theight+listmaxshow*fheight*2+footerHeight; // recalc height + width = frameBuffer->getScreenWidth()/100 * 90; + height = frameBuffer->getScreenHeight(); + listmaxshow = (height - header_height - footer_height - OFFSET_SHADOW) / item_height; if (timerlist.size() < listmaxshow) - { - listmaxshow=timerlist.size(); - height = theight+listmaxshow*fheight*2+footerHeight; // recalc height - } + listmaxshow = timerlist.size(); + + height = header_height + item_height*listmaxshow + footer_height + OFFSET_SHADOW; // recalc height if (!timerlist.empty() && selected == (int)timerlist.size()) { - selected=timerlist.size()-1; + selected = timerlist.size() - 1; liststart = (selected/listmaxshow)*listmaxshow; } @@ -1084,6 +1083,12 @@ void CTimerList::hide() { if (visible) { + if (header) + { + header->kill(); + delete header; + header = NULL; + } frameBuffer->paintBackgroundBoxRel(x, y, width + OFFSET_SHADOW, height + OFFSET_SHADOW); visible = false; } @@ -1129,12 +1134,12 @@ bool CTimerList::RemoteBoxSetup() void CTimerList::paintItem(int pos) { - int ypos = y+ theight+ pos*fheight*2; + int ypos = y + header_height + pos*item_height; - int real_width=width; + int real_width = width; if (timerlist.size() > listmaxshow) { - real_width -= SCROLLBAR_WIDTH; //scrollbar + real_width -= SCROLLBAR_WIDTH; } unsigned int currpos = liststart + pos; @@ -1153,43 +1158,50 @@ void CTimerList::paintItem(int pos) i_radius = RADIUS_LARGE; if (i_radius) - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, COL_MENUCONTENT_PLUS_0); - frameBuffer->paintBoxRel(x, ypos, real_width, 2*fheight, bgcolor, i_radius); + frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); + frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); //shadow - frameBuffer->paintBoxRel(x + width, ypos, OFFSET_SHADOW, 2*fheight, COL_SHADOW_PLUS_0); + frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); + + int line1_y = ypos + 1*font_height; + int line2_y = ypos + 2*font_height; + + int digit_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getMaxDigitWidth(); + int time_width = 8*digit_width + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(".. :"); // keep in sync with strftime-lines below if (currpos < timerlist.size()) { CTimerd::responseGetTimer & timer = timerlist[currpos]; char zAlarmTime[25] = {0}; struct tm *alarmTime = localtime(&(timer.alarmTime)); - strftime(zAlarmTime,20,"%d.%m. %H:%M",alarmTime); + strftime(zAlarmTime, 20, "%d.%m. %H:%M", alarmTime); char zStopTime[25] = {0}; struct tm *stopTime = localtime(&(timer.stopTime)); - strftime(zStopTime,20,"%d.%m. %H:%M",stopTime); - int fw = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getWidth(); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+fheight, fw*12, zAlarmTime, color, fheight); - if (timer.stopTime != 0) - { - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+10,ypos+2*fheight, fw*12, zStopTime, color, fheight); - } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+fheight, (real_width-fw*13)/2-5, convertTimerRepeat2String(timer.eventRepeat), color, fheight); + strftime(zStopTime, 20, "%d.%m. %H:%M", stopTime); + // paint start/stop times + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, line1_y, time_width, zAlarmTime, color, font_height); + if (timer.stopTime != 0) + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID, line2_y, time_width, zStopTime, color, font_height); + + // paint timer-type + std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID + time_width + OFFSET_INNER_MID, line1_y, real_width - time_width - 3*OFFSET_INNER_MID, t_type, color, font_height); + + // paint repeat-type/count + std::string t_repeat = convertTimerRepeat2String(timer.eventRepeat); if (timer.eventRepeat != CTimerd::TIMERREPEAT_ONCE) { - char srepeatcount[25] = {0}; if (timer.repeatCount == 0) - { - // Unicode 8734 (hex: 221E) not available in all fonts - //sprintf(srepeatcount,"∞"); - sprintf(srepeatcount,"00"); - } + t_repeat += ", oo"; // Unicode 8734 (hex: 221E) not available in all fonts else - sprintf(srepeatcount,"%ux",timer.repeatCount); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*23)/2,ypos+fheight, (real_width-fw*13)/2-5, srepeatcount, color, fheight); + t_repeat += ", " + to_string(timer.repeatCount) + "x"; } - std::string t_type = (timer.eventType == CTimerd::TIMER_REMOTEBOX) ? std::string(convertTimerType2String(timer.eventType)) + " (" + std::string(timer.remotebox_name) + ")" : convertTimerType2String(timer.eventType); - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13+(real_width-fw*13)/2,ypos+fheight, (real_width-fw*13)/2-5, t_type, color, fheight); + int t_repeat_width = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(t_repeat); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + real_width - OFFSET_INNER_MID - t_repeat_width, line1_y, t_repeat_width, t_repeat, color, font_height); + + int icon_w, icon_h; + frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icon_w, &icon_h); // paint rec icon when recording in progress if ((timer.eventType == CTimerd::TIMER_RECORD) && (CRecordManager::getInstance()->RecordingStatus(timer.channel_id))) @@ -1199,23 +1211,14 @@ void CTimerList::paintItem(int pos) recinfo.eventID = timer.eventID; if (CRecordManager::getInstance()->IsRecording(&recinfo)) { - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); - if ((icol_w > 0) && (icol_h > 0)) - { - frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); - } + if (icon_w && icon_h) + frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + real_width - OFFSET_INNER_MID - icon_w, line1_y, font_height); } } - - if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) + else if ((timer.eventType == CTimerd::TIMER_REMOTEBOX) && timer.eventState == CTimerd::TIMERSTATE_ISRUNNING) { - int icol_w, icol_h; - frameBuffer->getIconSize(NEUTRINO_ICON_REC, &icol_w, &icol_h); - if ((icol_w > 0) && (icol_h > 0)) - { - frameBuffer->paintIcon(NEUTRINO_ICON_REC, (x + real_width) - (icol_w + 8), ypos, 2*fheight); - } + if (icon_w && icon_h) + frameBuffer->paintIcon(NEUTRINO_ICON_REC, x + real_width - OFFSET_INNER_MID - icon_w, line1_y, font_height); } std::string zAddData(""); @@ -1340,46 +1343,47 @@ void CTimerList::paintItem(int pos) default: {} } - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x+fw*13,ypos+2*fheight, real_width-(fw*13+5), zAddData, color, fheight); + + // paint timer-name + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(x + OFFSET_INNER_MID + time_width + OFFSET_INNER_MID, line2_y, real_width - time_width - 3*OFFSET_INNER_MID, zAddData, color, font_height); + // LCD Display if (currpos == (unsigned) selected) { - std::string line1 = convertTimerType2String(timer.eventType); // UTF-8 - //std::string line2 = zAlarmTime; + std::string line1 = convertTimerType2String(timer.eventType); switch (timer.eventType) { - case CTimerd::TIMER_RECORD : - // line2+= " -"; - // line2+= zStopTime+6; - //case CTimerd::TIMER_NEXTPROGRAM : - case CTimerd::TIMER_ZAPTO : - { - line1 += ' '; - line1 += convertChannelId2String(timer.channel_id); // UTF-8 + case CTimerd::TIMER_RECORD : + case CTimerd::TIMER_ZAPTO : + { + line1 += ' '; + line1 += convertChannelId2String(timer.channel_id); + break; + } + case CTimerd::TIMER_STANDBY : + { + if (timer.standby_on) + line1 += " ON"; + else + line1 += " OFF"; + break; + } + default: + ; } - break; - case CTimerd::TIMER_STANDBY : - { - if (timer.standby_on) - line1+=" ON"; - else - line1+=" OFF"; - } - break; - default: - ; - } - CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); // UTF-8 - //CVFD::getInstance()->showMenuText(1, line2.c_str(), -1, true); // UTF-8 + CVFD::getInstance()->showMenuText(0, line1.c_str(), -1, true); } } } void CTimerList::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); - header.enableClock(true, " %d.%m.%Y %H:%M "); - header.paint(CC_SAVE_SCREEN_NO); + if (header == NULL) + { + header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(LOCALE_TIMERLIST_NAME), NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); + header->enableClock(true, " %d.%m.%Y, %H:%M ", " %d.%m.%Y, %H.%M ", true); + } + header->paint(CC_SAVE_SCREEN_NO); } void CTimerList::paintFoot() @@ -1389,24 +1393,25 @@ void CTimerList::paintFoot() CTimerd::responseGetTimer* timer=&timerlist[selected]; if (timer != NULL) { - //replace info button with dummy if timer is not type REC or ZAP + //replace info button with dummy if timer is not type REC or ZAP if (timer->eventType == CTimerd::TIMER_RECORD || timer->eventType == CTimerd::TIMER_REMOTEBOX || timer->eventType == CTimerd::TIMER_ZAPTO) TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_INFO_SMALL; else TimerListButtons[4].button = NEUTRINO_ICON_BUTTON_DUMMY_SMALL; } } - //shadow - frameBuffer->paintBoxRel(x + OFFSET_SHADOW, y + height - footerHeight, width, footerHeight + OFFSET_SHADOW, COL_SHADOW_PLUS_0, RADIUS_LARGE, CORNER_BOTTOM); int c = TimerListButtonsCount; if (g_settings.timer_remotebox_ip.size() == 0) c--; // reduce play button + CComponentsFooter footer; + footer.enableShadow(CC_SHADOW_ON, -1, true); + if (timerlist.empty()) - ::paintButtons(x, y + height - footerHeight, width, 2, &(TimerListButtons[1]), width); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, 2, &(TimerListButtons[1])); else - ::paintButtons(x, y + height - footerHeight, width, c, TimerListButtons, width); + footer.paintButtons(x, y + height - OFFSET_SHADOW - footer_height, width, footer_height, c, TimerListButtons); } void CTimerList::paint() @@ -1428,7 +1433,7 @@ void CTimerList::paint() int total_pages; int current_page; getScrollBarData(&total_pages, ¤t_page, timerlist.size(), listmaxshow, selected); - paintScrollBar(x + width - SCROLLBAR_WIDTH, y + theight, SCROLLBAR_WIDTH, 2*fheight*listmaxshow, total_pages, current_page); + paintScrollBar(x + width - SCROLLBAR_WIDTH, y + header_height, SCROLLBAR_WIDTH, item_height*listmaxshow, total_pages, current_page); } paintFoot(); diff --git a/src/gui/timerlist.h b/src/gui/timerlist.h index d58b0a8a9..e8a30af1f 100644 --- a/src/gui/timerlist.h +++ b/src/gui/timerlist.h @@ -51,13 +51,15 @@ class CTimerList : public CMenuTarget, public CListHelpers int y; int width; int height; - int fheight; // fontheight content - int theight; // fontheight titel - int footerHeight; + int font_height; + int item_height; + int header_height; + int footer_height; int selected; int liststart; unsigned int listmaxshow; bool visible; + CComponentsHeader *header; int httpConnectTimeout; CTimerdClient *Timer; From a78db68a637161324d6297ff657b459010d5c4c1 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 24/46] CTimerList: partial revert of - timerlist: small design reworks ... removed: * blinking clock in header (shameless stolen from TangoCash) Not really required here and before we can enable a ticking clock here, clock must be disabled on opened context menues, because the timerlist context menus will be damaged. This needs a separate handling. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/06c8fd33f8e66a1733d2b30040b1bf9009a6e12a Author: Thilo Graf Date: 2017-06-21 (Wed, 21 Jun 2017) --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ffa203a09..ca48a92f6 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1381,7 +1381,7 @@ void CTimerList::paintHead() if (header == NULL) { header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(LOCALE_TIMERLIST_NAME), NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); - header->enableClock(true, " %d.%m.%Y, %H:%M ", " %d.%m.%Y, %H.%M ", true); + header->enableClock(true, " %d.%m.%Y - %H:%M ", NULL, false); } header->paint(CC_SAVE_SCREEN_NO); } From 0c076425eb27bf3e6249cc7dd325f2681a2e6b7f Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 25/46] cc_frm_header: remove CComponentsHeaderLocalized() subclass use another constructor of CComponentsHeader() instead Signed-off-by: Thilo Graf Good idea, this I had already in mind too. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/980e293517accca2adf09a09948374933ff3ec35 Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - cc_frm_header: remove CComponentsHeaderLocalized() subclass use another constructor of CComponentsHeader() instead Signed-off-by: Thilo Graf Good idea, this I had already in mind too. --- src/gui/audioplayer.cpp | 2 +- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bookmarkmanager.cpp | 2 +- src/gui/components/cc_frm_header.cpp | 27 +++++++++------------ src/gui/components/cc_frm_header.h | 31 +++++++++--------------- src/gui/epgview.cpp | 9 ++++--- src/gui/motorcontrol.cpp | 2 +- src/gui/pictureviewer.cpp | 2 +- src/gui/scan.cpp | 4 +-- src/gui/timerlist.cpp | 2 +- src/gui/upnpbrowser.cpp | 2 +- 11 files changed, 37 insertions(+), 48 deletions(-) diff --git a/src/gui/audioplayer.cpp b/src/gui/audioplayer.cpp index f3ff5f8b6..91d0a3085 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1602,7 +1602,7 @@ void CAudioPlayerGui::paintHead() if (!m_show_playlist || m_screensaver) return; - CComponentsHeaderLocalized header(m_x, m_y + m_title_height + OFFSET_SHADOW + OFFSET_INTER, m_width, m_header_height, LOCALE_AUDIOPLAYER_HEAD, NEUTRINO_ICON_AUDIO); + CComponentsHeader 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); diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index fc2eb5994..6c8486bc0 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -133,7 +133,7 @@ void CBEBouquetWidget::paint() void CBEBouquetWidget::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeaderLocalized::CC_BTN_EXIT); + CComponentsHeader header(x, y, width, theight, LOCALE_BOUQUETLIST_HEAD, "" /*no header icon*/, CComponentsHeader::CC_BTN_EXIT); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/bookmarkmanager.cpp b/src/gui/bookmarkmanager.cpp index f91b47469..383ee2555 100644 --- a/src/gui/bookmarkmanager.cpp +++ b/src/gui/bookmarkmanager.cpp @@ -411,7 +411,7 @@ void CBookmarkManager::hide() //------------------------------------------------------------------------ void CBookmarkManager::paintHead() { - CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeader header(x, y, width, theight, LOCALE_BOOKMARKMANAGER_NAME, NEUTRINO_ICON_BOOKMARK_MANAGER, CComponentsHeader::CC_BTN_HELP); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 7a91fd8c5..a74875e72 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -65,21 +65,18 @@ CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const initVarHeader(x_pos, y_pos, w, h, caption, icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); } -CComponentsHeaderLocalized::CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h, - neutrino_locale_t caption_locale, - const std::string& icon_name, - const int& buttons, - CComponentsForm* parent, - int shadow_mode, - fb_pixel_t color_frame, - fb_pixel_t color_body, - fb_pixel_t color_shadow) - :CComponentsHeader( x_pos, y_pos, w, h, - g_Locale->getText(caption_locale), - icon_name, buttons, - parent, - shadow_mode, - color_frame, color_body, color_shadow){}; +CComponentsHeader::CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, + neutrino_locale_t caption_locale, + const std::string& icon_name, + const int& buttons, + CComponentsForm* parent, + int shadow_mode, + fb_pixel_t color_frame, + fb_pixel_t color_body, + fb_pixel_t color_shadow) +{ + initVarHeader(x_pos, y_pos, w, h, g_Locale->getText(caption_locale), icon_name, buttons, parent, shadow_mode, color_frame, color_body, color_shadow); +}; void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const int& w, const int& h, const std::string& caption, diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index e1dd05f66..1d634c3cd 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -170,7 +170,17 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsHeader(CComponentsForm *parent = NULL); CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, const std::string& caption = std::string(), - const std::string& = std::string(), + const std::string& icon_name = std::string(), + const int& buttons = 0, + CComponentsForm *parent = NULL, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); + + CComponentsHeader( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, + neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, + const std::string& icon_name = std::string(), const int& buttons = 0, CComponentsForm *parent = NULL, int shadow_mode = CC_SHADOW_OFF, @@ -346,23 +356,4 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen, CCHeaderT CComponentsChannelLogoScalable* getChannelLogoObject(){return cch_logo_obj;} }; -//! Sub class of CComponentsHeader. -/*! -CComponentsHeaderLocalized provides prepared items like icon, caption and context button icons, mostly for usage in menues or simple windows -Caption is defined with locales. -*/ -class CComponentsHeaderLocalized : public CComponentsHeader -{ - public: - CComponentsHeaderLocalized( const int& x_pos, const int& y_pos, const int& w, const int& h = 0, - neutrino_locale_t caption_locale = NONEXISTANT_LOCALE, - const std::string& = "", - const int& buttons = 0, - CComponentsForm *parent = NULL, - int shadow_mode = CC_SHADOW_OFF, - fb_pixel_t color_frame = COL_FRAME_PLUS_0, - fb_pixel_t color_body = COL_MENUHEAD_PLUS_0, - fb_pixel_t color_shadow = COL_SHADOW_PLUS_0); -}; - #endif diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index b696c54ea..f2d5d4adb 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -841,14 +841,15 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // show the epg // header + logo - if (!header){ - header = new CComponentsHeader(sx, sy, ox, toph); + if (!header) + { + header = new CComponentsHeader(); header->setColorBody(COL_MENUHEAD_PLUS_0); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0, g_settings.theme.menu_Head_gradient_direction); header->enableClock(true, "%H:%M", "%H %M", true); - }else - header->setDimensionsAll(sx, sy, ox, toph); + } + header->setDimensionsAll(sx, sy, ox, toph); header->setCaptionFont(font_title); header->setCaption(epgData.title); diff --git a/src/gui/motorcontrol.cpp b/src/gui/motorcontrol.cpp index 67adbf805..1b9e38e36 100644 --- a/src/gui/motorcontrol.cpp +++ b/src/gui/motorcontrol.cpp @@ -455,7 +455,7 @@ void CMotorControl::paintStatus() void CMotorControl::paintHead() { - CComponentsHeaderLocalized header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); + CComponentsHeader header(x, y, width, hheight, LOCALE_MOTORCONTROL_HEAD); header.paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 9ccb9952f..a7f19f1ef 100644 --- a/src/gui/pictureviewer.cpp +++ b/src/gui/pictureviewer.cpp @@ -701,7 +701,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); + CComponentsHeader header(x, y, width, header_height, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeader::CC_BTN_HELP); header.enableShadow(CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); #ifdef ENABLE_GUI_MOUNT diff --git a/src/gui/scan.cpp b/src/gui/scan.cpp index 1709db61e..358cbd8bf 100644 --- a/src/gui/scan.cpp +++ b/src/gui/scan.cpp @@ -345,7 +345,7 @@ int CScanTs::exec(CMenuTarget* /*parent*/, const std::string & actionKey) perror(NEUTRINO_SCAN_STOP_SCRIPT " failed"); } if(!test) { - CComponentsHeaderLocalized header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); + CComponentsHeader header(x, y, width, hheight, success ? LOCALE_SCANTS_FINISHED : LOCALE_SCANTS_FAILED); header.paint(CC_SAVE_SCREEN_NO); uint64_t timeoutEnd = CRCInput::calcTimeoutEnd(0xFFFF); do { @@ -506,7 +506,7 @@ void CScanTs::paintLine(int px, int py, int w, const char * const txt) void CScanTs::paint(bool fortest) { - CComponentsHeaderLocalized header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); + CComponentsHeader header(x, y, width, hheight, fortest ? LOCALE_SCANTS_TEST : LOCALE_SCANTS_HEAD); header.setCaptionAlignment(CCHeaderTypes::CC_TITLE_CENTER); header.paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index ca48a92f6..5fe4586b3 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1380,7 +1380,7 @@ void CTimerList::paintHead() { if (header == NULL) { - header = new CComponentsHeader(x, y, width, header_height, g_Locale->getText(LOCALE_TIMERLIST_NAME), NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); + header = new CComponentsHeader(x, y, width, header_height, LOCALE_TIMERLIST_NAME, NEUTRINO_ICON_TIMER, CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT, NULL, CC_SHADOW_ON); header->enableClock(true, " %d.%m.%Y - %H:%M ", NULL, false); } header->paint(CC_SAVE_SCREEN_NO); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index b8c3d5878..dbfcf8aa7 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -986,7 +986,7 @@ void CUpnpBrowserGui::paintDevices() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, "Select UPnP Device"); // Head - CComponentsHeaderLocalized header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); + CComponentsHeader header(m_x, m_header_y, m_width, m_header_height, LOCALE_UPNPBROWSER_HEAD, NEUTRINO_ICON_UPNP); header.enableShadow( CC_SHADOW_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT, -1, true); if (CNeutrinoApp::getInstance()->isMuted()) //TODO: consider mute mode on runtime header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); From dc9d583a7743df009fbaeb2acf610d0779ee22cb Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 26/46] timermanager: don't set stoptime for timers without a stop-event Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/57ff49c32133e14903aae44c1b769aefd25776c0 Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - timermanager: don't set stoptime for timers without a stop-event Signed-off-by: Thilo Graf --- src/timerd/timermanager.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 8998ea2d2..82051b394 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -332,7 +332,7 @@ int CTimerManager::modifyEvent(int peventID, time_t announceTime, time_t alarmTi CTimerEvent *event = events[peventID]; event->announceTime = announceTime; event->alarmTime = alarmTime; - event->stopTime = stopTime; + event->stopTime = (event->eventType == CTimerd::TIMER_RECORD) ? stopTime : 0; if(event->eventState==CTimerd::TIMERSTATE_PREANNOUNCE) event->eventState = CTimerd::TIMERSTATE_SCHEDULED; event->eventRepeat = evrepeat; From 154ec086f07a08af757c44ad566de7f95fdbf154 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 27/46] moviebrowser: fix deletion of cursor_only movie via "menu" -> "yellow" Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8b4f34857f1c3d6715e45944f1c4a7d90c696566 Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - moviebrowser: fix deletion of cursor_only movie via "menu" -> "yellow" Signed-off-by: Thilo Graf --- src/gui/moviebrowser/mb.cpp | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 7a881f479..38625fe4e 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2479,13 +2479,20 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; - filelist_it = filelist.end(); - if (!cursor_only && getSelectedFiles(filelist, movielist)) - filelist_it = filelist.begin(); - if (filelist.empty()) { //just add the m_movieSelectionHandler + + if (cursor_only) + { + filelist.clear(); + movielist.clear(); + + // just add the m_movieSelectionHandler filelist.push_back(m_movieSelectionHandler->file); movielist.push_back(m_movieSelectionHandler); } + else + { + getSelectedFiles(filelist, movielist); + } MI_MOVIE_LIST dellist; MI_MOVIE_LIST::iterator dellist_it; From 8d10fdd53be3b89c84c7bbbecb67d93641200d60 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 28/46] moviebrowser: clearify deletion-locale; add movie-title to menu Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/37f930686256738cafebcedac0298600f38a3ccd Author: vanhofen Date: 2017-06-21 (Wed, 21 Jun 2017) Origin message was: ------------------ - moviebrowser: clearify deletion-locale; add movie-title to menu Signed-off-by: Thilo Graf --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/moviebrowser/mb.cpp | 6 +++--- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 7 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 3148cb971..6aaf0e4eb 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -1669,6 +1669,7 @@ moviebrowser.cut_failed Fehler beim Schneiden. Sind Sprungmarken und genug freie moviebrowser.cutting Schneide Film, bitte warten ... moviebrowser.delete_all Alle markierten Filme ohne weitere Nachfrage löschen? moviebrowser.delete_info Lösche Dateien, bitte warten ... +moviebrowser.delete_movie Film löschen moviebrowser.delete_screenshot Lösche Screenshot? moviebrowser.dir Pfad moviebrowser.directories Verzeichnisse diff --git a/data/locale/english.locale b/data/locale/english.locale index 11e584539..cc4e86104 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -1669,6 +1669,7 @@ moviebrowser.cut_failed Cut failed, are there jump bookmarks and enough free spa moviebrowser.cutting Cutting movie, please wait ... moviebrowser.delete_all Delete all selected movies without any questions? moviebrowser.delete_info Delete files, please wait ... +moviebrowser.delete_movie Delete movie moviebrowser.delete_screenshot Delete screenshot? moviebrowser.dir Path moviebrowser.directories Directories diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 38625fe4e..f513de08a 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -3319,12 +3319,10 @@ int CMovieBrowser::showMovieCutMenu() movieCutMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD); CMenuForwarder *mf; -#if 0 mf = new CMenuForwarder(m_movieSelectionHandler->epgTitle, false); mf->setHint(NEUTRINO_ICON_HINT_MOVIE, NONEXISTANT_LOCALE); movieCutMenu.addItem(mf); movieCutMenu.addItem(GenericMenuSeparator); -#endif mf = new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_COPY_ONEFILE, true, NULL, this, "copy_onefile", CRCInput::RC_red); mf->setHint(NEUTRINO_ICON_HINT_MOVIE, LOCALE_MOVIEBROWSER_HINT_COPY_ONEFILE); @@ -3451,9 +3449,11 @@ bool CMovieBrowser::showMenu(bool calledExternally) if (!calledExternally) { CMenuWidget mainMenu(LOCALE_MOVIEBROWSER_HEAD, NEUTRINO_ICON_MOVIEPLAYER); mainMenu.addIntroItems(LOCALE_MOVIEBROWSER_MENU_MAIN_HEAD); + mainMenu.addItem(new CMenuForwarder(m_movieSelectionHandler->epgTitle, false)); + mainMenu.addItem(GenericMenuSeparator); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_INFO_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_info_menu", CRCInput::RC_red)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_CUT_HEAD, (m_movieSelectionHandler != NULL), NULL, this, "show_movie_cut_menu", CRCInput::RC_green)); - mainMenu.addItem(new CMenuForwarder(LOCALE_FILEBROWSER_DELETE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); + mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_DELETE_MOVIE, (m_movieSelectionHandler != NULL), NULL, this, "delete_movie", CRCInput::RC_yellow)); mainMenu.addItem(GenericMenuSeparatorLine); mainMenu.addItem(new CMenuForwarder(LOCALE_EPGPLUS_OPTIONS, true, NULL, &optionsMenu,NULL, CRCInput::RC_1)); mainMenu.addItem(new CMenuForwarder(LOCALE_MOVIEBROWSER_MENU_DIRECTORIES_HEAD, true, NULL, &dirMenu, NULL, CRCInput::RC_2)); diff --git a/src/system/locals.h b/src/system/locals.h index a7147a146..f62dff5e9 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -1696,6 +1696,7 @@ typedef enum LOCALE_MOVIEBROWSER_CUTTING, LOCALE_MOVIEBROWSER_DELETE_ALL, LOCALE_MOVIEBROWSER_DELETE_INFO, + LOCALE_MOVIEBROWSER_DELETE_MOVIE, LOCALE_MOVIEBROWSER_DELETE_SCREENSHOT, LOCALE_MOVIEBROWSER_DIR, LOCALE_MOVIEBROWSER_DIRECTORIES, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index adb7a51b0..ea6d87aac 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -1696,6 +1696,7 @@ const char * locale_real_names[] = "moviebrowser.cutting", "moviebrowser.delete_all", "moviebrowser.delete_info", + "moviebrowser.delete_movie", "moviebrowser.delete_screenshot", "moviebrowser.dir", "moviebrowser.directories", From cf6c992cad16627de4fdcd54d5c9d481d3467b5c Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 29/46] cc_types.h: add more shadow defines Allows compact style on use for arguments in methods. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/aa92fc525f040bb4f9eb601e1c990e251f19ea5f Author: Thilo Graf Date: 2017-06-21 (Wed, 21 Jun 2017) --- src/gui/components/cc_types.h | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index d73bd1549..3c32c0275 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -201,12 +201,16 @@ typedef struct button_label_cc #define CC_WIDTH_MIN CFrameBuffer::getInstance()->scale2Res(16) #define CC_HEIGHT_MIN CC_WIDTH_MIN +//shadow defines #define CC_SHADOW_OFF 0x0 #define CC_SHADOW_RIGHT 0x2 #define CC_SHADOW_BOTTOM 0x4 #define CC_SHADOW_CORNER_BOTTOM_LEFT 0x8 #define CC_SHADOW_CORNER_BOTTOM_RIGHT 0x10 #define CC_SHADOW_CORNER_TOP_RIGHT 0x20 +//prepared combined shadow defines +#define CC_SHADOW_RIGHT_CORNER_ALL CC_SHADOW_RIGHT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT +#define CC_SHADOW_BOTTOM_CORNER_ALL CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_BOTTOM_LEFT #define CC_SHADOW_ON CC_SHADOW_RIGHT | CC_SHADOW_BOTTOM | CC_SHADOW_CORNER_BOTTOM_LEFT | CC_SHADOW_CORNER_BOTTOM_RIGHT | CC_SHADOW_CORNER_TOP_RIGHT #define CC_SAVE_SCREEN_YES true From 5961fcc0a721776f6c60928f99e6ddec5acb9a93 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 21 Jun 2017 10:31:22 +0200 Subject: [PATCH 30/46] EpgPlus: fix wrong shadow parameter for scrollbar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/579a73f91bdbfe7cd44a608a70d8d5510a9a9a20 Author: Thilo Graf Date: 2017-06-21 (Wed, 21 Jun 2017) --- src/gui/epgplus.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/epgplus.cpp b/src/gui/epgplus.cpp index 1c4107a65..bcece667b 100644 --- a/src/gui/epgplus.cpp +++ b/src/gui/epgplus.cpp @@ -1443,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, CC_SHADOW_ON); + paintScrollBar(this->sliderX, this->sliderY, this->sliderWidth, this->sliderHeight, total_pages, current_page, CC_SHADOW_RIGHT_CORNER_ALL); } // -- EPG+ Menue Handler Class From 663773d6772c4fa7309d665bda04c258fcf94551 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sat, 24 Jun 2017 09:16:02 +0200 Subject: [PATCH 31/46] timerlist: re-add by mistake removed commit 8ef59f6 Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/6e7bb1c50599c85a544b9b1dcc9e6f297fd02c30 Author: vanhofen Date: 2017-06-24 (Sat, 24 Jun 2017) Origin message was: ------------------ - timerlist: re-add by mistake removed commit 8ef59f6 --- src/gui/timerlist.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 0d18578dd..e2846e205 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1430,6 +1430,9 @@ void CTimerList::paint() CVFD::getInstance()->setMode(CVFD::MODE_MENU_UTF8, g_Locale->getText(LOCALE_TIMERLIST_NAME)); paintHead(); + // paint plain background and footer first to avoid flicker effects while timerlist construction + frameBuffer->paintBoxRel(x, y + header_height, width, item_height*listmaxshow, COL_MENUCONTENT_PLUS_0); + paintFoot(); for (unsigned int count=0; count Date: Sat, 24 Jun 2017 11:12:08 +0200 Subject: [PATCH 32/46] timerlist: add separationline to items Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2709af5f8a300e0cabbb1ff2d662ee12b7035d43 Author: vanhofen Date: 2017-06-24 (Sat, 24 Jun 2017) Origin message was: ------------------ - timerlist: add separationline to items --- src/gui/timerlist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index e2846e205..2d1b8cb99 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -677,7 +677,7 @@ void CTimerList::updateEvents(void) header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); font_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - item_height = 2*font_height; + item_height = 2*font_height + 1; // + 1 for separationline footer_height = header_height; width = frameBuffer->getScreenWidth()/100 * 90; @@ -1160,6 +1160,8 @@ void CTimerList::paintItem(int pos) if (i_radius) frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); + // separationline + frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); //shadow frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); From 3b84c0a7ae63ac9001af3f86285f823ce93503d7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 11:49:17 +0200 Subject: [PATCH 33/46] timerlist: fix compiler-warning (comparison signed/unsigned int) Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/28b606c19f8a50c81841272fd774ff87dfb5d0d8 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - timerlist: fix compiler-warning (comparison signed/unsigned int) --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 2d1b8cb99..a3465fa9a 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1161,7 +1161,7 @@ void CTimerList::paintItem(int pos) frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); // separationline - frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); + frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == (int) listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); //shadow frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); From 15e33337a6982fa0a206a319636c84f66d9a0cf2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 11:49:17 +0200 Subject: [PATCH 34/46] moviebrowser: fix deletion of non-marked movies via mute-key Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/895aa1ca8cbd6ecf4f254c361a6bec633e9483f1 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - moviebrowser: fix deletion of non-marked movies via mute-key --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 63d0912c8..88226cbd5 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2584,7 +2584,7 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; - if (cursor_only) + if (cursor_only || (filelist.empty() || movielist.empty())) { filelist.clear(); movielist.clear(); From d6b7d95600b418a3bd16a9d4a75d72f613cfa6c9 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 26 Jun 2017 11:53:59 +0200 Subject: [PATCH 35/46] lib/libtuxtxt/tuxtxt.cpp avoid segfault, FIXME Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7aec84d124b6040deaa306d6980ffdc7463784e8 Author: Jacek Jendrzej Date: 2017-06-26 (Mon, 26 Jun 2017) --- lib/libtuxtxt/tuxtxt.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/libtuxtxt/tuxtxt.cpp b/lib/libtuxtxt/tuxtxt.cpp index 714494681..d5d093a6a 100644 --- a/lib/libtuxtxt/tuxtxt.cpp +++ b/lib/libtuxtxt/tuxtxt.cpp @@ -58,6 +58,10 @@ fb_pixel_t *getFBp(int *y) void FillRect(int x, int y, int w, int h, int color) { + if(color < 0 || SIZECOLTABLE < color){ + printf("FIXME array size %i color %i not in range\n",SIZECOLTABLE,color); + return; + } fb_pixel_t *p = getFBp(&y); MARK_FB(x, y, w, h); p += x + y * stride; From 2ed4784333e5952d75c913f8911b10fb5ba7bbf7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 15:32:32 +0200 Subject: [PATCH 36/46] Revert "- cc_frm_footer: auto-calc label_width by default" This reverts commit e259a9dd0790f4278d0b6ce18bbdace5bdba1ac0. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/5cbdf990fb71388d82af41ca8537f71415f084a9 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index e5badffec..74b48d754 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -336,7 +336,7 @@ void CComponentsFooter::paintButtons(const int& x_pos, this->setDimensionsAll(x_pos, y_pos, w, h); this->setButtonFont(font); this->setContextButton(context_buttons); - this->setButtonLabels(content, label_count, 0, label_width ? label_width : w/label_count); + this->setButtonLabels(content, label_count, 0, label_width); this->paint(do_save_bg); } From 17aa5edad9f564abe18f32254d54e142bf272fa2 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 17:40:30 +0200 Subject: [PATCH 37/46] bouqueteditor: use default font for CComponentsFooter Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7fef066dfe33b5dbc6d5728bea8171f160d8622d Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - bouqueteditor: use default font for CComponentsFooter --- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bedit/bouqueteditor_chanselect.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 6c8486bc0..a5b2d6ebc 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -150,7 +150,7 @@ const struct button_label CBEBouquetWidgetButtons[6] = void CBEBouquetWidget::paintFoot() { size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]); - footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID, 0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); + footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID); } void CBEBouquetWidget::hide() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 8618ffca5..1b405ae83 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -184,7 +184,7 @@ const struct button_label CBEChannelWidgetButtons[6] = void CBEChannelWidget::paintFoot() { size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]); - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID, 0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID); } std::string CBEChannelWidget::getInfoText(int index) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 87227e8df..e9ee12385 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -251,7 +251,7 @@ void CBEChannelSelectWidget::paintFoot() break; } - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-20); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-2*OFFSET_INNER_MID); } std::string CBEChannelSelectWidget::getInfoText(int index) From 0e522bb6e641963dc7bded006e615b8270986844 Mon Sep 17 00:00:00 2001 From: Jacek Jendrzej Date: Mon, 26 Jun 2017 19:23:23 +0200 Subject: [PATCH 38/46] init pre post Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/4bdacf39c81a89e07dd7f5399a88217f7030c303 Author: Jacek Jendrzej Date: 2017-06-26 (Mon, 26 Jun 2017) --- src/gui/record_setup.cpp | 2 +- src/gui/timerlist.cpp | 2 +- src/timerd/timerd.cpp | 2 +- src/timerd/timermanager.cpp | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/gui/record_setup.cpp b/src/gui/record_setup.cpp index 49ed97d86..fae191c0e 100644 --- a/src/gui/record_setup.cpp +++ b/src/gui/record_setup.cpp @@ -310,7 +310,7 @@ int CRecordSetup::showRecordSetup() void CRecordSetup::showRecordTimerSetup(CMenuWidget *menu_timersettings) { //recording start/end correcture - int pre,post; + int pre = 0,post = 0; g_Timerd->getRecordingSafety(pre,post); g_settings.record_safety_time_before = pre/60; g_settings.record_safety_time_after = post/60; diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 5fe4586b3..601ae3981 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -442,7 +442,7 @@ int CTimerList::exec(CMenuTarget* parent, const std::string & actionKey) } else if ((strcmp(key, "send_remotetimer") == 0) && RemoteBoxChanExists(timerlist[selected].channel_id)) { - int pre,post; + int pre = 0,post = 0; Timer->getRecordingSafety(pre,post); CHTTPTool httpTool; std::string r_url; diff --git a/src/timerd/timerd.cpp b/src/timerd/timerd.cpp index 385afac85..e1b00fbf9 100644 --- a/src/timerd/timerd.cpp +++ b/src/timerd/timerd.cpp @@ -306,7 +306,7 @@ bool timerd_parse_command(CBasicMessage::Header &rmsg, int connfd) CBasicServer::receive_data(connfd, &recInfo, sizeof(CTimerd::TransferRecordingInfo)); if(recInfo.recordingSafety) { - int pre,post; + int pre = 0,post = 0; CTimerManager::getInstance()->getRecordingSafety(pre,post); msgAddTimer.announceTime -= pre; msgAddTimer.alarmTime -= pre; diff --git a/src/timerd/timermanager.cpp b/src/timerd/timermanager.cpp index 82051b394..3903a4b0f 100644 --- a/src/timerd/timermanager.cpp +++ b/src/timerd/timermanager.cpp @@ -1347,7 +1347,7 @@ bool CTimerEvent_Record::adjustToCurrentEPG() CChannelEventList evtlist; CEitManager::getInstance()->getEventsServiceKey(eventInfo.channel_id, evtlist); - int pre, post; + int pre = 0, post = 0; CTimerManager::getInstance()->getRecordingSafety(pre, post); time_t _announceTime = announceTime; From 9711d463271264e076bafeea403577d82965df5b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 39/46] CProgressWindow: use CProgressBar::PB_TIMESCALE as default More colors makes not really sense here. Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/3fdd07e92c4f06c1715c23c5e03014fcbe3c2dd4 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) --- src/gui/widget/progresswindow.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/widget/progresswindow.cpp b/src/gui/widget/progresswindow.cpp index 983ff2aac..26975c02a 100644 --- a/src/gui/widget/progresswindow.cpp +++ b/src/gui/widget/progresswindow.cpp @@ -122,6 +122,7 @@ CProgressBar* CProgressWindow::getProgressItem() pBar->setActiveColor(COL_PROGRESSBAR_ACTIVE_PLUS_0); pBar->setFrameThickness(1); pBar->setColorFrame(COL_PROGRESSBAR_ACTIVE_PLUS_0); + pBar->setType(CProgressBar::PB_TIMESCALE); addWindowItem(pBar); return pBar; From 145b1b84fdb32e1de7ab02a0c0975083b1754efb Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 40/46] timerlist: add separationline to items (cherry picked from commit 68dac768c0b45cb855514f55254ba6a19956357c) Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d2415c49303e9bec96132a3b3a3e6a0c61e5701a Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - timerlist: add separationline to items (cherry picked from commit 68dac768c0b45cb855514f55254ba6a19956357c) Signed-off-by: Thilo Graf --- src/gui/timerlist.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index 601ae3981..dfbc96a9f 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -677,7 +677,7 @@ void CTimerList::updateEvents(void) header_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight(); font_height = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getHeight(); - item_height = 2*font_height; + item_height = 2*font_height + 1; // + 1 for separationline footer_height = header_height; width = frameBuffer->getScreenWidth()/100 * 90; @@ -1160,6 +1160,8 @@ void CTimerList::paintItem(int pos) if (i_radius) frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); + // separationline + frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); //shadow frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); From 842164614d19f9934cf1cc7ad91ab9be140bafbe Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 41/46] timerlist: fix compiler-warning (comparison signed/unsigned int) (cherry picked from commit 3b84c0a7ae63ac9001af3f86285f823ce93503d7) Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/033d6bb3593e3829b8de43f3cb515ec53e9b418b Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - timerlist: fix compiler-warning (comparison signed/unsigned int) (cherry picked from commit 3b84c0a7ae63ac9001af3f86285f823ce93503d7) Signed-off-by: Thilo Graf --- src/gui/timerlist.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index dfbc96a9f..23f6d734a 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -1161,7 +1161,7 @@ void CTimerList::paintItem(int pos) frameBuffer->paintBoxRel(x, ypos, real_width, item_height, COL_MENUCONTENT_PLUS_0); frameBuffer->paintBoxRel(x, ypos, real_width, item_height, bgcolor, i_radius); // separationline - frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); + frameBuffer->paintHLineRel(x, real_width, ypos + item_height - 1, (pos + 1 == (int) listmaxshow) ? bgcolor : COL_MENUCONTENTDARK_PLUS_0); //shadow frameBuffer->paintBoxRel(x + width, ypos + OFFSET_SHADOW, OFFSET_SHADOW, item_height, COL_SHADOW_PLUS_0); From 30f56a7edc16b7189d03970933cdeadb790d09c1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 42/46] moviebrowser: fix deletion of non-marked movies via mute-key (cherry picked from commit 15e33337a6982fa0a206a319636c84f66d9a0cf2) Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2f8ae15b669cc48d33e8b72f1069ea4a1a56b120 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - moviebrowser: fix deletion of non-marked movies via mute-key (cherry picked from commit 15e33337a6982fa0a206a319636c84f66d9a0cf2) Signed-off-by: Thilo Graf --- src/gui/moviebrowser/mb.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index f513de08a..9d3a3e27f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2480,7 +2480,7 @@ bool CMovieBrowser::onDelete(bool cursor_only) MI_MOVIE_INFO *movieinfo; movieinfo = NULL; - if (cursor_only) + if (cursor_only || (filelist.empty() || movielist.empty())) { filelist.clear(); movielist.clear(); From b8fab4c0fb4bf8b7594142ce5f526c4c57ce0511 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 20:53:12 +0200 Subject: [PATCH 43/46] bouqueteditor: use default font for CComponentsFooter (cherry picked from commit 17aa5edad9f564abe18f32254d54e142bf272fa2) Signed-off-by: Thilo Graf Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/9d323f499474f1aefa18c8bbee1a8fd3d7f4089f Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - bouqueteditor: use default font for CComponentsFooter (cherry picked from commit 17aa5edad9f564abe18f32254d54e142bf272fa2) Signed-off-by: Thilo Graf --- src/gui/bedit/bouqueteditor_bouquets.cpp | 2 +- src/gui/bedit/bouqueteditor_channels.cpp | 2 +- src/gui/bedit/bouqueteditor_chanselect.cpp | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/gui/bedit/bouqueteditor_bouquets.cpp b/src/gui/bedit/bouqueteditor_bouquets.cpp index 6c8486bc0..a5b2d6ebc 100644 --- a/src/gui/bedit/bouqueteditor_bouquets.cpp +++ b/src/gui/bedit/bouqueteditor_bouquets.cpp @@ -150,7 +150,7 @@ const struct button_label CBEBouquetWidgetButtons[6] = void CBEBouquetWidget::paintFoot() { size_t numbuttons = sizeof(CBEBouquetWidgetButtons)/sizeof(CBEBouquetWidgetButtons[0]); - footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID, 0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); + footer.paintButtons(x, y+height, width, ButtonHeight, numbuttons, CBEBouquetWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID); } void CBEBouquetWidget::hide() diff --git a/src/gui/bedit/bouqueteditor_channels.cpp b/src/gui/bedit/bouqueteditor_channels.cpp index 8618ffca5..1b405ae83 100644 --- a/src/gui/bedit/bouqueteditor_channels.cpp +++ b/src/gui/bedit/bouqueteditor_channels.cpp @@ -184,7 +184,7 @@ const struct button_label CBEChannelWidgetButtons[6] = void CBEChannelWidget::paintFoot() { size_t numbuttons = sizeof(CBEChannelWidgetButtons)/sizeof(CBEChannelWidgetButtons[0]); - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID, 0, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, CBEChannelWidgetButtons, width/numbuttons-2*OFFSET_INNER_MID); } std::string CBEChannelWidget::getInfoText(int index) diff --git a/src/gui/bedit/bouqueteditor_chanselect.cpp b/src/gui/bedit/bouqueteditor_chanselect.cpp index 87227e8df..e9ee12385 100644 --- a/src/gui/bedit/bouqueteditor_chanselect.cpp +++ b/src/gui/bedit/bouqueteditor_chanselect.cpp @@ -251,7 +251,7 @@ void CBEChannelSelectWidget::paintFoot() break; } - footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-20); + footer.paintButtons(x, y + (height-footerHeight), width, footerHeight, numbuttons, Button, width/numbuttons-2*OFFSET_INNER_MID); } std::string CBEChannelSelectWidget::getInfoText(int index) From b3f508bb90e20bc3c044eb7ffad39f132565dbf1 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 22:43:36 +0200 Subject: [PATCH 44/46] fontrenderer: align FTC_Manager_New()-call to tuxbox-neutrino Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bae61aa343beee7561c593945ad31f02d9f28423 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - fontrenderer: align FTC_Manager_New()-call to tuxbox-neutrino --- src/driver/fontrenderer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 3d291ae40..3a5e1e5ff 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -69,7 +69,7 @@ FBFontRenderClass::FBFontRenderClass(const int xr, const int yr) int maxbytes= 4 *1024*1024; dprintf(DEBUG_INFO, "[FONT] Intializing font cache, using max. %dMB...\n", maxbytes/1024/1024); fflush(stdout); - if (FTC_Manager_New(library, 0, 0, maxbytes, myFTC_Face_Requester, this, &cacheManager)) + if (FTC_Manager_New(library, 10, 20, maxbytes, myFTC_Face_Requester, this, &cacheManager)) { dprintf(DEBUG_NORMAL, "[FONT] manager failed!\n"); return; From 1f8d52be0d4536ca95fc016eb42ae9a00e011644 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 22:43:36 +0200 Subject: [PATCH 45/46] cc_frm_footer: re-add auto-calc label_width by default Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/bd5602c05007c2015aeb13263dbe6483300ab458 Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - cc_frm_footer: re-add auto-calc label_width by default --- src/gui/components/cc_frm_footer.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_footer.cpp b/src/gui/components/cc_frm_footer.cpp index 74b48d754..9d1a95cf8 100644 --- a/src/gui/components/cc_frm_footer.cpp +++ b/src/gui/components/cc_frm_footer.cpp @@ -336,7 +336,7 @@ void CComponentsFooter::paintButtons(const int& x_pos, this->setDimensionsAll(x_pos, y_pos, w, h); this->setButtonFont(font); this->setContextButton(context_buttons); - this->setButtonLabels(content, label_count, 0, label_width); + this->setButtonLabels(content, label_count, 0, label_width ? label_width : (w/label_count) - 2*cch_offset); this->paint(do_save_bg); } From 37d602cfde662895a52a1f998eb92acb4135de21 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 26 Jun 2017 22:43:36 +0200 Subject: [PATCH 46/46] cc_frm_button.cpp: fix comparsion to detect dyn-font usage Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/942d8594f50909095b3c6783313b6903634fff6a Author: vanhofen Date: 2017-06-26 (Mon, 26 Jun 2017) Origin message was: ------------------ - cc_frm_button.cpp: fix comparsion to detect dyn-font usage --- src/gui/components/cc_frm_button.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_button.cpp b/src/gui/components/cc_frm_button.cpp index c0c0039b0..23d57bf3c 100644 --- a/src/gui/components/cc_frm_button.cpp +++ b/src/gui/components/cc_frm_button.cpp @@ -217,7 +217,7 @@ void CComponentsButton::initCaption() * These dimensions must be enough to display complete content like possible icon and without truncated text. */ Font *tmp_font = cc_btn_font; - if ((tmp_font->getHeight()-reduce) > (height-reduce) && (tmp_font->getRenderWidth(cc_btn_text)-reduce) > width-reduce) + if ((tmp_font->getHeight()-reduce) > (height-reduce) || (tmp_font->getRenderWidth(cc_btn_text)-reduce) > width-reduce) tmp_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_text); if ((cc_btn_font->getHeight()-reduce) > (height-reduce)) tmp_font = *cc_btn_dy_font->getDynFont(w_cap, h_cap, cc_btn_text);