From 95b535016f4a8b2d4edfbcec223a87f3c9b4aebb Mon Sep 17 00:00:00 2001 From: GetAway Date: Sun, 6 Aug 2017 21:29:07 +0200 Subject: [PATCH 01/19] neutrino.cpp: repaint of background in radio mode, when close UPNP-Browser --- src/neutrino.cpp | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/neutrino.cpp b/src/neutrino.cpp index b25ed8e7b..519ebdfda 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -4103,7 +4103,7 @@ void CNeutrinoApp::radioMode( bool rezap) CVFD::getInstance()->setMode(CVFD::MODE_TVRADIO); videoDecoder->Standby(false); } - mode = mode_radio; + #ifdef ENABLE_PIP pipDecoder->Pig(g_settings.pip_radio_x, g_settings.pip_radio_y, g_settings.pip_radio_width, g_settings.pip_radio_height, @@ -4111,6 +4111,12 @@ void CNeutrinoApp::radioMode( bool rezap) #endif CRecordManager::getInstance()->StopAutoRecord(); + if (mode != mode_webtv) { + frameBuffer->useBackground(false); + frameBuffer->paintBackground(); + } + mode = mode_radio; + g_RemoteControl->radioMode(); SetChannelMode(g_settings.channel_mode_radio); From 90de51de3807c76f66f642c94fec82cd1f7d2f6f Mon Sep 17 00:00:00 2001 From: GetAway Date: Sun, 6 Aug 2017 23:03:25 +0200 Subject: [PATCH 02/19] neutrino: disable some menus in upnp & ts mode to prevent inoperability of neutrino --- src/gui/user_menue.cpp | 13 +++++++------ src/gui/widget/menue.cpp | 8 +++++++- src/gui/widget/menue.h | 3 +++ src/neutrino_menue.cpp | 18 +++++++++++++++--- 4 files changed, 32 insertions(+), 10 deletions(-) diff --git a/src/gui/user_menue.cpp b/src/gui/user_menue.cpp index a7d77530d..657956f86 100644 --- a/src/gui/user_menue.cpp +++ b/src/gui/user_menue.cpp @@ -184,6 +184,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) menu->addItem(GenericMenuSeparator); bool _mode_ts = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_ts; + bool _mode_upnp = CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_upnp; bool _mode_webtv = (CNeutrinoApp::getInstance()->getMode() == NeutrinoMessages::mode_webtv) && (!CZapit::getInstance()->GetCurrentChannel()->getScriptName().empty()); @@ -249,7 +250,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIO_SELECT: { keyhelper.get(&key,&icon); - menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts, NULL, new CAudioSelectMenuHandler, "-1", key,icon); + menu_item = new CMenuDForwarder(LOCALE_AUDIOSELECTMENUE_HEAD, !_mode_ts && !_mode_upnp, NULL, new CAudioSelectMenuHandler, "-1", key,icon); // FIXME menu_item->setHint("", NONEXISTANT_LOCALE); break; } @@ -285,7 +286,7 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) if (g_settings.recording_type == RECORDING_OFF) break; keyhelper.get(&key,&icon,CRCInput::RC_green); - menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts, NULL, neutrino, "tsmoviebrowser", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEBROWSER_HEAD, !_mode_ts && !_mode_upnp, NULL, neutrino, "tsmoviebrowser", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_MB, LOCALE_MENU_HINT_MB); break; } @@ -407,14 +408,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_YOUTUBE: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts, NULL, neutrino, "ytplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_YTPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "ytplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_YTPLAY, LOCALE_MENU_HINT_YTPLAY); break; } case SNeutrinoSettings::ITEM_FILEPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts, NULL, neutrino, "fileplayback", key, icon); + menu_item = new CMenuForwarder(LOCALE_MOVIEPLAYER_FILEPLAYBACK, !_mode_ts && !_mode_upnp, NULL, neutrino, "fileplayback", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_FILEPLAY, LOCALE_MENU_HINT_FILEPLAY); break; } @@ -442,14 +443,14 @@ bool CUserMenu::showUserMenu(neutrino_msg_t msg) case SNeutrinoSettings::ITEM_AUDIOPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, true, NULL, neutrino, "audioplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_AUDIOPLAYER_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "audioplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_APLAY, LOCALE_MENU_HINT_APLAY); break; } case SNeutrinoSettings::ITEM_INETPLAY: { keyhelper.get(&key,&icon); - menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, true, NULL, neutrino, "inetplayer", key, icon); + menu_item = new CMenuForwarder(LOCALE_INETRADIO_NAME, !_mode_ts && !_mode_upnp, NULL, neutrino, "inetplayer", key, icon); menu_item->setHint(NEUTRINO_ICON_HINT_INET_RADIO, LOCALE_MENU_HINT_INET_RADIO); break; } diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index be765c30c..f944ccfb9 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -131,7 +131,13 @@ bool CMenuItem::initModeCondition(const int& stb_mode) void CMenuItem::disableByCondition(const menu_item_disable_cond_t& condition) { int stb_mode = CNeutrinoApp::getInstance()->getMode(); - +#if ENABLE_UPNP + if (condition & DCOND_MODE_UPNP){ + if (stb_mode == CNeutrinoApp::mode_upnp) + if (initModeCondition(stb_mode)) + return; + } +#endif if (condition & DCOND_MODE_TS){ if (stb_mode == CNeutrinoApp::mode_ts) if (initModeCondition(stb_mode)) diff --git a/src/gui/widget/menue.h b/src/gui/widget/menue.h index 3b47f51de..4aa5797ca 100644 --- a/src/gui/widget/menue.h +++ b/src/gui/widget/menue.h @@ -78,6 +78,9 @@ enum DCOND_MODE_TV = 2, DCOND_MODE_RADIO = 4, DCOND_MODE_TS = 8 +#if ENABLE_UPNP + ,DCOND_MODE_UPNP = 16 +#endif }/*menu_item_disable_cond_t*/; class CChangeObserver diff --git a/src/neutrino_menue.cpp b/src/neutrino_menue.cpp index fc673329b..3b281fcae 100644 --- a/src/neutrino_menue.cpp +++ b/src/neutrino_menue.cpp @@ -164,17 +164,29 @@ void CNeutrinoApp::InitMenuMain() //tv <-> radio toggle CMenuForwarder *tvradio_switch = new CMenuForwarder(LOCALE_MAINMENU_TVRADIO_SWITCH, true, NULL, this, "tv_radio_switch", CRCInput::RC_red); tvradio_switch->setHint(NEUTRINO_ICON_HINT_TVRADIO_SWITCH, LOCALE_MENU_HINT_TVRADIO_SWITCH); - personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS); + personalize.addItem(MENU_MAIN, tvradio_switch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, NULL, DCOND_MODE_TS +#if ENABLE_UPNP + | DCOND_MODE_UPNP +#endif + ); //tv-mode CMenuForwarder *tvswitch = new CMenuForwarder(LOCALE_MAINMENU_TVMODE, true, NULL, this, "tv", CRCInput::RC_red); tvswitch->setHint(NEUTRINO_ICON_HINT_TVMODE, LOCALE_MENU_HINT_TVMODE); - personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS); //observed + personalize.addItem(MENU_MAIN, tvswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_TV_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_TV | DCOND_MODE_TS //observed +#if ENABLE_UPNP + | DCOND_MODE_UPNP +#endif + ); //radio-mode CMenuForwarder *radioswitch = new CMenuForwarder(LOCALE_MAINMENU_RADIOMODE, true, NULL, this, "radio", CRCInput::RC_green); radioswitch->setHint(NEUTRINO_ICON_HINT_RADIOMODE, LOCALE_MENU_HINT_RADIOMODE); - personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS); //observed + personalize.addItem(MENU_MAIN, radioswitch, &g_settings.personalize[SNeutrinoSettings::P_MAIN_RADIO_MODE], false, CPersonalizeGui::PERSONALIZE_SHOW_AS_ITEM_OPTION, tvradio_switch, DCOND_MODE_RADIO | DCOND_MODE_TS //observed +#if ENABLE_UPNP + | DCOND_MODE_UPNP +#endif + ); } //timer From c600b4c416b0fc409ff70e7d6a3898ae89a97bfa Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 03/19] Colorsettings: add possibility to change shadow color Shadow color was bound to infobar color and it's not really understandable why, because with some colors eg. black, the shadow is grey or with other colors it is exaggerated colored and seems to be not realistically and looks unusual if shadow is brighter or colorful than foreground. Some themes will thank it. TODO: update theme files with matching values if required --- data/locale/deutsch.locale | 2 ++ data/locale/english.locale | 2 ++ src/gui/osd_setup.cpp | 9 +++++++++ src/gui/themes.cpp | 10 ++++++++++ src/system/locals.h | 2 ++ src/system/locals_intern.h | 2 ++ src/system/setting_helpers.cpp | 6 +++--- src/system/settings.h | 5 +++++ 8 files changed, 35 insertions(+), 3 deletions(-) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 6aaf0e4eb..1319f74a8 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -325,6 +325,7 @@ colormenu.font_ttx Teletext Schriftart colormenu.menucolors Farben colormenu.osd_preset Monitor Auswahl colormenu.osd_resolution OSD-Auflösung +colormenu.shadow_color Schattenfarbe colormenu.textcolor Textfarbe colormenu.themeselect Theme auswählen colormenu.timing Timeouts @@ -1036,6 +1037,7 @@ menu.hint_color_gradient_separator_enable Farbverlauf für Menü-Trennlinien akt menu.hint_colored_events Definiert, ob die aktuelle oder nächste Sendung in einer anderen Farbe dargestellt werden soll menu.hint_colored_events_textcolor Ändern Sie die Farbe für farbige Events in der Kanalliste und der Infobar menu.hint_colors Konfigurieren Sie die Menü-Farben +menu.hint_colors_shadow Einstellen der Schattenfarbe menu.hint_content_back Ändern Sie die Hintergrundfarbe für den Fensterinhalt menu.hint_content_textcolor Ändern Sie die Textfarbe für den Fensterinhalt menu.hint_dboxinfo Informationen über CPU und Arbeitsspeicher der Box diff --git a/data/locale/english.locale b/data/locale/english.locale index cc4e86104..7ff88c04a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -325,6 +325,7 @@ colormenu.font_ttx Select Teletext font colormenu.menucolors Colors colormenu.osd_preset TV preset colormenu.osd_resolution OSD resolution +colormenu.shadow_color Shadow Color colormenu.textcolor Text color colormenu.themeselect Select theme colormenu.timing Timeouts @@ -1036,6 +1037,7 @@ menu.hint_color_gradient_separator_enable Disable/enable color gradient for menu menu.hint_colored_events Use different color for current or next event menu.hint_colored_events_textcolor Change color for colored events in channellist and infobar menu.hint_colors Configure GUI colors +menu.hint_colors_shadow Setup for shadow color. menu.hint_content_back Change GUI window background color menu.hint_content_textcolor Change GUI window text color menu.hint_dboxinfo Information about box cpu and storage diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index 06122d93a..a56e0365a 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -765,6 +765,8 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) &t.menu_Foot_alpha, colorSetupNotifier); CColorChooser* chFootTextcolor = new CColorChooser(LOCALE_COLORMENU_TEXTCOLOR, &t.menu_Foot_Text_red, &t.menu_Foot_Text_green, &t.menu_Foot_Text_blue, NULL, colorSetupNotifier); + CColorChooser* chShadowColor = new CColorChooser(LOCALE_COLORMENU_SHADOW_COLOR, &t.shadow_red, &t.shadow_green, &t.shadow_blue, + &t.menu_Head_alpha, colorSetupNotifier); menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_COLORMENUSETUP_MENUHEAD)); @@ -930,6 +932,13 @@ void COsdSetup::showOsdMenueColorSetup(CMenuWidget *menu_colors) oj = new CMenuOptionChooser(LOCALE_MISCSETTINGS_COLORED_EVENTS_INFOBAR, &t.colored_events_infobar, OPTIONS_COLORED_EVENTS_OPTIONS, OPTIONS_COLORED_EVENTS_OPTION_COUNT, true); oj->setHint("", LOCALE_MENU_HINT_COLORED_EVENTS); menu_colors->addItem(oj); + + // shadow + menu_colors->addItem( new CMenuSeparator(CMenuSeparator::LINE)); + + mf = new CMenuDForwarder(LOCALE_COLORMENU_SHADOW_COLOR, true, NULL, chShadowColor ); + mf->setHint("", LOCALE_MENU_HINT_COLORS_SHADOW); + menu_colors->addItem(mf); } /* for font size setup */ diff --git a/src/gui/themes.cpp b/src/gui/themes.cpp index 8e510b37a..70b202c6e 100644 --- a/src/gui/themes.cpp +++ b/src/gui/themes.cpp @@ -329,6 +329,11 @@ void CThemes::setTheme(CConfigFile &configfile) configfile.setInt32( "progressbar_timescale_green", t.progressbar_timescale_green); configfile.setInt32( "progressbar_timescale_yellow", t.progressbar_timescale_yellow); configfile.setInt32( "progressbar_timescale_invert", t.progressbar_timescale_invert); + + configfile.setInt32( "shadow_alpha", t.shadow_alpha ); + configfile.setInt32( "shadow_red", t.shadow_red ); + configfile.setInt32( "shadow_green", t.shadow_green ); + configfile.setInt32( "shadow_blue", t.shadow_blue ); } void CThemes::getTheme(CConfigFile &configfile) @@ -428,6 +433,11 @@ void CThemes::getTheme(CConfigFile &configfile) t.progressbar_timescale_green = configfile.getInt32("progressbar_timescale_green", 100); t.progressbar_timescale_yellow = configfile.getInt32("progressbar_timescale_yellow", 70); t.progressbar_timescale_invert = configfile.getInt32("progressbar_timescale_invert", 0); + + t.shadow_alpha = configfile.getInt32( "shadow_alpha", 0 ); + t.shadow_red = configfile.getInt32( "shadow_red", 8 ); + t.shadow_green = configfile.getInt32( "shadow_green", 8); + t.shadow_blue = configfile.getInt32( "shadow_blue", 8 ); } void CThemes::move_userDir() diff --git a/src/system/locals.h b/src/system/locals.h index f62dff5e9..9aee9e30b 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -352,6 +352,7 @@ typedef enum LOCALE_COLORMENU_MENUCOLORS, LOCALE_COLORMENU_OSD_PRESET, LOCALE_COLORMENU_OSD_RESOLUTION, + LOCALE_COLORMENU_SHADOW_COLOR, LOCALE_COLORMENU_TEXTCOLOR, LOCALE_COLORMENU_THEMESELECT, LOCALE_COLORMENU_TIMING, @@ -1063,6 +1064,7 @@ typedef enum LOCALE_MENU_HINT_COLORED_EVENTS, LOCALE_MENU_HINT_COLORED_EVENTS_TEXTCOLOR, LOCALE_MENU_HINT_COLORS, + LOCALE_MENU_HINT_COLORS_SHADOW, LOCALE_MENU_HINT_CONTENT_BACK, LOCALE_MENU_HINT_CONTENT_TEXTCOLOR, LOCALE_MENU_HINT_DBOXINFO, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index ea6d87aac..bdd72cbfd 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -352,6 +352,7 @@ const char * locale_real_names[] = "colormenu.menucolors", "colormenu.osd_preset", "colormenu.osd_resolution", + "colormenu.shadow_color", "colormenu.textcolor", "colormenu.themeselect", "colormenu.timing", @@ -1063,6 +1064,7 @@ const char * locale_real_names[] = "menu.hint_colored_events", "menu.hint_colored_events_textcolor", "menu.hint_colors", + "menu.hint_colors_shadow", "menu.hint_content_back", "menu.hint_content_textcolor", "menu.hint_dboxinfo", diff --git a/src/system/setting_helpers.cpp b/src/system/setting_helpers.cpp index f53bce83e..2212b569f 100644 --- a/src/system/setting_helpers.cpp +++ b/src/system/setting_helpers.cpp @@ -179,9 +179,9 @@ void CColorSetupNotifier::setPalette() 8, convertSetupAlpha2Alpha(t.infobar_alpha) ); frameBuffer->paletteGenFade(COL_SHADOW, - convertSetupColor2RGB(int(t.infobar_red*0.4), int(t.infobar_green*0.4), int(t.infobar_blue*0.4)), - convertSetupColor2RGB(t.infobar_Text_red, t.infobar_Text_green, t.infobar_Text_blue), - 8, convertSetupAlpha2Alpha(t.infobar_alpha) ); + convertSetupColor2RGB(int(t.shadow_red), int(t.shadow_green), int(t.shadow_blue)), + convertSetupColor2RGB(t.shadow_red, t.shadow_green, t.shadow_blue), + 8, convertSetupAlpha2Alpha(t.shadow_alpha) ); frameBuffer->paletteGenFade(COL_INFOBAR_CASYSTEM, convertSetupColor2RGB(t.infobar_casystem_red, t.infobar_casystem_green, t.infobar_casystem_blue), diff --git a/src/system/settings.h b/src/system/settings.h index 9ca4e21d6..e344c2c71 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -153,6 +153,11 @@ struct SNeutrinoTheme int progressbar_timescale_green; int progressbar_timescale_yellow; int progressbar_timescale_invert; + + unsigned char shadow_alpha; + unsigned char shadow_red; + unsigned char shadow_green; + unsigned char shadow_blue; }; struct timer_remotebox_item From 9c89f13cba84abe23b33c1480d505e8bc2a13820 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 04/19] CBuildInfo: add missing offset defines --- src/gui/buildinfo.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 2ffc959c4..bf7349352 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -173,13 +173,13 @@ void CBuildInfo::InitInfoItems() ccw_body->clear(); //define size and position - int x_info = 10; + int x_info = OFFSET_INNER_MID; int h_info = ccw_body->getHeight()/v_info.size(); //default height int w_info = width-2*x_info; //init info texts for(size_t i=0; igetText(v_info[i].caption), v_info[i].info_text, NULL, ccw_body); + CComponentsExtTextForm *info = new CComponentsExtTextForm(OFFSET_INNER_MID, CC_APPEND, w_info, h_info, g_Locale->getText(v_info[i].caption), v_info[i].info_text, NULL, ccw_body); info->setLabelAndTextFont(font); info->setTextModes(CTextBox::TOP , CTextBox::AUTO_HIGH | CTextBox::TOP | CTextBox::AUTO_LINEBREAK_NO_BREAKCHARS); info->doPaintBg(false); From c18e337d1fa81c5ff9505550490c814046efab12 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 05/19] offsets: add SIDEBAR_WIDTH required in window class --- src/gui/components/cc_frm_window.cpp | 2 +- src/system/settings.h | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 39aaffbf8..5c05a19ed 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -153,7 +153,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_align_mode = DEFAULT_TITLE_ALIGN; ccw_show_l_sideber = false; ccw_show_r_sideber = false; - ccw_w_sidebar = 40; + ccw_w_sidebar = SIDEBAR_WIDTH; ccw_col_head = COL_MENUHEAD_PLUS_0; ccw_col_head_text = COL_MENUHEAD_TEXT; ccw_col_footer = COL_MENUFOOT_PLUS_0; diff --git a/src/system/settings.h b/src/system/settings.h index e344c2c71..534c7a7a3 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -948,6 +948,8 @@ const time_settings_struct_t timing_setting[SNeutrinoSettings::TIMING_SETTING_CO #define DETAILSLINE_WIDTH CFrameBuffer::getInstance()->scale2Res(16) +#define SIDEBAR_WIDTH CFrameBuffer::getInstance()->scale2Res(40) + #define BIGFONT_FACTOR 1.5 struct SglobalInfo From 9678adc4017771205c59b23b93e1cdf3849ef630 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 06/19] CBuildinfo: Don't load graphical related objects if not needed. Objects are only required in show mode. HasData() is renamed because of for more plausibility. --- src/gui/buildinfo.cpp | 15 +++++++-------- src/gui/buildinfo.h | 2 +- 2 files changed, 8 insertions(+), 9 deletions(-) diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index bf7349352..fb9d7a3ac 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -35,13 +35,13 @@ using namespace std; -CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENT 90, CCW_PERCENT 90, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, CCW_PERCENT 85, CCW_PERCENT 85, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); if (show) exec(NULL, ""); else - InitInfoItems(); + GetData(); } //init all var members @@ -52,7 +52,6 @@ void CBuildInfo::initVarBuildInfo() font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); - shadow = CC_SHADOW_ON; } @@ -64,13 +63,13 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) if (parent) parent->hide(); - InitInfoItems(); - //exit if no informations available - if (!HasData()){ + if (!GetData()){ return res; } + InitInfoItems(); + //paint window if (!is_painted) paint(); @@ -117,7 +116,7 @@ void CBuildInfo::setFontType(Font* font_text) InitInfoItems(); } -bool CBuildInfo::HasData() +bool CBuildInfo::GetData() { v_info.clear(); @@ -166,7 +165,7 @@ bool CBuildInfo::HasData() void CBuildInfo::InitInfoItems() { //get and checkup required informations - if (!HasData()) + if (!GetData()) return; //ensure a clean body diff --git a/src/gui/buildinfo.h b/src/gui/buildinfo.h index 154cba8bb..30a1033be 100644 --- a/src/gui/buildinfo.h +++ b/src/gui/buildinfo.h @@ -52,7 +52,7 @@ class CBuildInfo : public CMenuTarget, public CComponentsWindow void initVarBuildInfo(); void InitInfoItems(); - bool HasData(); + bool GetData(); public: //type_id's for infos From 4e66739ff583db0e4be981d14a9052ae77c3a9b7 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 07/19] CFrameBuffer: fb-generic.cpp - add methode for clean up icon cache This could be required eg. on changed resoulutions or changed iconsets on runtime. --- src/driver/fb_generic.cpp | 20 ++++++++++++-------- src/driver/fb_generic.h | 1 + 2 files changed, 13 insertions(+), 8 deletions(-) diff --git a/src/driver/fb_generic.cpp b/src/driver/fb_generic.cpp index af678dc7c..ad9f77d34 100644 --- a/src/driver/fb_generic.cpp +++ b/src/driver/fb_generic.cpp @@ -207,16 +207,9 @@ nolfb: lbb = lfb = NULL; } - CFrameBuffer::~CFrameBuffer() { - std::map::iterator it; - - for(it = icon_cache.begin(); it != icon_cache.end(); ++it) { - /* printf("FB: delete cached icon %s: %x\n", it->first.c_str(), (int) it->second.data); */ - cs_free_uncached(it->second.data); - } - icon_cache.clear(); + clearIconCache(); if (background) { delete[] background; @@ -921,6 +914,17 @@ _display: return true; } +void CFrameBuffer::clearIconCache() +{ + std::map::iterator it; + + for(it = icon_cache.begin(); it != icon_cache.end(); ++it) { + /* printf("FB: delete cached icon %s: %x\n", it->first.c_str(), (int) it->second.data); */ + cs_free_uncached(it->second.data); + } + icon_cache.clear(); +} + void CFrameBuffer::loadPal(const std::string & filename, const unsigned char offset, const unsigned char endidx) { if (!getActive()) diff --git a/src/driver/fb_generic.h b/src/driver/fb_generic.h index b355377ce..4b68e1e18 100644 --- a/src/driver/fb_generic.h +++ b/src/driver/fb_generic.h @@ -239,6 +239,7 @@ class CFrameBuffer : public sigc::trackable const int h = 0, const unsigned char offset = 1, bool paint = true, bool paintBg = false, const fb_pixel_t colBg = 0); bool paintIcon8(const std::string & filename, const int x, const int y, const unsigned char offset = 0); void loadPal (const std::string & filename, const unsigned char offset = 0, const unsigned char endidx = 255); + void clearIconCache(); bool loadPicture2Mem (const std::string & filename, fb_pixel_t * const memp); bool loadPicture2FrameBuffer(const std::string & filename); From 58d4f13bb7beef046f3d94bff8e0c0851affd69f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 08/19] COsdSetup: add slot to ensure clean up icon cache on changed resolution. Some old icon data makes no sense with changed resolution. In some cases it could happens that no icons are to see on screen after changed resolution. This should fix this, --- src/gui/osd_setup.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index a56e0365a..88b0c8e5e 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -668,6 +668,7 @@ int COsdSetup::showOsdSetup() COsdHelpers::getInstance()->isVideoSystem1080(videoSystem) && (g_settings.video_Mode != VIDEO_STD_AUTO)); CMenuOptionChooser * osd_res = new CMenuOptionChooser(LOCALE_COLORMENU_OSD_RESOLUTION, &g_settings.osd_resolution, kext, resCount, enable, this); + osd_res->OnAfterChangeOption.connect(sigc::mem_fun(frameBuffer->getInstance(), &CFrameBuffer::clearIconCache)); osd_res->setHint("", LOCALE_MENU_HINT_OSD_RESOLUTION); osd_menu->addItem(osd_res); #endif From 356719cf3a771cb2eb667969e7072b97a6501e0b Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 09/19] CComponentsHeader: rework and simplified logo handling This should fix some issues with possible overlapps of logos with title. With some Conditions with text alignment on the right side needs a fix. There is an issue with size and position of text object, but is stll not used at the moment. For all other conditions of logo and text alignments now it should be not a problem (I hope) and have more code clarity. --- src/gui/components/cc_frm_header.cpp | 104 ++++++++++++++------------- src/gui/components/cc_frm_header.h | 2 +- 2 files changed, 54 insertions(+), 52 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index a74875e72..7a6acec9f 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -273,6 +273,7 @@ void CComponentsHeader::initIcon() void CComponentsHeader::initLogo() { + // init logo with required height and logo int h_logo = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max; if(!cch_logo_obj) @@ -291,70 +292,71 @@ void CComponentsHeader::initLogo() h_logo = dy_orig; } - //cch_logo_obj->setWidth(1, true); + // manage logo position if (cch_logo_obj->hasLogo()){ cch_logo_obj->setHeight(h_logo, true); - // set id of logo item depends of neighbor items + /* Detect next and previous items, + * current item is logo item. + */ int logo_id = getCCItemId(cch_logo_obj); - int prev_id = logo_id - 1; + CComponentsItem *prev_item = getCCItem((cch_caption_align & CC_TITLE_RIGHT) ? logo_id - 2 : logo_id - 1); + CComponentsItem *next_item = getCCItem((cch_caption_align & CC_TITLE_RIGHT) ? logo_id - 1 : logo_id + 1); - //right end - int x_logo_right = width - cch_logo_obj->getWidth(); - if (!(cch_caption_align & CC_TITLE_RIGHT)){ - if (cch_btn_obj) - x_logo_right -= cch_btn_obj->getWidth(); - if (cch_cl_obj) - x_logo_right -= cch_cl_obj->getWidth(); - }else{ - if (cch_icon_obj) - x_logo_right += cch_icon_obj->getWidth(); + /* + * FIXME: Workaround to fix next item in case of wrong order of items. + */ + if (next_item){ + if (next_item->getItemType() == CC_ITEMTYPE_FRM_ICONFORM) + next_item = cch_cl_obj; } - //left end - int x_logo_left = cch_offset; - if (!(cch_caption_align & CC_TITLE_RIGHT)) - x_logo_left = getCCItem(prev_id) ? getCCItem(prev_id)->getXPos() + getCCItem(prev_id)->getWidth() : 0; - else - if (cch_icon_obj) - x_logo_left += cch_icon_obj->getWidth(); + /* + * Adjust usable space for logo. + */ + int x_logo_left = prev_item ? prev_item->getXPos() + prev_item->getWidth() : cch_offset; + int x_logo_right = next_item ? next_item->getXPos() : width - cch_offset; + int logo_space = x_logo_right - x_logo_left; - //calculate available space - int logo_space = x_logo_right + cch_logo_obj->getWidth() - x_logo_left; - - //reduce logo width if logo space too small + /* + * Reduce logo width if logo space too small + * and adjust logo new width if required. + */ int w_logo = min(cch_logo_obj->getWidth(), logo_space); cch_logo_obj->setWidth(w_logo, true); - //set final logo position - int x_logo = 0; - if (cch_logo.Align & CC_LOGO_RIGHT){ - if (cch_caption_align & CC_TITLE_RIGHT){ - if (cch_text_obj) - x_logo = cch_text_obj->getXPos() - cch_logo_obj->getWidth(); - }else - x_logo = x_logo_right; - } + /* + * Adjust logo x position depends of align parameters. + */ + int x_logo = x_logo_left; + if (cch_logo.Align & CC_LOGO_RIGHT) + x_logo = x_logo_right - w_logo; + if (cch_logo.Align & CC_LOGO_LEFT) x_logo = x_logo_left; + if (cch_logo.Align & CC_LOGO_CENTER){ - x_logo = width/2 - cch_logo_obj->getWidth()/2; - //fallback if adjacent item and logo are overlapping - if (!(cch_caption_align & CC_TITLE_RIGHT)){ - if (getCCItem(prev_id)){ - int x_tmp = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; - if (x_logo <= x_logo_left) - x_logo = x_tmp; - } - }else{ - if (cch_text_obj){ - if (x_logo + cch_logo_obj->getWidth() >= cch_text_obj->getXPos()){ - x_logo = (x_logo_left + cch_text_obj->getXPos())/2 - cch_logo_obj->getWidth()/2; - } - } + x_logo = logo_space/2 - w_logo/2; + /* + * We are using centered mode as default, + * but we must notice possible overlapp + * with previous or next item. + */ + if (cch_caption_align & CC_TITLE_LEFT){ + int left_tag = prev_item->getXPos() + prev_item->getWidth(); + if (x_logo <= left_tag) + x_logo = left_tag + logo_space/2 - w_logo/2; + } + + if (cch_caption_align & CC_TITLE_RIGHT){ + if (x_logo + w_logo >= next_item->getXPos()) + x_logo = next_item->getXPos() - logo_space/2 - w_logo/2; } } + /* + * Finally set logo x position + */ cch_logo_obj->setXPos(x_logo); cch_logo_obj->setYPos(height/2 - cch_logo_obj->getHeight()/2); } @@ -547,7 +549,7 @@ void CComponentsHeader::initCaption() } //calc width of text object in header - cc_text_w = width-cch_text_x-cch_offset; + cc_text_w = width-cch_text_x/*-cch_offset*/; //context buttons int buttons_w = 0; @@ -601,15 +603,15 @@ void CComponentsHeader::initCaption() int w_free = cc_text_w; //recalc caption width - cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); + cc_text_w = min(cc_text_w, cch_font->getRenderWidth(cch_text)) + cch_offset; //set alignment of text item in dependency from text alignment if (cch_caption_align & CC_TITLE_CENTER) cch_text_x = width/2 - cc_text_w/2; - if (cch_caption_align & CC_TITLE_RIGHT){ + if (cch_caption_align & CC_TITLE_RIGHT){ //FIXME: does not work correct with some conditions, but still not used at the moment cch_text_x += w_free; - cch_text_x -= max(cc_text_w, cch_font->getRenderWidth(cch_text)+ OFFSET_INNER_MID); + cch_text_x -= max(cc_text_w, cch_font->getRenderWidth(cch_text)); } //assign general properties diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index 1d634c3cd..2f96c7baf 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -32,7 +32,7 @@ #include "cc_frm_clock.h" #include -#define DEFAULT_LOGO_ALIGN CCHeaderTypes::CC_LOGO_CENTER +#define DEFAULT_LOGO_ALIGN CCHeaderTypes::CC_LOGO_RIGHT #define DEFAULT_TITLE_ALIGN CCHeaderTypes::CC_TITLE_LEFT class CCHeaderTypes From 8e17eadb6ae005a88619dc93028ff5ada16d46ce Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 2 Aug 2017 08:59:56 +0200 Subject: [PATCH 10/19] CComponentsHeader: disable permanent clock paint on interval. --- src/gui/components/cc_frm_header.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 7a6acec9f..2a8d82db8 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -507,6 +507,7 @@ void CComponentsHeader::initClock() if (cch_cl_obj == NULL){ dprintf(DEBUG_DEBUG, "[CComponentsHeader]\n [%s - %d] init clock...\n", __func__, __LINE__); cch_cl_obj = new CComponentsFrmClock(0, cch_items_y, cch_font, cch_cl_format, NULL, false, 1, this); + cch_cl_obj->disableForceSegmentPaint(); cch_cl_obj->doPaintBg(false); } From bfedeffb61945a3a13a41057654a663056fceca6 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Wed, 26 Jul 2017 21:34:09 +0200 Subject: [PATCH 11/19] - audioplayer: fix right offsets for item 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 03edd14c6..99b9ccb57 100644 --- a/src/gui/audioplayer.cpp +++ b/src/gui/audioplayer.cpp @@ -1591,8 +1591,8 @@ void CAudioPlayerGui::paintItem(int pos) else snprintf(dura, 8, "%ld:%02ld", m_playlist[currpos].MetaData.total_time / 60, m_playlist[currpos].MetaData.total_time % 60); - int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura) + OFFSET_INNER_SMALL; - g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - 2*OFFSET_INNER_MID - w, tmp, color, m_item_height); + int w = g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->getRenderWidth(dura); + g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + OFFSET_INNER_MID, ypos + m_item_height, m_width - SCROLLBAR_WIDTH - 3*OFFSET_INNER_MID - w, tmp, color, m_item_height); g_Font[SNeutrinoSettings::FONT_TYPE_MENU]->RenderString(m_x + m_width - SCROLLBAR_WIDTH - OFFSET_INNER_MID - w, ypos + m_item_height, w, dura, color, m_item_height); if (currpos == m_selected) { From bc5b3edc93350dfb55661add0d87d6caae9d3141 Mon Sep 17 00:00:00 2001 From: TangoCash Date: Mon, 7 Nov 2016 19:52:28 +0100 Subject: [PATCH 12/19] fix epgtitle Signed-off-by: Thilo Graf --- src/gui/timerlist.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/timerlist.cpp b/src/gui/timerlist.cpp index c54dbf792..8d39b1783 100644 --- a/src/gui/timerlist.cpp +++ b/src/gui/timerlist.cpp @@ -840,7 +840,8 @@ void CTimerList::RemoteBoxTimerList(CTimerd::TimerList &rtimerlist) rtimer.stopTime = (time_t) atoll(remotetimers[i]["stop"][0].get("digits","").asString().c_str()); rtimer.epgID = (event_id_t) atoi(remotetimers[i].get("epg_id","").asString()); sscanf(remotetimers[i].get("channel_id","").asString().c_str(), SCANF_CHANNEL_ID_TYPE, &rtimer.channel_id); - strncpy(rtimer.epgTitle,remotetimers[i].get("title","").asString().c_str(),51); + strncpy(rtimer.epgTitle,remotetimers[i].get("title","").asString().c_str(),sizeof(rtimer.epgTitle)); + rtimer.epgTitle[sizeof(rtimer.epgTitle) - 1] = 0; if (remotetimers[i]["audio"].get("apids_conf","").asString() == "true") rtimer.apids = TIMERD_APIDS_CONF; //printf("[remotetimer] r-timer:%s - %s\n", remotetimers[i].get("channel_id","").asString().c_str(), remotetimers[i].get("title","").asString().c_str()); From dcdff2c03bbc05802620eccb33d3abebd0371cf4 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 3 Aug 2017 17:32:09 +0200 Subject: [PATCH 13/19] CComponentsItem: move real position methods from draw class into item class These methods ar only relavant for items --- src/gui/components/cc_draw.h | 15 ++------------- src/gui/components/cc_item.h | 11 +++++++++++ 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index ab7400ca8..76b047f4c 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -62,9 +62,9 @@ class CCDraw : public COSDFader, public CComponentsSignals ///property: y-position on screen, to alter setPos() or setDimensionsAll(), see also defines CC_APPEND, CC_CENTERED int y, y_old; ///property: contains real x-position on screen - int cc_xr; + int cc_xr, cc_xr_old; ///property: contains real y-position on screen - int cc_yr; + int cc_yr, cc_yr_old; ///property: height-dimension on screen, to alter with setHeight() or setDimensionsAll() int height, height_old; ///property: width-dimension on screen, to alter with setWidth() or setDimensionsAll() @@ -184,17 +184,6 @@ class CCDraw : public COSDFader, public CComponentsSignals ///to set the real screen position, look at setRealPos() virtual void setPos(const int& xpos, const int& ypos){setXPos(xpos); setYPos(ypos);} - ///sets real x position on screen. Use this, if item is added to a parent form - virtual void setRealXPos(const int& xr){cc_xr = xr;} - ///sets real y position on screen. Use this, if item is added to a parent form - virtual void setRealYPos(const int& yr){cc_yr = yr;} - ///sets real x and y position on screen at once. Use this, if item is added to a parent form - virtual void setRealPos(const int& xr, const int& yr){cc_xr = xr; cc_yr = yr;} - ///get real x-position on screen. Use this, if item contains own render methods and item is bound to a form - virtual int getRealXPos(){return cc_xr;} - ///get real y-position on screen. Use this, if item contains own render methods and item is bound to a form - virtual int getRealYPos(){return cc_yr;} - ///set height of component on screen virtual void setHeight(const int& h); ///set width of component on screen diff --git a/src/gui/components/cc_item.h b/src/gui/components/cc_item.h index d168c3832..d76684020 100644 --- a/src/gui/components/cc_item.h +++ b/src/gui/components/cc_item.h @@ -146,6 +146,17 @@ class CComponentsItem : public CComponents ///set x and y position as percent value related to current parent form or screen dimensions at once virtual void setPosP(const uint8_t& xpos_percent, const uint8_t& ypos_percent); + ///sets real x position on screen. Use this, if item is added to a parent form + virtual void setRealXPos(const int& xr){cc_xr = xr;} + ///sets real y position on screen. Use this, if item is added to a parent form + virtual void setRealYPos(const int& yr){cc_yr = yr;} + ///sets real x and y position on screen at once. Use this, if item is added to a parent form + virtual void setRealPos(const int& xr, const int& yr){cc_xr = xr; cc_yr = yr;} + ///get real x-position on screen. Use this, if item contains own render methods and item is bound to a form + virtual int getRealXPos(){return cc_parent ? cc_xr : x;} + ///get real y-position on screen. Use this, if item contains own render methods and item is bound to a form + virtual int getRealYPos(){return cc_parent ? cc_yr : y;} + ///do center item on screen or within a parent form, parameter along_mode assigns direction of centering virtual void setCenterPos(int along_mode = CC_ALONG_X | CC_ALONG_Y); From 9687dda8673bb907d7f47eb597bb55ab81d94951 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 3 Aug 2017 17:37:14 +0200 Subject: [PATCH 14/19] CCDraw: add missing member for real item position Changes of real positions were not watched. --- src/gui/components/cc_draw.cpp | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 39ca711d8..0ac6128c0 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -35,8 +35,8 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) { frameBuffer = CFrameBuffer::getInstance(); - x = cc_xr = x_old = 0; - y = cc_yr = y_old = 0; + x = cc_xr = cc_xr_old = x_old = 0; + y = cc_yr = cc_yr_old = y_old = 0; height = height_old = CC_HEIGHT_MIN; width = width_old = CC_WIDTH_MIN; @@ -95,14 +95,16 @@ CCDraw::~CCDraw() inline bool CCDraw::applyPosChanges() { bool ret = false; - if (x != x_old){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], Pos changes x %d != x_old %d...\033[0m\n", __func__, __LINE__, x, x_old); + if (x != x_old || cc_xr != cc_xr_old){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], Pos changes x %d != x_old %d... [cc_xr = %d cc_xr_old = %d]\033[0m\n", __func__, __LINE__, x, x_old, cc_xr, cc_xr_old); x_old = x; + cc_xr_old = cc_xr; ret = true; } - if (y != y_old){ - dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], Pos changes y %d != y_old %d...\033[0m\n", __func__, __LINE__, y, y_old); + if (y != y_old || cc_yr != cc_yr_old){ + dprintf(DEBUG_INFO, "\033[33m[CCDraw]\t[%s - %d], Pos changes y %d != y_old %d... [cc_yr = %d cc_yr_old = %d]\033[0m\n", __func__, __LINE__, y, y_old, cc_yr, cc_yr_old); y_old = y; + cc_yr_old = cc_yr; ret = true; } From a19a1f067e5a101c18b62db6fc56eeb132ea32ee Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Thu, 3 Aug 2017 17:34:37 +0200 Subject: [PATCH 15/19] CComponentsItem: fix possible issues with position inside forms This ensures relative position for items inside form --- src/gui/components/cc_item.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 54c335c9a..be2e6678a 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -265,14 +265,14 @@ void CComponentsItem::setXPos(const int& xpos) { CCDraw::setXPos(xpos); if (cc_parent) - cc_xr = cc_parent->getXPos() + x; + cc_xr = cc_parent->getRealXPos() + x; } void CComponentsItem::setYPos(const int& ypos) { CCDraw::setYPos(ypos); if (cc_parent) - cc_yr = cc_parent->getYPos() + y; + cc_yr = cc_parent->getRealYPos() + y; } void CComponentsItem::setXPosP(const uint8_t& xpos_percent) From a4af92d219ace2edc1eb64457a04a698d2ed18bc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 4 Aug 2017 15:30:21 +0200 Subject: [PATCH 16/19] CComponentsForm: add methods to get previous and next item --- src/gui/components/cc_frm.cpp | 10 ++++++++++ src/gui/components/cc_frm.h | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 43 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 33dd15c94..2725183d7 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -257,6 +257,16 @@ CComponentsItem* CComponentsForm::getCCItem(const uint& cc_item_id) return NULL; } +CComponentsItem* CComponentsForm::getPrevCCItem(CComponentsItem* current_cc_item) +{ + return getCCItem(getCCItemId(current_cc_item) - 1); +} + +CComponentsItem* CComponentsForm::getNextCCItem(CComponentsItem* current_cc_item) +{ + return getCCItem(getCCItemId(current_cc_item) + 1); +} + void CComponentsForm::replaceCCItem(const uint& cc_item_id, CComponentsItem* new_cc_Item) { if (!v_cc_items.empty()){ diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 0b7b74401..cb512856c 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -106,8 +106,39 @@ class CComponentsForm : public CComponentsItem virtual void replaceCCItem(CComponentsItem* old_cc_Item, CComponentsItem* new_cc_Item); virtual void exchangeCCItem(const uint& item_id_a, const uint& item_id_b); virtual void exchangeCCItem(CComponentsItem* item_a, CComponentsItem* item_b); - virtual int getCCItemId(CComponentsItem* cc_Item); - virtual CComponentsItem* getCCItem(const uint& cc_item_id); + + /**Function to get current item id from passed item. + * @param[in] cc_Item + * @li CComponentsItem* + * @return + * int, in case of not found item returns -1 + */ + int getCCItemId(CComponentsItem* cc_Item); + + /**Function to get current item from item collection. + * @param[in] cc_item_id + * @li item id as unsigned int + * @return + * CComponentsItem*, in case of not found item returns NULL + */ + CComponentsItem* getCCItem(const uint& cc_item_id); + + /**Function to get previous item from item collection. + * @param[in] current_cc_item + * @li CComponentsItem* + * @return + * CComponentsItem*, in case of not found item returns NULL + */ + CComponentsItem* getPrevCCItem(CComponentsItem* current_cc_item); + + /**Function to get next item from item collection. + * @param[in] current_cc_item + * @li CComponentsItem* + * @return + * CComponentsItem*, in case of not found item returns NULL + */ + CComponentsItem* getNextCCItem(CComponentsItem* current_cc_item); + virtual void paintCCItems(); ///clean up and deallocate existant items from v_cc_items at once From 67a71d5e4e795fd7243c22b9eb98cb7da79d0cfd Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 4 Aug 2017 19:08:50 +0200 Subject: [PATCH 17/19] CComponentsForm: add functions to get used or free space of form dimensions --- src/gui/components/cc_frm.cpp | 18 ++++++++++++++++++ src/gui/components/cc_frm.h | 25 +++++++++++++++++++++++++ 2 files changed, 43 insertions(+) diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 2725183d7..defe1433c 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -695,3 +695,21 @@ bool CComponentsForm::enableColBodyGradient(const int& enable_mode, const fb_pix } return false; } + +int CComponentsForm::getUsedDY() +{ + int y_res = 0; + for (size_t i= 0; i< v_cc_items.size(); i++) + y_res = max(v_cc_items[i]->getYPos() + v_cc_items[i]->getHeight(), y_res); + + return y_res; +} + +int CComponentsForm::getUsedDX() +{ + int x_res = 0; + for (size_t i= 0; i< v_cc_items.size(); i++) + x_res = max(v_cc_items[i]->getXPos() + v_cc_items[i]->getWidth(), x_res); + + return x_res; +} diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index cb512856c..ca8daa31f 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -183,6 +183,31 @@ class CComponentsForm : public CComponentsItem virtual void setScrollBarWidth(const int& scrollbar_width){w_sb = scrollbar_width;}; ///returns id of selected item, return value as int, returns -1: if is nothing selected virtual int getSelectedItem(); + + /**Function to get consumed space of items inside form in y direction. + * @return + * int, used lines + */ + int getUsedDY(); + + /**Function to get consumed space of items inside form in x direction. + * @return + * int, used lines + */ + int getUsedDX(); + + /**Function to get free usable space of items inside form in y direction. + * @return + * int, free lines + */ + int getFreeDY(){return height - getUsedDY();} + + /**Function to get free usable space of items inside form in x direction. + * @return + * int, free lines + */ + int getFreeDX(){return width - getUsedDX();} + ///returns pointer to selected item, return value as CComponentsItem*, returns NULL: if is nothing selected virtual CComponentsItem* getSelectedItemObject(); ///select a definied item, parameter1 as size_t From 8c4fe6df2f03b97d45b819c3117e0ef49c908753 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Tue, 1 Aug 2017 14:44:21 +0200 Subject: [PATCH 18/19] - menu: fix icon for CGenericMenuNext forwarder Signed-off-by: Thilo Graf --- src/gui/widget/menue.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index f944ccfb9..d246b1936 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -51,7 +51,7 @@ CMenuSeparator CGenericMenuSeparator(0, NONEXISTANT_LOCALE, true); CMenuSeparator CGenericMenuSeparatorLine(CMenuSeparator::LINE, NONEXISTANT_LOCALE, true); CMenuForwarder CGenericMenuBack(LOCALE_MENU_BACK, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_LEFT, NULL, true); CMenuForwarder CGenericMenuCancel(LOCALE_MENU_CANCEL, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_HOME, NULL, true); -CMenuForwarder CGenericMenuNext(LOCALE_MENU_NEXT, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_HOME, NULL, true); +CMenuForwarder CGenericMenuNext(LOCALE_MENU_NEXT, true, NULL, NULL, NULL, CRCInput::RC_nokey, NEUTRINO_ICON_BUTTON_RIGHT, NULL, true); CMenuSeparator * const GenericMenuSeparator = &CGenericMenuSeparator; CMenuSeparator * const GenericMenuSeparatorLine = &CGenericMenuSeparatorLine; CMenuForwarder * const GenericMenuBack = &CGenericMenuBack; From 57e410c052f7f03e200e50028a55b97f24427e6d Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 7 Aug 2017 16:58:55 +0200 Subject: [PATCH 19/19] english.locale: corrections in channellist locales Consideration of rules for capitalization of headings, titles and labels. --- data/locale/english.locale | 56 +++++++++++++++++++------------------- 1 file changed, 28 insertions(+), 28 deletions(-) diff --git a/data/locale/english.locale b/data/locale/english.locale index 7ff88c04a..474aeeed7 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -233,52 +233,52 @@ buildinfo.creator Creator buildinfo.kernel Kernel version buildinfo.menu Build information cablesetup.provider cable provider -channellist.additional Additional informations -channellist.additional_off off -channellist.additional_on on -channellist.additional_on_minitv on (with MiniTV) -channellist.current_tp Current transponder +channellist.additional Additional Informations +channellist.additional_off Off +channellist.additional_on On +channellist.additional_on_minitv On (with MiniTV) +channellist.current_tp Current Transponder channellist.edit Edit -channellist.epgtext_align_left left -channellist.epgtext_align_right right -channellist.extended Show event progress +channellist.epgtext_align_left Left +channellist.epgtext_align_right Right +channellist.extended Show Event Progress channellist.extended_colored with colored progressbar channellist.extended_simple with simple progressbar -channellist.favs Favoriten +channellist.favs Favorites channellist.foot Channel Information channellist.foot_freq Sat/Freq Info -channellist.foot_next next Event -channellist.foot_off off -channellist.foot_sort_alpha sorted[alpha] -channellist.foot_sort_chnum sorted[number] -channellist.foot_sort_freq sorted[freq] -channellist.foot_sort_sat sorted[sat] +channellist.foot_next Next Event +channellist.foot_off Off +channellist.foot_sort_alpha Sorted[Alpha] +channellist.foot_sort_chnum Sorted[Number] +channellist.foot_sort_freq Sorted[Freq] +channellist.foot_sort_sat Sorted[Sat] channellist.head All Services channellist.history History -channellist.history_clear Clear history -channellist.keep_numbers Persistent channel numbers +channellist.history_clear Clear History +channellist.keep_numbers Persistent Channel Numbers channellist.make_hdlist Create list of HD channels channellist.make_newlist Create list of new channels channellist.make_removedlist Create list of removed channels channellist.make_webtvlist Create list of WebTV channels -channellist.new_zap_mode Quickzap in list -channellist.new_zap_mode_active active -channellist.new_zap_mode_allow allow -channellist.new_zap_mode_off off +channellist.new_zap_mode Quickzap in List +channellist.new_zap_mode_active Active +channellist.new_zap_mode_allow Allow +channellist.new_zap_mode_off Off channellist.nonefound No channels were found!\nPlease execute a scan\n(MENU-key -> service) -channellist.numeric_adjust Numeric zap adjust +channellist.numeric_adjust Numeric Zap Adjust channellist.provs Providers channellist.recording_not_possible Recording not possible! channellist.remember Last used channellist.reset_all Reset 'new' flag for all channels channellist.reset_flags Reset 'new' channel flag channellist.sats Satellites -channellist.show_channellogo Show channel logos -channellist.show_channelnumber Show channel numbers -channellist.show_empty_favs Show empty favorites bouquets -channellist.show_infobox Show bottom infobox -channellist.since since -channellist.start starts +channellist.show_channellogo Show Channel Logos +channellist.show_channelnumber Show Channel Numbers +channellist.show_empty_favs Show empty Favorites Bouquets +channellist.show_infobox Show Bottom Infobox +channellist.since Since +channellist.start Starts ci.clock CI clock (Mhz) ci.empty No CAM in slot ci.ignore_msg Ignore CA messages