From 1fd65448eb24e5f478556070472a9f5b2b274ce7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 4 May 2017 16:30:37 +0200 Subject: [PATCH 1/3] CMovieBrowser: prevent possible segfault Clock is disabled, will crash here. comes with: e36f7ccecd0d78d6350e2f99b82d7e7a90a626ee Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/329fad5545766d94138b16334a74a9872366f650 Author: Thilo Graf Date: 2017-05-04 (Thu, 04 May 2017) ------------------ This commit was generated by Migit --- 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 df586ca19..9fdc4f188 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -2095,7 +2095,7 @@ bool CMovieBrowser::onButtonPressMainFrame(neutrino_msg_t msg) { if (m_movieSelectionHandler != NULL) { - m_header->getClockObject()->kill(); + m_header->kill(); framebuffer->paintBackground(); //clear whole screen g_EpgData->show_mp(m_movieSelectionHandler); refresh(); From 328ba0b4eba3b4ba38fb795d8e4564fd06e49784 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 4 May 2017 16:52:30 +0200 Subject: [PATCH 2/3] CEpgData: fix header size Header height was bound to font size in previous versions, but new header is using other font as default, so we have wrong height, therefore header items could paint outside of header. This should fix this. In future we should unify header size with other windows. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/23912ba583582224750a3a4c148cfe5a0b97b372 Author: Thilo Graf Date: 2017-05-04 (Thu, 04 May 2017) ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 4 +++- src/gui/epgview.h | 1 + 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index cde35d13c..4defc0a8a 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -132,6 +132,7 @@ CEpgData::CEpgData() lText = NULL; rText = NULL; pb = NULL; + font_title = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]; } CEpgData::~CEpgData() @@ -144,7 +145,7 @@ void CEpgData::start() ox = frameBuffer->getScreenWidthRel(bigFonts ? false /* big */ : true /* small */); oy = frameBuffer->getScreenHeightRel(bigFonts ? false /* big */ : true /* small */); - topheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]->getHeight(); + topheight = font_title->getHeight(); topboxheight = topheight + 6; botboxheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight() + 6; buttonheight = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_FOOT]->getHeight() + 6; @@ -848,6 +849,7 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // header + logo if (!header){ header = new CComponentsHeader(sx, sy, ox, toph); + header->setCaptionFont(font_title); 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); diff --git a/src/gui/epgview.h b/src/gui/epgview.h index 5db5cfa12..44de63c05 100644 --- a/src/gui/epgview.h +++ b/src/gui/epgview.h @@ -55,6 +55,7 @@ class CEpgData CComponentsPictureScalable *lpic, *rpic; CComponentsText *lText, *rText; CProgressBar *pb; + Font *font_title; std::string epg_date; std::string epg_start; std::string epg_end; From fee507c8139c0a9d9e98e9532e01405425bc7501 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 4 May 2017 19:45:11 +0200 Subject: [PATCH 3/3] CEpgData: supplement to 'fix header size' commit: 7583714e6703a7ae9591e112726759c4070d0c68 Permanent font init is required to avoid possible crash after changed font settings by user. Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/17958da28fc32fc857066000456e0c6af90099e7 Author: Thilo Graf Date: 2017-05-04 (Thu, 04 May 2017) ------------------ This commit was generated by Migit --- src/gui/epgview.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/gui/epgview.cpp b/src/gui/epgview.cpp index 4defc0a8a..980b6acec 100644 --- a/src/gui/epgview.cpp +++ b/src/gui/epgview.cpp @@ -132,7 +132,7 @@ CEpgData::CEpgData() lText = NULL; rText = NULL; pb = NULL; - font_title = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]; + font_title = NULL; } CEpgData::~CEpgData() @@ -145,6 +145,7 @@ void CEpgData::start() ox = frameBuffer->getScreenWidthRel(bigFonts ? false /* big */ : true /* small */); oy = frameBuffer->getScreenHeightRel(bigFonts ? false /* big */ : true /* small */); + font_title = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_TITLE]; topheight = font_title->getHeight(); topboxheight = topheight + 6; botboxheight = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_DATE]->getHeight() + 6; @@ -849,13 +850,13 @@ int CEpgData::show(const t_channel_id channel_id, uint64_t a_id, time_t* a_start // header + logo if (!header){ header = new CComponentsHeader(sx, sy, ox, toph); - header->setCaptionFont(font_title); 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->setCaptionFont(font_title); header->setCaption(epgData.title); if (header->isPainted())