From d58e22b4ede2490ec3072a76f1f918e750e13a2a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 15 Dec 2016 16:43:19 +0100 Subject: [PATCH 01/13] CMenuWidget: add external methode to paint scrollbar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/644e8196db4bd934e7a60fd08c7e6d0ae0f32ee0 Author: Thilo Graf Date: 2016-12-15 (Thu, 15 Dec 2016) --- src/gui/widget/menue.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index d0c30166a..dc268cb49 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1325,10 +1325,9 @@ void CMenuWidget::paintItems() if(total_pages>1) { int item_height=height-(item_start_y-y); - frameBuffer->paintBoxRel(x+ width,item_start_y, 15, item_height, COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); - frameBuffer->paintBoxRel(x+ width +2, item_start_y+ 2+ current_page*(item_height-4)/total_pages, 11, (item_height-4)/total_pages, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); - /* background of menu items, paint every time because different items can have - * different height and this might leave artifacts otherwise after changing pages */ + paintScrollBar(x+ width, item_start_y, 15, item_height, total_pages, current_page); +// /* background of menu items, paint every time because different items can have +// * different height and this might leave artifacts otherwise after changing pages */ frameBuffer->paintBoxRel(x,item_start_y, width,item_height, COL_MENUCONTENT_PLUS_0); } From c98374ff73e28df50ffb8ef1cbd3554bb42d6584 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 17 Dec 2016 22:34:38 +0100 Subject: [PATCH 02/13] CCDraw: add overloaded version of paint Blink() It's useful to have synchronized timer for more than one item. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/f7ad79c371c391fb431a8cfdbf369bd5896c2d88 Author: Thilo Graf Date: 2016-12-17 (Sat, 17 Dec 2016) --- src/gui/components/cc_draw.cpp | 19 +++++++++++-------- src/gui/components/cc_draw.h | 11 +++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index a5c455bb8..54acff507 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -738,18 +738,21 @@ void CCDraw::paintTrigger() hide(); } +bool CCDraw::paintBlink(CComponentsTimer* Timer) +{ + if (Timer){ + Timer->OnTimer.connect(cc_draw_trigger_slot); + return Timer->isRun(); + } + return false; +} + bool CCDraw::paintBlink(const int& interval, bool is_nano) { - if (cc_draw_timer == NULL){ + if (cc_draw_timer == NULL) cc_draw_timer = new CComponentsTimer(interval, is_nano); - if (cc_draw_timer->OnTimer.empty()){ - cc_draw_timer->OnTimer.connect(cc_draw_trigger_slot); - } - } - if (cc_draw_timer) - return cc_draw_timer->isRun(); - return false; + return paintBlink(cc_draw_timer); } bool CCDraw::cancelBlink(bool keep_on_screen) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 463dc62e1..dd99986fa 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -312,6 +312,17 @@ class CCDraw : public COSDFader, public CComponentsSignals ///paint item, same like paint(CC_SAVE_SCREEN_YES) but without any argument virtual void paint1(){paint(CC_SAVE_SCREEN_YES);} + /**paint item with blink effect + * This should work with all cc item types. + * + * @return bool returns true if effect is successful started + * + * @param[in] CComponentsTimer* pointer to timer object, Note: This object must be created and distroy outside + * of this methode. + * @see overloaded version of paintBlink() + */ + virtual bool paintBlink(CComponentsTimer* Timer); + /**paint item with blink effect * This should work with all cc item types. * From 470400d8858cf5c60b5751fa4884236ba66ca219 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 17 Dec 2016 22:37:06 +0100 Subject: [PATCH 03/13] CTestMenu: edd expanded sample for blinking items with syncroinized effect Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2e2d0d6b19e697ab21109581b87ea1371b0be17d Author: Thilo Graf Date: 2016-12-17 (Sat, 17 Dec 2016) --- src/gui/test_menu.cpp | 5 ++++- src/gui/test_menu.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 8fbe7d235..bdaa04996 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -87,6 +87,7 @@ CTestMenu::CTestMenu() clock = clock_r = NULL; text_ext = NULL; scrollbar = NULL; + timer = NULL; } CTestMenu::~CTestMenu() @@ -950,6 +951,8 @@ void CTestMenu::showRecords() const int box_posX = 30; const int box_posY = 300; + if (!timer) + timer = new CComponentsTimer(1); if (crm->RecordingStatus()) { @@ -1013,7 +1016,7 @@ void CTestMenu::showRecords() for(size_t j = 0; j< images.size(); j++){ images[j]->kill(); - images[j]->paintBlink(); + images[j]->paintBlink(timer); } ShowHint("Testmenu: Records", "Record test ...", 200, 30, NULL, NEUTRINO_ICON_HINT_RECORDING, CComponentsHeader::CC_BTN_EXIT); diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index 20c4937b1..84cacac6e 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -54,6 +54,7 @@ class CTestMenu : public CMenuTarget CComponentsChannelLogo* chnl_pic; CComponentsExtTextForm* text_ext; CComponentsScrollBar* scrollbar; + CComponentsTimer *timer; int width, selected; int showTestMenu(); From 08acfc091152302332b94e1a86454bb7ae383b31 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 18 Dec 2016 01:22:24 +0100 Subject: [PATCH 04/13] screensaver: fix clock positions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/7e077bb7eefa72cc6b309263abafa1d494ce9e09 Author: vanhofen Date: 2016-12-18 (Sun, 18 Dec 2016) Origin message was: ------------------ - screensaver: fix clock positions --- src/gui/screensaver.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 5082fec27..1ded487eb 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -283,14 +283,10 @@ void CScreenSaver::paint() //check position and size use only possible available screen size int x_cl, y_cl, w_cl, h_cl; - scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl); - bool unchecked = true; - while(unchecked){ - scr_clock->setPosP(uint8_t(rand() % 100),uint8_t(rand() % 100)); - scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl); - if (x_cl+w_cl < g_settings.screen_EndX && y_cl+h_cl < g_settings.screen_EndY) - unchecked = false; - } + scr_clock->getDimensions(&x_cl, &y_cl, &w_cl, &h_cl); + int x_random = rand() % ((g_settings.screen_EndX - w_cl - g_settings.screen_StartX) + 1) + g_settings.screen_StartX; + int y_random = rand() % ((g_settings.screen_EndY - h_cl - g_settings.screen_StartY) + 1) + g_settings.screen_StartY; + scr_clock->setPos(x_random, y_random); scr_clock->Start(); if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) { From 3069495033d39aa176e67526af758bed4e0dde10 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 18 Dec 2016 18:48:02 +0100 Subject: [PATCH 05/13] CComponentsHeader: ensure to have correct font instances after changed font On possible changed font settings, font objects can be invalid and we have a crash. With this fix it's possible, that CNeutrinoApp::setupFont() method clean up header font object itself. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/239496c207d67074646389cf0b105251d3103a2f Author: Thilo Graf Date: 2016-12-18 (Sun, 18 Dec 2016) --- src/gui/components/cc_frm_header.cpp | 10 +++++++++- src/gui/components/cc_frm_header.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 5a6e3ec74..a3e26b90e 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -97,6 +97,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_font = NULL; cch_size_mode = CC_HEADER_SIZE_LARGE; + CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(sigc::mem_fun(this, &CComponentsHeader::resetFont)); shadow = shadow_mode; col_frame = col_frame_old = color_frame; @@ -161,6 +162,14 @@ void CComponentsHeader::setCaptionFont(Font* font) cch_font = font; } +void CComponentsHeader::resetFont() +{ + if (cch_font){ + cch_font = NULL; + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsHeader][%s - %d] reset header font \033[0m\n", __func__, __LINE__); + } +} + void CComponentsHeader::initCaptionFont() { Font *l_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; @@ -168,7 +177,6 @@ void CComponentsHeader::initCaptionFont() if (cch_font == NULL){ cch_font = (cch_size_mode == CC_HEADER_SIZE_LARGE? l_font : s_font); - //select matching height if (cch_size_mode == CC_HEADER_SIZE_LARGE) height = std::max(height, l_font->getHeight()); diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index d091e800f..6d3169c12 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -68,6 +68,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen fb_pixel_t cch_col_text; ///property: caption font, see also setCaptionFont() Font* cch_font; + ///reset font + void resetFont(); ///property: internal y-position for all items int cch_items_y; From 1847b82611e46b3397ef3e64e97ccca7be7c8372 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Sun, 18 Dec 2016 22:20:12 +0100 Subject: [PATCH 06/13] personalize: pluralize 'usermenu' item; these are 'usermenus' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8faaec552ae2537d48a8be02e16082793fb57962 Author: vanhofen Date: 2016-12-18 (Sun, 18 Dec 2016) Origin message was: ------------------ - personalize: pluralize 'usermenu' item; these are 'usermenus' --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/personalize.cpp | 4 ++-- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index bd849d2be..34c4d0964 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2451,6 +2451,7 @@ usermenu.title_blue Erweiterungen usermenu.title_green Tonwahl usermenu.title_red EPG usermenu.title_yellow Bildoptionen +usermenus.head Benutzermenüs video_mode_ok Video-Einstellungen OK? videomenu.43mode 4:3 Anzeigeverhalten videomenu.analog_auto AUTO diff --git a/data/locale/english.locale b/data/locale/english.locale index bcb7e1e8e..91d07f067 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2451,6 +2451,7 @@ usermenu.title_blue Features usermenu.title_green Audio usermenu.title_red Event-List usermenu.title_yellow Video +usermenus.head User menus video_mode_ok Is this video mode working ok ? videomenu.43mode 4:3 Content mode videomenu.analog_auto AUTO diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index 053368990..7461c0b76 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -385,7 +385,7 @@ int CPersonalizeGui::ShowPersonalizationMenu() { pMenu->addItem(GenericMenuSeparatorLine); uMenu = new CMenuWidget(LOCALE_PERSONALIZE_HEAD, NEUTRINO_ICON_PERSONALIZE, width, MN_WIDGET_ID_PERSONALIZE_USERMENU); - pMenu->addItem(new CMenuForwarder(LOCALE_USERMENU_HEAD, true, NULL, uMenu, NULL, CRCInput::RC_green)); + pMenu->addItem(new CMenuForwarder(LOCALE_USERMENUS_HEAD, true, NULL, uMenu, NULL, CRCInput::RC_green)); ShowUserMenu(); } @@ -488,7 +488,7 @@ void CPersonalizeGui::ShowUserMenu() { int uMenu_shortcut = 1; - uMenu->addIntroItems(LOCALE_USERMENU_HEAD); + uMenu->addIntroItems(LOCALE_USERMENUS_HEAD); uMenu->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, &g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); diff --git a/src/system/locals.h b/src/system/locals.h index a1dfd99a8..4e5548044 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2478,6 +2478,7 @@ typedef enum LOCALE_USERMENU_TITLE_GREEN, LOCALE_USERMENU_TITLE_RED, LOCALE_USERMENU_TITLE_YELLOW, + LOCALE_USERMENUS_HEAD, LOCALE_VIDEO_MODE_OK, LOCALE_VIDEOMENU_43MODE, LOCALE_VIDEOMENU_ANALOG_AUTO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index 1d61f6deb..bb613b5cb 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2478,6 +2478,7 @@ const char * locale_real_names[] = "usermenu.title_green", "usermenu.title_red", "usermenu.title_yellow", + "usermenus.head", "video_mode_ok", "videomenu.43mode", "videomenu.analog_auto", From f8589d0ad4456686d2d5f5a89c5261f796a38ab6 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 19 Dec 2016 17:21:51 +0100 Subject: [PATCH 07/13] CMenuWidget: add external methode to paint scrollbar Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/abff070ad7143af971fb5603b55625d97ce39c04 Author: Thilo Graf Date: 2016-12-19 (Mon, 19 Dec 2016) --- src/gui/widget/menue.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 70ea05736..2958d35ea 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1343,10 +1343,9 @@ void CMenuWidget::paintItems() if(total_pages>1) { int item_height=height-(item_start_y-y); - frameBuffer->paintBoxRel(x+ width,item_start_y, 15, item_height, COL_SCROLLBAR_PASSIVE_PLUS_0, RADIUS_MIN); - frameBuffer->paintBoxRel(x+ width +2, item_start_y+ 2+ current_page*(item_height-4)/total_pages, 11, (item_height-4)/total_pages, COL_SCROLLBAR_ACTIVE_PLUS_0, RADIUS_MIN); - /* background of menu items, paint every time because different items can have - * different height and this might leave artifacts otherwise after changing pages */ + paintScrollBar(x+ width, item_start_y, 15, item_height, total_pages, current_page); +// /* background of menu items, paint every time because different items can have +// * different height and this might leave artifacts otherwise after changing pages */ frameBuffer->paintBoxRel(x,item_start_y, width,item_height, COL_MENUCONTENT_PLUS_0); } From d8f12fdf354c9918fe57f7c91076349f51f638b5 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 19 Dec 2016 17:21:51 +0100 Subject: [PATCH 08/13] CCDraw: add overloaded version of paint Blink() It's useful to have synchronized timer for more than one item. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8e99d3a7a2c7775b966c9f5aca6347a3e8218e97 Author: Thilo Graf Date: 2016-12-19 (Mon, 19 Dec 2016) --- src/gui/components/cc_draw.cpp | 19 +++++++++++-------- src/gui/components/cc_draw.h | 11 +++++++++++ 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index a5c455bb8..54acff507 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -738,18 +738,21 @@ void CCDraw::paintTrigger() hide(); } +bool CCDraw::paintBlink(CComponentsTimer* Timer) +{ + if (Timer){ + Timer->OnTimer.connect(cc_draw_trigger_slot); + return Timer->isRun(); + } + return false; +} + bool CCDraw::paintBlink(const int& interval, bool is_nano) { - if (cc_draw_timer == NULL){ + if (cc_draw_timer == NULL) cc_draw_timer = new CComponentsTimer(interval, is_nano); - if (cc_draw_timer->OnTimer.empty()){ - cc_draw_timer->OnTimer.connect(cc_draw_trigger_slot); - } - } - if (cc_draw_timer) - return cc_draw_timer->isRun(); - return false; + return paintBlink(cc_draw_timer); } bool CCDraw::cancelBlink(bool keep_on_screen) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index 463dc62e1..dd99986fa 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -312,6 +312,17 @@ class CCDraw : public COSDFader, public CComponentsSignals ///paint item, same like paint(CC_SAVE_SCREEN_YES) but without any argument virtual void paint1(){paint(CC_SAVE_SCREEN_YES);} + /**paint item with blink effect + * This should work with all cc item types. + * + * @return bool returns true if effect is successful started + * + * @param[in] CComponentsTimer* pointer to timer object, Note: This object must be created and distroy outside + * of this methode. + * @see overloaded version of paintBlink() + */ + virtual bool paintBlink(CComponentsTimer* Timer); + /**paint item with blink effect * This should work with all cc item types. * From 85bb0e6abdbeaa232b03eba3580424ffe3a37700 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 19 Dec 2016 17:21:51 +0100 Subject: [PATCH 09/13] CTestMenu: edd expanded sample for blinking items with syncroinized effect Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2cbca9501fe5958cc3a3220125c677f49782dbe8 Author: Thilo Graf Date: 2016-12-19 (Mon, 19 Dec 2016) --- src/gui/test_menu.cpp | 5 ++++- src/gui/test_menu.h | 1 + 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index 8fbe7d235..bdaa04996 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -87,6 +87,7 @@ CTestMenu::CTestMenu() clock = clock_r = NULL; text_ext = NULL; scrollbar = NULL; + timer = NULL; } CTestMenu::~CTestMenu() @@ -950,6 +951,8 @@ void CTestMenu::showRecords() const int box_posX = 30; const int box_posY = 300; + if (!timer) + timer = new CComponentsTimer(1); if (crm->RecordingStatus()) { @@ -1013,7 +1016,7 @@ void CTestMenu::showRecords() for(size_t j = 0; j< images.size(); j++){ images[j]->kill(); - images[j]->paintBlink(); + images[j]->paintBlink(timer); } ShowHint("Testmenu: Records", "Record test ...", 200, 30, NULL, NEUTRINO_ICON_HINT_RECORDING, CComponentsHeader::CC_BTN_EXIT); diff --git a/src/gui/test_menu.h b/src/gui/test_menu.h index 20c4937b1..84cacac6e 100644 --- a/src/gui/test_menu.h +++ b/src/gui/test_menu.h @@ -54,6 +54,7 @@ class CTestMenu : public CMenuTarget CComponentsChannelLogo* chnl_pic; CComponentsExtTextForm* text_ext; CComponentsScrollBar* scrollbar; + CComponentsTimer *timer; int width, selected; int showTestMenu(); From bc32d98e4d9d5b39d65b49825d958f5b9a911ea7 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Dec 2016 17:21:51 +0100 Subject: [PATCH 10/13] screensaver: fix clock positions Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/75d20b6ecb46982b17b7216afc44a45abeafec40 Author: vanhofen Date: 2016-12-19 (Mon, 19 Dec 2016) Origin message was: ------------------ - screensaver: fix clock positions --- src/gui/screensaver.cpp | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 0814aacb3..a1856c743 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -293,14 +293,10 @@ void CScreenSaver::paint() //check position and size use only possible available screen size int x_cl, y_cl, w_cl, h_cl; - scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl); - bool unchecked = true; - while(unchecked){ - scr_clock->setPosP(uint8_t(rand() % 100),uint8_t(rand() % 100)); - scr_clock->getDimensions( &x_cl, &y_cl, &w_cl, &h_cl); - if (x_cl+w_cl < g_settings.screen_EndX && y_cl+h_cl < g_settings.screen_EndY) - unchecked = false; - } + scr_clock->getDimensions(&x_cl, &y_cl, &w_cl, &h_cl); + int x_random = rand() % ((g_settings.screen_EndX - w_cl - g_settings.screen_StartX) + 1) + g_settings.screen_StartX; + int y_random = rand() % ((g_settings.screen_EndY - h_cl - g_settings.screen_StartY) + 1) + g_settings.screen_StartY; + scr_clock->setPos(x_random, y_random); scr_clock->Start(); if (g_settings.screensaver_mode == SCR_MODE_CLOCK_COLOR) { From 11983a722081b7d5728636c2998974eafeea5035 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 19 Dec 2016 17:21:51 +0100 Subject: [PATCH 11/13] CComponentsHeader: ensure to have correct font instances after changed font On possible changed font settings, font objects can be invalid and we have a crash. With this fix it's possible, that CNeutrinoApp::setupFont() method clean up header font object itself. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8292ec84aff0f05ae40b03acf50738df12fc5087 Author: Thilo Graf Date: 2016-12-19 (Mon, 19 Dec 2016) --- src/gui/components/cc_frm_header.cpp | 10 +++++++++- src/gui/components/cc_frm_header.h | 2 ++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 5a6e3ec74..a3e26b90e 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -97,6 +97,7 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_font = NULL; cch_size_mode = CC_HEADER_SIZE_LARGE; + CNeutrinoApp::getInstance()->OnAfterSetupFonts.connect(sigc::mem_fun(this, &CComponentsHeader::resetFont)); shadow = shadow_mode; col_frame = col_frame_old = color_frame; @@ -161,6 +162,14 @@ void CComponentsHeader::setCaptionFont(Font* font) cch_font = font; } +void CComponentsHeader::resetFont() +{ + if (cch_font){ + cch_font = NULL; + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsHeader][%s - %d] reset header font \033[0m\n", __func__, __LINE__); + } +} + void CComponentsHeader::initCaptionFont() { Font *l_font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]; @@ -168,7 +177,6 @@ void CComponentsHeader::initCaptionFont() if (cch_font == NULL){ cch_font = (cch_size_mode == CC_HEADER_SIZE_LARGE? l_font : s_font); - //select matching height if (cch_size_mode == CC_HEADER_SIZE_LARGE) height = std::max(height, l_font->getHeight()); diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index d091e800f..6d3169c12 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -68,6 +68,8 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen fb_pixel_t cch_col_text; ///property: caption font, see also setCaptionFont() Font* cch_font; + ///reset font + void resetFont(); ///property: internal y-position for all items int cch_items_y; From 0a8cf7bcc16751c68006aab131a6e17a72a5fcf6 Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Dec 2016 17:21:51 +0100 Subject: [PATCH 12/13] personalize: pluralize 'usermenu' item; these are 'usermenus' Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2e6ee0c3fb0d8c9b5b46aeb2afbde7ec6199481d Author: vanhofen Date: 2016-12-19 (Mon, 19 Dec 2016) Origin message was: ------------------ - personalize: pluralize 'usermenu' item; these are 'usermenus' --- data/locale/deutsch.locale | 1 + data/locale/english.locale | 1 + src/gui/personalize.cpp | 4 ++-- src/system/locals.h | 1 + src/system/locals_intern.h | 1 + 5 files changed, 6 insertions(+), 2 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 5747121cc..1cb2eee57 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -2687,6 +2687,7 @@ usermenu.title_blue Erweiterungen usermenu.title_green Tonwahl usermenu.title_red EPG usermenu.title_yellow Bildoptionen +usermenus.head Benutzermenüs video_mode_ok Video-Einstellungen OK? videomenu.43mode 4:3 Anzeigeverhalten videomenu.analog_auto AUTO diff --git a/data/locale/english.locale b/data/locale/english.locale index 1de49a9a2..b90154a65 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -2687,6 +2687,7 @@ usermenu.title_blue Features usermenu.title_green Audio usermenu.title_red Event-List usermenu.title_yellow Video +usermenus.head User menus video_mode_ok Is this video mode working ok ? videomenu.43mode 4:3 Content mode videomenu.analog_auto AUTO diff --git a/src/gui/personalize.cpp b/src/gui/personalize.cpp index 25f111151..b4bf4210d 100644 --- a/src/gui/personalize.cpp +++ b/src/gui/personalize.cpp @@ -385,7 +385,7 @@ int CPersonalizeGui::ShowPersonalizationMenu() { pMenu->addItem(GenericMenuSeparatorLine); uMenu = new CMenuWidget(LOCALE_PERSONALIZE_HEAD, NEUTRINO_ICON_PERSONALIZE, width, MN_WIDGET_ID_PERSONALIZE_USERMENU); - pMenu->addItem(new CMenuForwarder(LOCALE_USERMENU_HEAD, true, NULL, uMenu, NULL, CRCInput::RC_green)); + pMenu->addItem(new CMenuForwarder(LOCALE_USERMENUS_HEAD, true, NULL, uMenu, NULL, CRCInput::RC_green)); ShowUserMenu(); } @@ -488,7 +488,7 @@ void CPersonalizeGui::ShowUserMenu() { int uMenu_shortcut = 1; - uMenu->addIntroItems(LOCALE_USERMENU_HEAD); + uMenu->addIntroItems(LOCALE_USERMENUS_HEAD); uMenu->addItem(new CMenuOptionChooser(LOCALE_PERSONALIZE_USERMENU_SHOW_CANCEL, &g_settings.personalize[SNeutrinoSettings::P_UMENU_SHOW_CANCEL], OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true)); diff --git a/src/system/locals.h b/src/system/locals.h index e16443b72..2fececf52 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -2714,6 +2714,7 @@ typedef enum LOCALE_USERMENU_TITLE_GREEN, LOCALE_USERMENU_TITLE_RED, LOCALE_USERMENU_TITLE_YELLOW, + LOCALE_USERMENUS_HEAD, LOCALE_VIDEO_MODE_OK, LOCALE_VIDEOMENU_43MODE, LOCALE_VIDEOMENU_ANALOG_AUTO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index fa5ccbd91..aa8fce3bd 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -2714,6 +2714,7 @@ const char * locale_real_names[] = "usermenu.title_green", "usermenu.title_red", "usermenu.title_yellow", + "usermenus.head", "video_mode_ok", "videomenu.43mode", "videomenu.analog_auto", From a79b90eb812eb57259c263f49b17c2e7507b1b3b Mon Sep 17 00:00:00 2001 From: vanhofen Date: Mon, 19 Dec 2016 17:21:51 +0100 Subject: [PATCH 13/13] icons: add and use pictureviewer icon Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a19a5df9ff39e19938d0b9152d927df41e5172c9 Author: vanhofen Date: 2016-12-19 (Mon, 19 Dec 2016) Origin message was: ------------------ - icons: add and use pictureviewer icon --- data/icons/headers/Makefile.am | 1 + data/icons/headers/pictureviewer.png | Bin 0 -> 185 bytes src/gui/pictureviewer.cpp | 2 +- src/gui/widget/icons.h | 1 + 4 files changed, 3 insertions(+), 1 deletion(-) create mode 100644 data/icons/headers/pictureviewer.png diff --git a/data/icons/headers/Makefile.am b/data/icons/headers/Makefile.am index 29328dcbf..77e409429 100644 --- a/data/icons/headers/Makefile.am +++ b/data/icons/headers/Makefile.am @@ -21,6 +21,7 @@ install_DATA = \ multimedia.png \ network.png \ personalize.png \ + pictureviewer.png \ recording.png \ settings.png \ shell.png \ diff --git a/data/icons/headers/pictureviewer.png b/data/icons/headers/pictureviewer.png new file mode 100644 index 0000000000000000000000000000000000000000..d474bd577d00d2aa045685f38b1729e4b2c314e2 GIT binary patch literal 185 zcmeAS@N?(olHy`uVBq!ia0vp^5+KaM0wlfaz7_+i22U5q5R22v2@-1_)Iaz?{r|_t z@c(}UO&^5wG3f`I3NX5v2Dl$y{{P_r{X*9Y*v@e=cBuVzj-6zmROnb2dbs~(^j5ic0>pDDE2 jzES4mqy6s}oc+sic8*Qfk2kwOj%4t3^>bP0l+XkKat%vT literal 0 HcmV?d00001 diff --git a/src/gui/pictureviewer.cpp b/src/gui/pictureviewer.cpp index 506d68fd1..e1cccf611 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, theight, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_MP3, CComponentsHeaderLocalized::CC_BTN_HELP); + CComponentsHeaderLocalized header(x, y, width, theight, LOCALE_PICTUREVIEWER_HEAD, NEUTRINO_ICON_PICTUREVIEWER, CComponentsHeaderLocalized::CC_BTN_HELP); //NI #ifdef ENABLE_GUI_MOUNT header.setContextButton(NEUTRINO_ICON_BUTTON_MENU); diff --git a/src/gui/widget/icons.h b/src/gui/widget/icons.h index 0d19fafa6..858ea0ac2 100644 --- a/src/gui/widget/icons.h +++ b/src/gui/widget/icons.h @@ -183,6 +183,7 @@ #define NEUTRINO_ICON_STAR_OFF "star-off" #define NEUTRINO_ICON_TMDB "tmdb" #define NEUTRINO_ICON_IMDB "imdb" +#define NEUTRINO_ICON_PICTUREVIEWER "pictureviewer" #define DUMMY_ICON "dummy"