diff --git a/configure.ac b/configure.ac index 0310fd47f..5ce417d76 100644 --- a/configure.ac +++ b/configure.ac @@ -1,4 +1,4 @@ -AC_INIT(Neutrino-MP,3.4.0) +AC_INIT(Neutrino-MP,3.4.1) AM_INIT_AUTOMAKE([1.0.1 nostdinc]) m4_ifdef([AM_SILENT_RULES], [AM_SILENT_RULES]) @@ -99,6 +99,19 @@ AM_CONDITIONAL(USE_TREMOR, test "$TREMOR" = "yes") # TUXBOX_APPS_LIB_PKGCONFIG(OPENSSL,openssl) TUXBOX_APPS_LIB_PKGCONFIG(CURL,libcurl) TUXBOX_APPS_LIB_PKGCONFIG(FREETYPE,freetype2) +CPPFLAGS+=" $(freetype-config --cflags)" +AC_MSG_CHECKING([whether FreeType version is 2.5.0 or higher]) + AC_TRY_CPP([ + #include + #include FT_FREETYPE_H + #if FREETYPE_MAJOR < 2 || (FREETYPE_MAJOR == 2 && FREETYPE_MINOR < 5) + #error Freetype version too low. + #endif + ], + [AC_MSG_RESULT(yes)], + [AC_MSG_ERROR([Need FreeType library version 2.5.0 or higher]) + ]) + # fallback to curl-config (which is ugly for cross-compilation) if test -z "$CURL_LIBS" -a -z "$CURL_CFLAGS"; then TUXBOX_APPS_LIB_CONFIG(CURL,curl-config) diff --git a/data/locale/deutsch.locale b/data/locale/deutsch.locale index 4b94d2462..7dabc621f 100644 --- a/data/locale/deutsch.locale +++ b/data/locale/deutsch.locale @@ -319,7 +319,6 @@ colormenu.advanced_mode_off Standard-Optionen colormenu.advanced_mode_on Erweiterte Optionen colormenu.background Hintergrundfarbe colormenu.clock_textcolor Ziffernfarbe -colormenu.contrast_fonts Schriftkontrast colormenu.fade Ein-/Ausblenden colormenu.font Verwendete Schriftart colormenu.font_ttx Teletext Schriftart @@ -1030,7 +1029,6 @@ menu.hint_colored_events_textcolor Ändern Sie die Farbe für farbige Events in menu.hint_colors Konfigurieren Sie die Menü-Farben 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_contrast_fonts Wählen Sie einen höheren Schriftkontrast menu.hint_dboxinfo Informationen über CPU und Arbeitsspeicher der Box menu.hint_delete_channels Löschen aller Kanäle menu.hint_delete_removed Lösche das Bouquet 'Gelöschte Kanäle' diff --git a/data/locale/english.locale b/data/locale/english.locale index ad89c1170..036cfaa2a 100644 --- a/data/locale/english.locale +++ b/data/locale/english.locale @@ -319,7 +319,6 @@ colormenu.advanced_mode_off Default options colormenu.advanced_mode_on Advanced options colormenu.background Background colormenu.clock_textcolor Digit color -colormenu.contrast_fonts Contrast fonts colormenu.fade Fade GUI colormenu.font Select GUI font colormenu.font_ttx Select Teletext font @@ -1030,7 +1029,6 @@ menu.hint_colored_events_textcolor Change color for colored events in channellis menu.hint_colors Configure GUI colors menu.hint_content_back Change GUI window background color menu.hint_content_textcolor Change GUI window text color -menu.hint_contrast_fonts Make fonts contrast (do not blend with background) menu.hint_dboxinfo Information about box cpu and storage menu.hint_delete_channels Remove all channels menu.hint_delete_removed Delete the channels in the 'Removed channels' boquet diff --git a/data/locale/nederlands.locale b/data/locale/nederlands.locale index b4c78e9e0..1ec45b998 100644 --- a/data/locale/nederlands.locale +++ b/data/locale/nederlands.locale @@ -289,7 +289,6 @@ colormenu.advanced_mode_off Toon standaard opties colormenu.advanced_mode_on Toon geavanceerde zoekopties colormenu.background Achtergrond colormenu.clock_textcolor Digit kleur -colormenu.contrast_fonts Contrast lettertype colormenu.fade Menu's vervagen colormenu.font Selecteer lettertype gebruikersinterface colormenu.font_ttx Selecteer lettertype teletekst @@ -953,7 +952,6 @@ menu.hint_colored_events_textcolor Wijzig programma kleur voor gekleurde program menu.hint_colors Configureer GUI-kleuren menu.hint_content_back Wijzig venster achtergrond kleur menu.hint_content_textcolor Wijzig venster tekst kleur -menu.hint_contrast_fonts Lettertype contrast (Niet overgaan in achtergrond) menu.hint_dboxinfo Informatie over STB CPU en opslag menu.hint_delete_channels Verplaats alle kanalen menu.hint_delete_removed Verwijder de zenders in de 'Verwijderde zenders' bouquet diff --git a/data/locale/slovak.locale b/data/locale/slovak.locale index c292260db..3ae068e32 100644 --- a/data/locale/slovak.locale +++ b/data/locale/slovak.locale @@ -319,7 +319,6 @@ colormenu.advanced_mode_off Predvolené hodnoty colormenu.advanced_mode_on Rozšírené voľby colormenu.background Pozadie colormenu.clock_textcolor Farba číslic -colormenu.contrast_fonts Kontrast písma colormenu.fade Miznúce menu colormenu.font Výber písma colormenu.font_ttx Výber teletextového písma @@ -1030,7 +1029,6 @@ menu.hint_colored_events_textcolor Zmena farby pre farebné udalosti v zozname k menu.hint_colors Konfigurácia farieb GUI menu.hint_content_back Zmena farby podkladu GUI okna menu.hint_content_textcolor Zmena farby textu GUI okna -menu.hint_contrast_fonts Zvýraznenie kontrastu pisma (neúčinné pri podklade) menu.hint_dboxinfo Informácia o procesore a úložisku menu.hint_delete_channels Odstránenie všetkých kanálov menu.hint_delete_removed Vymazanie kanálov v bukete "Odstránené kanaly" diff --git a/data/locale/unmaintained/czech.locale b/data/locale/unmaintained/czech.locale index e2858c8cf..c4d0063c4 100644 --- a/data/locale/unmaintained/czech.locale +++ b/data/locale/unmaintained/czech.locale @@ -281,7 +281,6 @@ colorchooser.green Zelený colorchooser.red Červený colormenu.background Pozadí colormenu.clock_textcolor Barva číslic -colormenu.contrast_fonts Kontrast písma colormenu.fade Mizící menu colormenu.font Výběr písma colormenu.font_ttx Výběr teletextového písma @@ -946,7 +945,6 @@ menu.hint_color_gradient Přepne barevné přechody pro různé položky nabídk menu.hint_colors Konfigurace barev GUI menu.hint_content_back Změna barvy podkladu GUI okna menu.hint_content_textcolor Změna barvy textu GUI okna -menu.hint_contrast_fonts Zvýraznění kontrastu pisma (neúčinné u podkladu) menu.hint_dboxinfo Informace o procesoru a úložišti menu.hint_delete_channels Odstranění všech kanálů menu.hint_delete_removed Vymazání kanálů v buketu "Odstraněné kanály" diff --git a/data/locale/unmaintained/polski.locale b/data/locale/unmaintained/polski.locale index 305a5b2e1..75b427936 100644 --- a/data/locale/unmaintained/polski.locale +++ b/data/locale/unmaintained/polski.locale @@ -281,7 +281,6 @@ colorchooser.green Zielony colorchooser.red Czerwony colormenu.background Kolor tła colormenu.clock_textcolor Kolor zegara -colormenu.contrast_fonts Kontrast fontów colormenu.fade Zanikanie menu colormenu.font Font OSD colormenu.font_ttx Font teletekstu @@ -946,7 +945,6 @@ menu.hint_color_gradient Switches color gradients for various menu items on/off menu.hint_colors Configure GUI colors menu.hint_content_back Change GUI window background color menu.hint_content_textcolor Change GUI window text color -menu.hint_contrast_fonts Make fonts contrast (do not blend with background) menu.hint_dboxinfo Information about box cpu and storage menu.hint_delete_channels Remove all channels menu.hint_delete_removed Delete the channels in the 'Removed channels' boquet diff --git a/src/driver/fontrenderer.cpp b/src/driver/fontrenderer.cpp index 78286ed52..460f9640f 100644 --- a/src/driver/fontrenderer.cpp +++ b/src/driver/fontrenderer.cpp @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2003 thegoodguy + Copyright (C) 2013-2017 M. Liebmann (micha-bbg) License: GPL @@ -240,6 +241,9 @@ Font::Font(FBFontRenderClass *render, FTC_FaceID faceid, const int isize, const scaler.y_res = render->yres; setSize(isize); + fg_red = 0, fg_green = 0, fg_blue = 0; + memset((void*)colors, '\0', sizeof(colors)); + useFullBG = false; } FT_Error Font::getGlyphBitmap(FT_ULong glyph_index, FTC_SBit *sbit) @@ -383,43 +387,56 @@ int UTF8ToUnicode(const char * &text, const bool utf8_encoded) // returns -1 on return unicode_value; } -#define F_MUL 0x7FFF - -void Font::paintFontPixel(fb_pixel_t *td, uint8_t fg_red, uint8_t fg_green, uint8_t fg_blue, int faktor, uint8_t index) +void Font::paintFontPixel(fb_pixel_t *td, uint8_t src) { - fb_pixel_t bg_col = *td; - if (bg_col == (fb_pixel_t)0) - bg_col = 0xE0808080; - uint8_t bg_trans = (bg_col & 0xFF000000) >> 24; - int korr_r = ((bg_col & 0x00FF0000) >> 16) - fg_red; - int korr_g = ((bg_col & 0x0000FF00) >> 8) - fg_green; - int korr_b = (bg_col & 0x000000FF) - fg_blue; - - *td = ((g_settings.contrast_fonts && (index > 128)) ? 0xFF000000 : (((bg_trans == 0) ? 0xFF : bg_trans) << 24) & 0xFF000000) | - (((fg_red + ((korr_r*faktor)/F_MUL)) << 16) & 0x00FF0000) | - (((fg_green + ((korr_g*faktor)/F_MUL)) << 8) & 0x0000FF00) | - ((fg_blue + ((korr_b*faktor)/F_MUL)) & 0x000000FF); +#define DST_BLUE 0x80 +#define DST_GREEN 0x80 +#define DST_RED 0x80 +#define DST_TRANS 0x80 + if (useFullBG) { + uint8_t *dst = (uint8_t *)td; + if (*td == (fb_pixel_t)0) { + *dst = DST_BLUE + ((fg_blue - DST_BLUE) * src) / 256; + dst++; + *dst = DST_GREEN + ((fg_green - DST_GREEN) * src) / 256; + dst++; + *dst = DST_RED + ((fg_red - DST_RED) * src) / 256; + dst++; + *dst = (uint8_t)int_min(255, DST_TRANS + src); + } + else { + *dst = *dst + ((fg_blue - *dst) * src) / 256; + dst++; + *dst = *dst + ((fg_green - *dst) * src) / 256; + dst++; + *dst = *dst + ((fg_red - *dst) * src) / 256; + dst++; + *dst = (uint8_t)int_min(0xFF, *dst + src); + } + } + else + *td = colors[src]; } void Font::RenderString(int x, int y, const int width, const char *text, const fb_pixel_t color, const int boxheight, const unsigned int flags) { - const bool utf8_encoded = flags & IS_UTF8; - const bool useFullBg = flags & FULLBG; -/* - useFullBg (default = false) - - useFullBg = false - fetch bgcolor from framebuffer, using lower left edge of the font - - useFullBg = true - fetch bgcolor from framebuffer, using the respective real font position - - font rendering slower - - e.g. required for font rendering on images -*/ - if (!frameBuffer->getActive()) return; + const bool utf8_encoded = flags & IS_UTF8; + useFullBG = flags & FULLBG; +/* + useFullBg = false + fetch bgcolor from framebuffer, using lower left edge of the font + - default render mode + - font rendering faster + + useFullBg = true + fetch bgcolor from framebuffer, using the respective real fontpixel position + - better quality at font rendering on images or background with color gradient + - font rendering slower +*/ + frameBuffer->checkFbArea(x, y-height, width, height, true); pthread_mutex_lock( &renderer->render_mutex ); @@ -477,56 +494,34 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f int lastindex=0; // 0 == missing glyph (never has kerning values) FT_Vector kerning; - int pen1=-1; // "pen" positions for kerning, pen2 is "x" - static fb_pixel_t old_bgcolor = 0, old_fgcolor = 0; - static uint8_t bg_trans = 0, fg_red = 0, fg_green = 0, fg_blue = 0; - static bool olduseFullBg = false; - static fb_pixel_t colors[256] = {0}; - static int faktor[256] = {0}; - static bool fontRecsInit = false; - fb_pixel_t bg_color = 1; - fb_pixel_t fg_color = color; + int pen1 = -1; // "pen" positions for kerning, pen2 is "x" - if (!useFullBg) { - /* the GXA seems to do it's job asynchonously, so we need to wait until - it's ready, otherwise the font will sometimes "be overwritten" with - background color or bgcolor will be wrong */ - frameBuffer->waitForIdle("Font::RenderString 1"); + fg_red = (color & 0x00FF0000) >> 16; + fg_green = (color & 0x0000FF00) >> 8; + fg_blue = color & 0x000000FF; + fb_pixel_t bg_color = 0; + + /* the GXA seems to do it's job asynchonously, so we need to wait until + it's ready, otherwise the font will sometimes "be overwritten" with + background color or bgcolor will be wrong */ + frameBuffer->waitForIdle("Font::RenderString 1"); + if (!useFullBG) { /* fetch bgcolor from framebuffer, using lower left edge of the font... */ bg_color = *(frameBuffer->getFrameBufferPointer() + x + y * frameBuffer->getStride() / sizeof(fb_pixel_t)); - } - else - bg_color = 0; - if ((old_fgcolor != fg_color) || (old_bgcolor != bg_color) || (olduseFullBg != useFullBg) || !fontRecsInit) { - old_bgcolor = bg_color; - old_fgcolor = fg_color; - olduseFullBg = useFullBg; - fontRecsInit = true; + if (bg_color == (fb_pixel_t)0) + bg_color = 0x80808080; - bg_trans = (bg_color & 0xFF000000) >> 24; - fg_red = (fg_color & 0x00FF0000) >> 16; - fg_green = (fg_color & 0x0000FF00) >> 8; - fg_blue = fg_color & 0x000000FF; - - int korr_r=0, korr_g=0, korr_b=0; - if (!useFullBg) { - korr_r = ((bg_color & 0x00FF0000) >> 16) - fg_red; - korr_g = ((bg_color & 0x0000FF00) >> 8) - fg_green; - korr_b = (bg_color & 0x000000FF) - fg_blue; - } - - for (int i = 0; i <= 0xFF; i++) { - int _faktor = ((0xFF - i) * F_MUL) / 0xFF; - - if (useFullBg) - faktor[i] = _faktor; - else - colors[i] = ((g_settings.contrast_fonts && (i > 128)) ? 0xFF000000 : (((bg_trans == 0) ? 0xFF : bg_trans) << 24) & 0xFF000000) | - (((fg_red + ((korr_r*_faktor)/F_MUL)) << 16) & 0x00FF0000) | - (((fg_green + ((korr_g*_faktor)/F_MUL)) << 8) & 0x0000FF00) | - ((fg_blue + ((korr_b*_faktor)/F_MUL)) & 0x000000FF); + uint8_t bg_trans = (bg_color & 0xFF000000) >> 24; + uint8_t bg_red = (bg_color & 0x00FF0000) >> 16; + uint8_t bg_green = (bg_color & 0x0000FF00) >> 8; + uint8_t bg_blue = bg_color & 0x000000FF; + for (int i = 0; i < 256; i++) { + colors[i] = (((int_min(0xFF, bg_trans + i)) << 24) & 0xFF000000) | + (((bg_red +((fg_red -bg_red) * i)/256) << 16) & 0x00FF0000) | + (((bg_green+((fg_green-bg_green)* i)/256) << 8) & 0x0000FF00) | + ((bg_blue +((fg_blue -bg_blue) * i)/256) & 0x000000FF); } } @@ -596,12 +591,8 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f for (ax = 0; ax < w + spread_by; ax++) { if (stylemodifier != Font::Embolden) { /* do not paint the backgroundcolor (*s = 0) */ - if(*s != 0) { - if (useFullBg) - paintFontPixel(td, fg_red, fg_green, fg_blue, faktor[*s], *s); - else - *td = colors[*s]; - } + if (*s != 0) + paintFontPixel(td, *s); } else { int lcolor = -1; @@ -611,12 +602,8 @@ void Font::RenderString(int x, int y, const int width, const char *text, const f if (lcolor < *(s - i)) lcolor = *(s - i); /* do not paint the backgroundcolor (lcolor = 0) */ - if(lcolor != 0) { - if (useFullBg) - paintFontPixel(td, fg_red, fg_green, fg_blue, faktor[lcolor], (uint8_t)lcolor); - else - *td = colors[lcolor]; - } + if (lcolor != 0) + paintFontPixel(td, (uint8_t)lcolor); } td++; s++; } diff --git a/src/driver/fontrenderer.h b/src/driver/fontrenderer.h index c061a7934..416ca6da1 100644 --- a/src/driver/fontrenderer.h +++ b/src/driver/fontrenderer.h @@ -3,6 +3,7 @@ Copyright (C) 2001 Steffen Hehn 'McClean' Copyright (C) 2003 thegoodguy + Copyright (C) 2013-2017 M. Liebmann (micha-bbg) License: GPL @@ -54,8 +55,12 @@ class Font int height,DigitHeight,DigitOffset,ascender,descender,upper,lower; int fontwidth; int maxdigitwidth; + uint8_t fg_red, fg_green, fg_blue; + fb_pixel_t colors[256]; + bool useFullBG; - inline void paintFontPixel(fb_pixel_t *td, uint8_t fg_red, uint8_t fg_green, uint8_t fg_blue, int faktor, uint8_t index); + inline int int_min(int a, int b) { return (a < b) ? a : b; } + inline void paintFontPixel(fb_pixel_t *td, uint8_t src); public: enum fontmodifier diff --git a/src/driver/record.cpp b/src/driver/record.cpp index 7a029bcbe..24fbdc672 100644 --- a/src/driver/record.cpp +++ b/src/driver/record.cpp @@ -1327,7 +1327,7 @@ int CRecordManager::handleMsg(const neutrino_msg_t msg, neutrino_msg_data_t data DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_OVERFLOW)); } else if (g_settings.recording_slow_warning && warn_display) { warn_display = false; - DisplayErrorMessage(g_Locale->getText(LOCALE_STREAMING_SLOW)); + ShowHint(LOCALE_MESSAGEBOX_INFO, LOCALE_STREAMING_SLOW, 700, 60, NEUTRINO_ICON_ERROR, NULL, CComponentsHeader::CC_BTN_EXIT); } } return messages_return::handled; diff --git a/src/driver/volume.cpp b/src/driver/volume.cpp index c7c6c4a77..80ed35c7d 100644 --- a/src/driver/volume.cpp +++ b/src/driver/volume.cpp @@ -182,7 +182,7 @@ void CVolume::setVolume(const neutrino_msg_t key) if (volscale) { if(vol != g_settings.current_volume) { vol = g_settings.current_volume; - volscale->repaintVolScale(); + volscale->paint(); } } diff --git a/src/gui/buildinfo.cpp b/src/gui/buildinfo.cpp index 448bd0077..2d31e834e 100644 --- a/src/gui/buildinfo.cpp +++ b/src/gui/buildinfo.cpp @@ -37,9 +37,13 @@ using namespace std; -CBuildInfo::CBuildInfo() : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) +CBuildInfo::CBuildInfo(bool show) : CComponentsWindow(0, 0, 700, 500, LOCALE_BUILDINFO_MENU, NEUTRINO_ICON_INFO) { initVarBuildInfo(); + if (show) + exec(NULL, ""); + else + InitInfoItems(); } //init all var members @@ -49,7 +53,6 @@ void CBuildInfo::initVarBuildInfo() font = g_Font[SNeutrinoSettings::FONT_TYPE_MENU_HINT]; setWindowHeaderButtons(CComponentsHeader::CC_BTN_MENU | CComponentsHeader::CC_BTN_EXIT); - InitInfoItems(); shadow = true; @@ -62,7 +65,9 @@ int CBuildInfo::exec(CMenuTarget* parent, const string & /*actionKey*/) if (parent) parent->hide(); - + + InitInfoItems(); + //exit if no informations available if (!HasData()){ return res; diff --git a/src/gui/buildinfo.h b/src/gui/buildinfo.h index 3ef9377dc..154cba8bb 100644 --- a/src/gui/buildinfo.h +++ b/src/gui/buildinfo.h @@ -69,7 +69,7 @@ class CBuildInfo : public CMenuTarget, public CComponentsWindow BI_TYPE_IDS }; - CBuildInfo(); + CBuildInfo(bool show = false); ///assigns text Font type void setFontType(Font* font_text); diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index aba800687..048db8f00 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2172,7 +2172,9 @@ void CChannelList::paintHead() else logo_off = 10; - header->paint(CC_SAVE_SCREEN_NO); //TODO: paint title only, currently paint() does paint all enabled header items at once and causes flicker effects in unchanged items (e.g. clock) + if (header->isPainted()) //clean up background of header for new contents + header->kill(header->getColorBody(), -1, CC_FBDATA_TYPES, false); + header->paint0(); } CComponentsHeader* CChannelList::getHeaderObject() diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index 54acff507..b9035e8db 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -57,6 +57,7 @@ CCDraw::CCDraw() : COSDFader(g_settings.theme.menu_Content_alpha) cc_save_bg = false; firstPaint = true; is_painted = false; + force_paint_bg = false; paint_bg = true; cc_allow_paint = true; cc_enable_frame = true; @@ -546,7 +547,7 @@ void CCDraw::paintFbItems(bool do_save_bg) v_fbdata[i].is_painted = true; } } - if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force)) { + if (fbtype == CC_FBDATA_TYPE_SHADOW_BOX && ((!is_painted || !fbdata.is_painted)|| shadow_force || force_paint_bg)) { if (fbdata.enabled) { /* here we paint the shadow around the body * on 1st step we check for already cached screen buffer, if true @@ -629,15 +630,37 @@ void CCDraw::paintFbItems(bool do_save_bg) fbdata.pixbuf = getScreen(fbdata.x, fbdata.y, fbdata.dx, fbdata.dy); } } - is_painted = v_fbdata[i].is_painted = true; + v_fbdata[i].is_painted = true; + OnAfterPaintBg(); } } } } + + //set is_painted attribut. if any layer was painted set it to true; + if (force_paint_bg){ + is_painted = false; + }else{ + for(size_t i=0; i< v_fbdata.size(); i++){ + if (v_fbdata[i].is_painted){ + is_painted = true; + break; + } + } + } + + //reset is painted ignore flag to default value + force_paint_bg = false; + //pick up signal if filled OnAfterPaintLayers(); } +bool CCDraw::isPainted() +{ + return is_painted; +} + void CCDraw::hide() { OnBeforeHide(); @@ -652,8 +675,8 @@ void CCDraw::hide() } } } - is_painted = false; firstPaint = true; + is_painted = false; OnAfterHide(); } @@ -732,10 +755,10 @@ void CCDraw::enableShadow(int mode, const int& shadow_width, bool force_paint) void CCDraw::paintTrigger() { - if (!is_painted) - paint1(); - else + if (is_painted) hide(); + else + paint(); } bool CCDraw::paintBlink(CComponentsTimer* Timer) diff --git a/src/gui/components/cc_draw.h b/src/gui/components/cc_draw.h index dd99986fa..a7d442e86 100644 --- a/src/gui/components/cc_draw.h +++ b/src/gui/components/cc_draw.h @@ -115,6 +115,8 @@ class CCDraw : public COSDFader, public CComponentsSignals bool firstPaint; ///status: true=component was rendered bool is_painted; + ///status: true= value is_painted would be ignored + bool force_paint_bg; ///mode: true=activate rendering of basic elements (frame, shadow and body) bool paint_bg; ///mode: true=activate rendering of frame @@ -268,7 +270,7 @@ class CCDraw : public COSDFader, public CComponentsSignals virtual void disablePaintCache(){enablePaintCache(false);} ///returns paint mode, true=item was painted - virtual bool isPainted(){return is_painted;} + virtual bool isPainted(); ///allows paint of elementary item parts (shadow, frame and body), similar as background, set it usually to false, if item used in a form, returns true, if mode has changed, also cleans screnn buffer virtual bool doPaintBg(bool do_paint); ///allows paint frame around body, default true , NOTE: ignored if frame width = 0 @@ -353,10 +355,12 @@ class CCDraw : public COSDFader, public CComponentsSignals */ bool cancelBlink(bool keep_on_screen = false); - ///signal on before paint fb layers, called inside paintFbItems() + ///signal on before paint fb layers, called before paint fb layers inside paintFbItems() sigc::signal OnBeforePaintLayers; - ///signal on after paint fb layers, called inside paintFbItems() + ///signal on after paint fb layers, called after paint fb layers inside paintFbItems() sigc::signal OnAfterPaintLayers; + ///signal on after paint background, called after paint of background box inside paintFbItems() + sigc::signal OnAfterPaintBg; /*! Removes current item from screen and diff --git a/src/gui/components/cc_frm.cpp b/src/gui/components/cc_frm.cpp index 102daa505..9d3544573 100644 --- a/src/gui/components/cc_frm.cpp +++ b/src/gui/components/cc_frm.cpp @@ -335,7 +335,8 @@ void CComponentsForm::exchangeCCItem(CComponentsItem* item_a, CComponentsItem* i void CComponentsForm::paintForm(bool do_save_bg) { //paint body - paintInit(do_save_bg); + if (!is_painted || force_paint_bg) + paintInit(do_save_bg); //paint paintCCItems(); @@ -519,23 +520,7 @@ void CComponentsForm::paintCCItems() cc_item->allowPaint(item_visible); } } -#if 0 -void CComponentsForm::hide() -{ - // hack: ensure hiding of minitv during hide of forms and inherited classes, - // because the handling of minitv items are different to other item types - // and need an explizit call of hide() - for(size_t i=0; igetItemType() == CC_ITEMTYPE_PIP){ - v_cc_items[i]->kill(); - break; - } - } - //hide body - CComponents::hide(); -} -#endif //erase or paint over rendered objects void CComponentsForm::killCCItems(const fb_pixel_t& bg_color, bool ignore_parent) { @@ -692,3 +677,20 @@ bool CComponentsForm::enableColBodyGradient(const int& enable_mode, const fb_pix } return false; } + +void CComponentsForm::forceItemsPaint(bool force) +{ + for (size_t i = 0; i < v_cc_items.size(); i++){ + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsForm] [%s - %d] found item type = [%d] \033[0m\n", __func__, __LINE__, v_cc_items[i]->getItemType()); + if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_TEXT){ + CComponentsText* text = static_cast (v_cc_items[i]); + text->forceTextPaint(force); + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsForm] [%s - %d] force repaint of item type CC_ITEMTYPE_TEXT [%u] content [%s]\033[0m\n", __func__, __LINE__, i, text->getText().c_str()); + } + if (v_cc_items[i]->getItemType() == CC_ITEMTYPE_LABEL){ + CComponentsLabel* label = static_cast (v_cc_items[i]); + label ->forceTextPaint(force); + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsForm] [%s - %d] force repaint of item type CC_ITEMTYPE_LABEL [%u] content [%s]\033[0m\n", __func__, __LINE__, i, label->getText().c_str()); + } + } +} diff --git a/src/gui/components/cc_frm.h b/src/gui/components/cc_frm.h index 44f6b481e..56ad077c6 100644 --- a/src/gui/components/cc_frm.h +++ b/src/gui/components/cc_frm.h @@ -65,6 +65,11 @@ class CComponentsForm : public CComponentsItem const fb_pixel_t& color_body, const fb_pixel_t& color_shadow); + ///force repaint of all possible text items + void forceItemsPaint(bool force); + ///slot for background paint event, reserved for forceItemsPaint() + sigc::slot0 sl_repaint; + public: CComponentsForm( const int x_pos = 0, const int y_pos = 0, const int w = 800, const int h = 600, CComponentsForm *parent = NULL, diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index d1a9cbc7a..c3995318d 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -30,7 +30,7 @@ #include "cc_frm_clock.h" #include - +#include #include #include #include @@ -98,7 +98,10 @@ CComponentsFrmClock::CComponentsFrmClock( const int& x_pos, initParent(parent); //init slot for running clock - cl_sl = sigc::mem_fun0(*this, &CComponentsFrmClock::ShowTime); + cl_sl_show = sigc::mem_fun0(*this, &CComponentsFrmClock::ShowTime); + + //init slot to ensure paint segments after painted background + sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsFrmClock::forceItemsPaint), true); //run clock already if required if (activ) @@ -297,6 +300,11 @@ void CComponentsFrmClock::initCCLockItems() x_lbl += v_cc_items[i-1]->getWidth(); v_cc_items[i]->setPos(x_lbl, y_lbl); } + + if(!OnAfterPaintBg.empty()) + OnAfterPaintBg.clear(); + //init slot to handle repaint of segments if background was repainted + OnAfterPaintBg.connect(sl_repaint); } @@ -321,7 +329,8 @@ bool CComponentsFrmClock::startClock() cl_timer = new CComponentsTimer(0); if (cl_timer->OnTimer.empty()){ dprintf(DEBUG_INFO,"\033[33m[CComponentsFrmClock]\t[%s] init slot...\033[0m\n", __func__); - cl_timer->OnTimer.connect(cl_sl); + cl_timer->OnTimer.connect(cl_sl_show); + force_paint_bg = true; } } cl_timer->setTimerInterval(cl_interval); @@ -338,6 +347,7 @@ bool CComponentsFrmClock::stopClock() if (cl_timer){ if (cl_timer->stopTimer()){ dprintf(DEBUG_INFO, "[CComponentsFrmClock] [%s] stopping clock...\n", __func__); + clear(); delete cl_timer; cl_timer = NULL; return true; @@ -372,12 +382,12 @@ void CComponentsFrmClock::paint(bool do_save_bg) //prepare items before paint initCCLockItems(); + if (!is_painted) + force_paint_bg = false; + //paint form contents CComponentsForm::paint(do_save_bg); -#if 0 //has no effect - if (may_blit) - frameBuffer->blit(); -#endif + } void CComponentsFrmClock::setClockFont(Font *font, const int& style) diff --git a/src/gui/components/cc_frm_clock.h b/src/gui/components/cc_frm_clock.h index ddc5abbbb..22da0af26 100644 --- a/src/gui/components/cc_frm_clock.h +++ b/src/gui/components/cc_frm_clock.h @@ -52,7 +52,7 @@ class CComponentsFrmClock : public CComponentsForm, public CCTextScreen protected: ///slot for timer event, reserved for ShowTime() - sigc::slot0 cl_sl; + sigc::slot0 cl_sl_show; ///refresh interval in seconds int cl_interval; diff --git a/src/gui/components/cc_frm_ext_text.cpp b/src/gui/components/cc_frm_ext_text.cpp index 645410ead..3abf816f4 100644 --- a/src/gui/components/cc_frm_ext_text.cpp +++ b/src/gui/components/cc_frm_ext_text.cpp @@ -29,6 +29,8 @@ #include #include "cc_frm_ext_text.h" +#include + #define DEF_HEIGHT 27 #define DEF_LABEL_WIDTH_PERCENT 30 @@ -112,56 +114,60 @@ void CComponentsExtTextForm::initVarExtTextForm(const int& x_pos, const int& y_p } ccx_label_align = ccx_text_align = CTextBox::NO_AUTO_LINEBREAK; + //init slot to ensure paint text items after painted background + sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsExtTextForm::forceItemsPaint), true); + initParent(parent); } void CComponentsExtTextForm::initLabel() { - //initialize label object if (ccx_label_obj == NULL){ - ccx_label_obj = new CComponentsLabel(); - ccx_label_obj->doPaintBg(!cc_txt_save_screen); - ccx_label_obj->doPaintTextBoxBg(false); - ccx_label_obj->enableTboxSaveScreen(cc_txt_save_screen); - } + //create ccx_label_obj and add to collection + ccx_label_obj = new CComponentsLabel(this); + ccx_label_obj->doPaintBg(false); + } - //add label object - if (!ccx_label_obj->isAdded()) - addCCItem(ccx_label_obj); - - //set properties + //set label properties if (ccx_label_obj){ - ccx_label_width = (ccx_percent_label_w * width/100); + //assign general properties y_text = height/2 - height-2*fr_thickness; - ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); - ccx_label_obj->setTextColor(ccx_label_color); ccx_label_obj->setDimensionsAll(0, y_text, ccx_label_width-2*fr_thickness, height-2*fr_thickness); - ccx_label_obj->setCorner(this->corner_rad, CORNER_LEFT); + ccx_label_obj->setColorBody(col_body); + if (cc_body_gradient_enable != cc_body_gradient_enable_old) + ccx_label_obj->getCTextBoxObject()->clearScreenBuffer(); + ccx_label_obj->setTextColor(ccx_label_color); + ccx_label_obj->setText(ccx_label_text, ccx_label_align, ccx_font); + ccx_label_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen); + + //corner of label item + ccx_label_obj->setCorner(corner_rad-fr_thickness, CORNER_LEFT); } } void CComponentsExtTextForm::initText() { - //initialize text object + //set text properties if (ccx_text_obj == NULL){ - ccx_text_obj = new CComponentsText(); - ccx_text_obj->doPaintBg(!cc_txt_save_screen); - ccx_text_obj->doPaintTextBoxBg(false); - ccx_text_obj->enableTboxSaveScreen(cc_txt_save_screen); + //create ccx_text_obj and add to collection + ccx_text_obj = new CComponentsText(this); + ccx_text_obj->doPaintBg(false); } - //add text object - if (!ccx_text_obj->isAdded()) - addCCItem(ccx_text_obj); - - //set properties if (ccx_text_obj){ - ccx_text_width = width-ccx_label_obj->getWidth(); - ccx_text_obj->setText(ccx_text, ccx_text_align, ccx_font); - ccx_text_obj->setTextColor(ccx_text_color); + //assign general properties + y_text = height/2 - height-2*fr_thickness; ccx_text_obj->setDimensionsAll(ccx_label_obj->getWidth(), y_text, ccx_text_width-2*fr_thickness, height-2*fr_thickness); - ccx_text_obj->setCorner(this->corner_rad, CORNER_RIGHT); + ccx_text_obj->setColorBody(col_body); + if (cc_body_gradient_enable != cc_body_gradient_enable_old) + ccx_text_obj->getCTextBoxObject()->clearScreenBuffer(); + ccx_text_obj->setTextColor(ccx_text_color); + ccx_text_obj->setText(ccx_text, ccx_text_align, ccx_font);; + ccx_text_obj->enableTboxSaveScreen(cc_body_gradient_enable || cc_txt_save_screen); + + //corner of text item + ccx_text_obj->setCorner(corner_rad-fr_thickness, CORNER_RIGHT); } } @@ -216,6 +222,11 @@ void CComponentsExtTextForm::initCCTextItems() { initLabel(); initText(); + + if(!OnAfterPaintBg.empty()) + OnAfterPaintBg.clear(); + //init slot to handle repaint of text if background was repainted + OnAfterPaintBg.connect(sl_repaint); } void CComponentsExtTextForm::setLabelWidthPercent(const uint8_t& percent_val) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 032763d16..dcc22dfc2 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -30,6 +30,9 @@ #include #include "cc_frm_header.h" #include + +#include + using namespace std; //------------------------------------------------------------------------------------------------------- @@ -133,6 +136,9 @@ void CComponentsHeader::initVarHeader( const int& x_pos, const int& y_pos, const cch_cl_sec_format = cch_cl_format; cch_cl_enable_run = false; + //init slot to ensure paint segments after painted background + sl_repaint = sigc::bind<0>(sigc::mem_fun1(*this, &CComponentsHeader::forceItemsPaint), true); + addContextButton(buttons); initCCItems(); initParent(parent); @@ -146,6 +152,8 @@ CComponentsHeader::~CComponentsHeader() void CComponentsHeader::setCaption(const std::string& caption, const int& align_mode, const fb_pixel_t& text_color) { + if (cch_cl_obj) + cch_cl_obj->Stop(); cch_text = caption; cch_caption_align = align_mode; cch_col_text = text_color; @@ -153,8 +161,6 @@ void CComponentsHeader::setCaption(const std::string& caption, const int& align_ void CComponentsHeader::setCaption(neutrino_locale_t caption_locale, const int& align_mode, const fb_pixel_t& text_color) { - if (cch_cl_obj) - cch_cl_obj->Stop(); setCaption(string(g_Locale->getText(caption_locale)), align_mode, text_color); } @@ -362,10 +368,12 @@ void CComponentsHeader::enableClock(bool enable, const char* format, const char* { cch_cl_enable = enable; cch_cl_format = format; + if (cch_cl_obj && cch_cl_enable) + cch_cl_obj->clear(); if (sec_format_str) cch_cl_sec_format = sec_format_str; cch_cl_enable_run = run; - if (!enable){ + if (!cch_cl_enable){ if (cch_cl_obj){ cch_cl_enable_run = false; removeCCItem(cch_cl_obj); @@ -515,6 +523,11 @@ void CComponentsHeader::initCaption() */ //height = max(height, cch_text_obj->getHeight()); } + + if(!OnAfterPaintBg.empty()) + OnAfterPaintBg.clear(); + //init slot to handle repaint of text if background was repainted + OnAfterPaintBg.connect(sl_repaint); } void CComponentsHeader::initCCItems() @@ -537,14 +550,14 @@ void CComponentsHeader::initCCItems() //init text initCaption(); } - + void CComponentsHeader::paint(bool do_save_bg) { //prepare items initCCItems(); - + //paint form contents - paintForm(do_save_bg); + CComponentsForm::paint(do_save_bg); //start clock if enabled if (cch_cl_obj){ @@ -564,3 +577,14 @@ bool CComponentsHeader::enableColBodyGradient(const int& enable_mode, const fb_p return CComponentsForm::enableColBodyGradient(enable_mode, sec_color, dir); } +void CComponentsHeader::kill(const fb_pixel_t& bg_color, const int& corner_radius, const int& fblayer_type /*fbdata_type*/, bool disable_clock) +{ + if (disable_clock) + disableClock(); + + int rad = corner_radius; + if (corner_radius == -1) + rad = corner_rad; + + CComponentsForm::kill(bg_color, rad, fblayer_type); +} diff --git a/src/gui/components/cc_frm_header.h b/src/gui/components/cc_frm_header.h index df444ee7a..7f75f2fd7 100644 --- a/src/gui/components/cc_frm_header.h +++ b/src/gui/components/cc_frm_header.h @@ -269,7 +269,7 @@ class CComponentsHeader : public CComponentsForm, public CCTextScreen ///hides item, arg: no_restore see hideCCItem() void hide(){disableClock(); CComponents::hide();} ///erase current screen without restore of background, it's similar to paintBackgroundBoxRel() from CFrameBuffer - virtual void kill(){disableClock(); CComponentsForm::kill();} + void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES, bool disable_clock = true); ///set color gradient on/off, returns true if gradient mode was changed virtual bool enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color = 255 /*=COL_BACKGROUND*/, const int& direction = -1); diff --git a/src/gui/components/cc_item_text.cpp b/src/gui/components/cc_item_text.cpp index f56733584..67ee50401 100644 --- a/src/gui/components/cc_item_text.cpp +++ b/src/gui/components/cc_item_text.cpp @@ -78,7 +78,7 @@ void CComponentsText::initVarText( const int x_pos, const int y_pos, const int w int shadow_mode, fb_pixel_t color_text, fb_pixel_t color_frame, fb_pixel_t color_body, fb_pixel_t color_shadow) { - cc_item_type = CC_ITEMBOX_TEXT; + cc_item_type = CC_ITEMTYPE_TEXT; ct_font = font_text; ct_textbox = NULL; ct_text = text; @@ -180,7 +180,7 @@ void CComponentsText::initCCText() //send text to CTextBox object, but force text paint text if force_text_paint option is enabled //this is managed by CTextBox object itself ct_text_sent = ct_textbox->setText(&ct_text, ct_box.iWidth, force_text_paint); - + //set current text status, needed by textChanged() if (ct_text_sent){ ct_old_text = ct_text; @@ -273,16 +273,19 @@ bool CComponentsText::setTextFromFile(const string& path_to_textfile, const int void CComponentsText::paintText(bool do_save_bg) { - paintInit(do_save_bg); initCCText(); + if (!is_painted) + paintInit(do_save_bg); if (ct_text_sent && cc_allow_paint) ct_textbox->paint(); + ct_text_sent = false; } void CComponentsText::paint(bool do_save_bg) { + OnBeforePaint(); paintText(do_save_bg); } @@ -290,8 +293,21 @@ void CComponentsText::hide() { if (ct_textbox) ct_textbox->hide(); - ct_old_text = ""; - CComponents::hide(); + + ct_old_text.clear(); + CCDraw::hide(); + ct_force_text_paint = true; +} + +void CComponentsText::kill(const fb_pixel_t& bg_color, const int& corner_radius, const int& fblayer_type) +{ + if (ct_textbox) + ct_textbox->hide(); + + ct_old_text.clear(); + force_paint_bg = true; + CCDraw::kill(bg_color, corner_radius, fblayer_type); + ct_force_text_paint = true; } void CComponentsText::setXPos(const int& xpos) diff --git a/src/gui/components/cc_item_text.h b/src/gui/components/cc_item_text.h index 7bd5f6372..1de07d08c 100644 --- a/src/gui/components/cc_item_text.h +++ b/src/gui/components/cc_item_text.h @@ -138,6 +138,8 @@ class CComponentsText : public CCTextScreen, public CComponentsItem ///default members to paint a text box and hide painted text ///hide textbox void hide(); + ///remove textbox from screen + void kill(const fb_pixel_t& bg_color = COL_BACKGROUND_PLUS_0, const int& corner_radius = -1, const int& fblayer_type = CC_FBDATA_TYPES); ///paint text box, parameter do_save_bg: default = true, causes fill of backckrond pixel buffer void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); @@ -277,6 +279,22 @@ class CComponentsLabel : public CComponentsText { cc_item_type = CC_ITEMTYPE_LABEL; }; + + CComponentsLabel( CComponentsForm *parent, + const int x_pos = 10, const int y_pos = 10, const int w = 150, const int h = 50, + std::string text = "", + const int mode = CTextBox::AUTO_WIDTH, + Font* font_text = NULL, + const int& font_style = CComponentsText::FONT_STYLE_REGULAR, + int shadow_mode = CC_SHADOW_OFF, + fb_pixel_t color_text = COL_MENUCONTENTINACTIVE_TEXT, + fb_pixel_t color_frame = COL_FRAME_PLUS_0, + fb_pixel_t color_body = COL_MENUCONTENT_PLUS_0, + fb_pixel_t color_shadow = COL_SHADOW_PLUS_0) + :CComponentsText(x_pos, y_pos, w, h, text, mode, font_text, font_style, parent, shadow_mode, color_text, color_frame, color_body, color_shadow) + { + cc_item_type = CC_ITEMTYPE_LABEL; + }; }; #endif diff --git a/src/gui/components/cc_types.h b/src/gui/components/cc_types.h index 5fc909f0e..12a42cf7c 100644 --- a/src/gui/components/cc_types.h +++ b/src/gui/components/cc_types.h @@ -147,14 +147,6 @@ enum CC_ALONG_Y = 2 }; -enum -{ - CC_ITEMBOX_ICON, - CC_ITEMBOX_PICTURE, - CC_ITEMBOX_TEXT, - CC_ITEMBOX_CLOCK -}; - typedef struct cc_element_data_t { int type; diff --git a/src/gui/eventlist.cpp b/src/gui/eventlist.cpp index 741ec77fd..76c771559 100644 --- a/src/gui/eventlist.cpp +++ b/src/gui/eventlist.cpp @@ -877,7 +877,9 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s } else { header->removeCCItem(midLogo); //remove/destroy logo object, if it is not available - CComponentsText *midText = new CComponentsText(CC_CENTERED, CC_CENTERED, mid_width, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + int w_midText = g_Font[font_mid]->getRenderWidth(_channelname); + CComponentsText *midText = new CComponentsText(0, CC_CENTERED, w_midText, theight, _channelname, CTextBox::CENTER, g_Font[font_mid], CComponentsText::FONT_STYLE_REGULAR, header, CC_SHADOW_OFF, COL_MENUHEAD_TEXT); + midText->setXPos(full_width/2 - midText->getWidth()/2); midText->doPaintBg(false); } @@ -892,6 +894,8 @@ void CEventList::paintHead(t_channel_id _channel_id, std::string _channelname, s rText->doPaintBg(false); } + if (header->isPainted()) //clean up background of header for new captions + header->kill(header->getColorBody()); header->paint(CC_SAVE_SCREEN_NO); } diff --git a/src/gui/imageinfo.cpp b/src/gui/imageinfo.cpp index 6f946a3ab..017205bc7 100644 --- a/src/gui/imageinfo.cpp +++ b/src/gui/imageinfo.cpp @@ -169,7 +169,8 @@ int CImageInfo::exec(CMenuTarget* parent, const std::string &) btn_red->setCaption(new_btn_cap); //paint items - cc_sub_caption->paint(false); + cc_sub_caption->hide(); + cc_sub_caption->paint(); cc_lic->paint(false); btn_red->kill(); btn_red->paint(false); diff --git a/src/gui/infoclock.cpp b/src/gui/infoclock.cpp index fa4f66c5b..23aa8e290 100644 --- a/src/gui/infoclock.cpp +++ b/src/gui/infoclock.cpp @@ -107,6 +107,7 @@ bool CInfoClock::StopInfoClock() { bool ret = Stop(); kill(); + clear(); return ret; } diff --git a/src/gui/infoviewer.cpp b/src/gui/infoviewer.cpp index faf2df699..658c2e763 100644 --- a/src/gui/infoviewer.cpp +++ b/src/gui/infoviewer.cpp @@ -253,6 +253,7 @@ void CInfoViewer::initClock() } CInfoClock::getInstance()->disableInfoClock(); + clock->clear(); clock->enableColBodyGradient(gradient_top, COL_INFOBAR_PLUS_0); clock->doPaintBg(!gradient_top); clock->enableTboxSaveScreen(gradient_top); @@ -599,11 +600,12 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (!zap_mode) infoViewerBB->paintshowButtonBar(); + int renderFlag = ((g_settings.theme.infobar_gradient_top) ? Font::FULLBG : 0) | Font::IS_UTF8; int ChannelLogoMode = 0; if (g_settings.infobar_show_channellogo > 1) ChannelLogoMode = showChannelLogo(current_channel_id, 0); if (ChannelLogoMode == 0 || ChannelLogoMode == 3 || ChannelLogoMode == 4) - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + header_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 ,ChannelName, COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString(ChanNameX + 10 , ChanNameY + header_height,BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 ,ChannelName, COL_INFOBAR_TEXT, 0, renderFlag); // show_Data if (CMoviePlayerGui::getInstance().file_prozent > 100) @@ -659,7 +661,7 @@ void CInfoViewer::showMovieTitle(const int playState, const t_channel_id &Channe if (speed) { int sh = g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->getHeight(); int sy = BoxStartY + ChanHeight/2 - sh/2 + sh; - g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(icon_x, sy, ChanHeight, runningRest, COL_INFOBAR_TEXT); + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString(icon_x, sy, ChanHeight, runningRest, COL_INFOBAR_TEXT, 0, renderFlag); icon_x += speedw; } frameBuffer->paintIcon(playicon, icon_x, icon_y); @@ -704,6 +706,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap { if(!calledFromNumZap && !(zap_mode & IV_MODE_DEFAULT)) resetSwitchMode(); + int renderFlag = ((g_settings.theme.infobar_gradient_top) ? Font::FULLBG : 0) | Font::IS_UTF8; std::string Channel = channel->getName(); t_satellite_position satellitePosition = channel->getSatellitePosition(); @@ -812,7 +815,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap } } int h_sfont = g_SignalFont->getHeight(); - g_SignalFont->RenderString (BoxStartX + numbox_offset + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + h_sfont, satNameWidth, satname_tmp, COL_INFOBAR_TEXT); + g_SignalFont->RenderString (BoxStartX + numbox_offset + ((ChanWidth - satNameWidth) / 2) , numbox->getYPos() + h_sfont, satNameWidth, satname_tmp, COL_INFOBAR_TEXT, 0, renderFlag); } /* TODO: the logic will get much easier once we decouple channellogo and signal bars */ @@ -831,14 +834,14 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap y_tmp, ChanWidth - 2*numbox_offset, strChanNum, - col_NumBoxText); + col_NumBoxText, 0, renderFlag); } if (ChannelLogoMode == 1 || ( g_settings.infobar_show_channellogo == 3 && !logo_ok) || g_settings.infobar_show_channellogo == 6 ) /* channel number besides channel name */ { ChanNumWidth = 5 + g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->getRenderWidth (strChanNum); g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 5, ChanNameY + header_height, - ChanNumWidth, strChanNum, col_NumBoxText); + ChanNumWidth, strChanNum, col_NumBoxText, 0, renderFlag); } } @@ -850,7 +853,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_CHANNAME]->RenderString( ChanNameX + 10 + ChanNumWidth, ChanNameY + header_height, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 - ChanNumWidth, - ChannelName, color /*COL_INFOBAR_TEXT*/); + ChannelName, color /*COL_INFOBAR_TEXT*/, 0, renderFlag); //provider name if(g_settings.infobar_show_channeldesc && channel->pname){ std::string prov_name = channel->pname; @@ -867,7 +870,7 @@ void CInfoViewer::showTitle(CZapitChannel * channel, const bool calledFromNumZap g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_INFO]->RenderString( ChanNameX + 10 + ChanNumWidth + chname_width, tmpY, BoxEndX - (ChanNameX + 20) - time_width - LEFT_OFFSET - 10 - ChanNumWidth - chname_width, - prov_name, color /*COL_INFOBAR_TEXT*/); + prov_name, color /*COL_INFOBAR_TEXT*/, 0, renderFlag); } } @@ -1631,6 +1634,7 @@ void CInfoViewer::showSNR () { if (! is_visible) return; + int renderFlag = ((g_settings.theme.infobar_gradient_top) ? Font::FULLBG : 0) | Font::IS_UTF8; /* right now, infobar_show_channellogo == 3 is the trigger for signal bars etc. TODO: decouple this */ if (!fileplay && !IS_WEBTV(current_channel_id) && ( g_settings.infobar_show_channellogo == 3 || g_settings.infobar_show_channellogo == 5 || g_settings.infobar_show_channellogo == 6 )) { @@ -1653,7 +1657,7 @@ void CInfoViewer::showSNR () int freqWidth = g_SignalFont->getRenderWidth(freq); if (freqWidth > (ChanWidth - numbox_offset*2)) freqWidth = ChanWidth - numbox_offset*2; - g_SignalFont->RenderString(BoxStartX + numbox_offset + ((ChanWidth - freqWidth) / 2), y_numbox + y_freq - 3, ChanWidth - 2*numbox_offset, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT); + g_SignalFont->RenderString(BoxStartX + numbox_offset + ((ChanWidth - freqWidth) / 2), y_numbox + y_freq - 3, ChanWidth - 2*numbox_offset, freq, SDT_freq_update ? COL_COLORED_EVENTS_TEXT:COL_INFOBAR_TEXT, 0, renderFlag); SDT_freq_update = false; } if (sigbox == NULL){ @@ -2169,7 +2173,7 @@ void CInfoViewer::killTitle() clock->kill(); #endif body->kill(); -#if 0 //not really required to kill epg infos, body does this + if (txt_cur_event) txt_cur_event->kill(); if (txt_cur_event_rest) @@ -2182,7 +2186,7 @@ void CInfoViewer::killTitle() txt_next_event->kill(); if (txt_next_in) txt_next_in->kill(); -#endif + if (timescale) if (g_settings.infobar_progressbar == SNeutrinoSettings::INFOBAR_PROGRESSBAR_ARRANGEMENT_DEFAULT) timescale->kill(); diff --git a/src/gui/osd_setup.cpp b/src/gui/osd_setup.cpp index ee7bc8b62..d47d08b94 100644 --- a/src/gui/osd_setup.cpp +++ b/src/gui/osd_setup.cpp @@ -980,11 +980,6 @@ void COsdSetup::showOsdFontSizeSetup(CMenuWidget *menu_fonts) mfTtxFontFile->setHint("", LOCALE_MENU_HINT_FONT_TTX); fontSettings->addItem(mfTtxFontFile); - // contrast fonts - CMenuOptionChooser * mc = new CMenuOptionChooser(LOCALE_COLORMENU_CONTRAST_FONTS, &g_settings.contrast_fonts, OPTIONS_OFF0_ON1_OPTIONS, OPTIONS_OFF0_ON1_OPTION_COUNT, true, this, CRCInput::RC_yellow); - mc->setHint("", LOCALE_MENU_HINT_CONTRAST_FONTS); - fontSettings->addItem(mc); - fontSettings->addItem(new CMenuSeparator(CMenuSeparator::LINE | CMenuSeparator::STRING, LOCALE_FONTMENU_SIZES)); //submenu font scaling @@ -1340,9 +1335,7 @@ void COsdSetup::showOsdInfoclockSetup(CMenuWidget *menu_infoclock) bool COsdSetup::changeNotify(const neutrino_locale_t OptionName, void * data) { - if(ARE_LOCALES_EQUAL(OptionName, LOCALE_COLORMENU_CONTRAST_FONTS)) - return true; - else if(ARE_LOCALES_EQUAL(OptionName, LOCALE_SETTINGS_MENU_POS)) { + if (ARE_LOCALES_EQUAL(OptionName, LOCALE_SETTINGS_MENU_POS)) { submenu_menus->hide(); return true; } diff --git a/src/gui/screensaver.cpp b/src/gui/screensaver.cpp index 1ded487eb..7c3b50b5a 100644 --- a/src/gui/screensaver.cpp +++ b/src/gui/screensaver.cpp @@ -270,10 +270,11 @@ void CScreenSaver::paint() } else{ if (!scr_clock){ - scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", "%H:%M %S", true); + scr_clock = new CComponentsFrmClock(1, 1, NULL, "%H:%M:%S", "%H:%M %S", true, + 1, NULL, CC_SHADOW_OFF, COL_BLACK, COL_BLACK); scr_clock->setClockFont(g_Font[SNeutrinoSettings::FONT_TYPE_INFOBAR_NUMBER]); scr_clock->disableSaveBg(); - scr_clock->doPaintBg(false); + scr_clock->doPaintBg(true); } if (scr_clock->isPainted()) scr_clock->Stop(); diff --git a/src/gui/test_menu.cpp b/src/gui/test_menu.cpp index f3bfcb5e6..7bf9a3e9d 100644 --- a/src/gui/test_menu.cpp +++ b/src/gui/test_menu.cpp @@ -565,7 +565,7 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) else if (actionKey == "text_ext"){ if (text_ext == NULL) text_ext = new CComponentsExtTextForm(); - text_ext->setDimensionsAll(10, 20, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()); + text_ext->setDimensionsAll(10, 20, 300, g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]->getHeight()+2*2); text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); text_ext->setFrameThickness(2); // text_ext->setLabelWidthPercent(15/*%*/); @@ -582,15 +582,12 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) text_ext->setDimensionsAll(10, 20, 300, 48); text_ext->setLabelAndText("Label", "Text for demo", g_Font[SNeutrinoSettings::FONT_TYPE_MENU_TITLE]); text_ext->setFrameThickness(2); - // text_ext->setLabelWidthPercent(15/*%*/); - text_ext->paint0(); - static_cast(text_ext->getCCItem(1))->kill(); } - if (static_cast(text_ext->getCCItem(1))-> paintBlink(500000, true)){ + if (text_ext->paintBlink(500000, true)){ ShowHint("Testmenu: Blink","Testmenu: Blinking extended text is running ...", 700, 10); } - if (text_ext->getTextObject()->cancelBlink()){ + if (text_ext->cancelBlink()){ ShowHint("Testmenu: Blink","Testmenu: Blinking extended text stopped ...", 700, 2); } return res; @@ -741,6 +738,9 @@ int CTestMenu::exec(CMenuTarget* parent, const std::string &actionKey) ShowHint("Testmenu: Blink","Testmenu: Blinking image stopped ...", 700, 2); } + iconform->kill(); + delete iconform; + iconform = NULL; return res; } else if (actionKey == "window"){ diff --git a/src/gui/volumebar.cpp b/src/gui/volumebar.cpp index 58a41f7d9..be6e5a3cb 100644 --- a/src/gui/volumebar.cpp +++ b/src/gui/volumebar.cpp @@ -50,8 +50,8 @@ CVolumeBar::CVolumeBar() void CVolumeBar::initVarVolumeBar() { col_body = COL_MENUCONTENT_PLUS_0; - - vb_item_offset = 4; + corner_rad = CORNER_RADIUS_MID; + vb_item_offset = OFFSET_INNER_SMALL; height = g_settings.volume_size; //default height //assume volume value as pointer to global setting @@ -87,14 +87,14 @@ void CVolumeBar::initVolumeBarSize() cvh->getDimensions(&x, &y, &sw, &sh, &vb_icon_w, &vb_digit_w); cvh->getVolBarDimensions(&y, &height); - vb_digit_w += cornerRad()/2; + //vb_digit_w += corner_rad/2; //scale vb_pbw = 200; vb_pbh = height-4*vb_item_offset; //result for width - width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset; + width = (vb_icon_w + vb_pbw + vb_digit_w) + 4*vb_item_offset + corner_rad/2; //adapt x-pos vb_pbx = vb_item_offset + vb_icon_w + vb_item_offset; @@ -177,57 +177,54 @@ void CVolumeBar::initVolumeBarItems() //init current icon object void CVolumeBar::initVolumeBarIcon() { - vb_icon = new CComponentsPicture(vb_icon_x, CC_CENTERED, vb_icon_w, height, NEUTRINO_ICON_VOLUME); + if (!vb_icon){ + vb_icon = new CComponentsPicture(vb_icon_x, CC_CENTERED, vb_icon_w, height, NEUTRINO_ICON_VOLUME); + //add icon to container + addCCItem(vb_icon); + } + vb_icon->setDimensionsAll(vb_icon_x, CC_CENTERED, vb_icon_w, height); vb_icon->setColorBody(col_body); - vb_icon->setCorner(cornerRad(), CORNER_LEFT); - - //add icon to container - addCCItem(vb_icon); + vb_icon->setCorner(corner_rad, CORNER_LEFT); } //create new scale void CVolumeBar::initVolumeBarScale() { - vb_pb = new CProgressBar(); + if (!vb_pb){ + vb_pb = new CProgressBar(); + //add progressbar to container + addCCItem(vb_pb); + } vb_pb->setType(CProgressBar::PB_REDRIGHT); vb_pb->setRgb(85, 75, 100); vb_pb->setFrameThickness(2); vb_pb->setProgress(vb_pbx, vb_pby, vb_pbw, vb_pbh, *vb_vol, 100); - - //add progressbar to container - addCCItem(vb_pb); } //set digit text with current volume value void CVolumeBar::initVolumeBarDigitValue() { + vb_digit->kill(col_body); vb_digit->setText(*vb_vol ,vb_digit_mode, *(CVolumeHelper::getInstance()->vb_font)); } //create digit void CVolumeBar::initVolumeBarDigit() { - vb_digit = new CComponentsLabel(); + if (!vb_digit) + vb_digit = new CComponentsLabel(this); vb_digit->setDimensionsAll(vb_digit_x, 0, vb_digit_w, height); vb_digit->setTextColor(COL_MENUCONTENT_TEXT); - vb_digit->setCorner(cornerRad(), CORNER_RIGHT); + vb_digit->setCorner(corner_rad, CORNER_RIGHT); initVolumeBarDigitValue(); - - //add digit label to container - addCCItem(vb_digit); } //refresh and paint digit void CVolumeBar::paintVolumeBarDigit() { - // digits - CTextBox* ctb = vb_digit->getCTextBoxObject(); - if (ctb) - ctb->setFontUseDigitHeight(); - // paint digit vb_digit->paint(CC_SAVE_SCREEN_NO); } @@ -251,6 +248,18 @@ void CVolumeBar::paintVolScale() vb_pb->paint(CC_SAVE_SCREEN_NO); } +void CVolumeBar::paint(bool do_save_bg) +{ + //prepare items + initVolumeBarItems(); + + //paint form contents + if (!is_painted) + CComponentsForm::paint(do_save_bg); + else + repaintVolScale(); +} + // CVolumeHelper #################################################################################################### diff --git a/src/gui/volumebar.h b/src/gui/volumebar.h index 62ce4d90c..cfc201305 100644 --- a/src/gui/volumebar.h +++ b/src/gui/volumebar.h @@ -72,9 +72,6 @@ class CVolumeBar : public CComponentsForm void paintVolScale(); void paintVolumeBarDigit(); -// inline int cornerRad() { return (g_settings.rounded_corners) ? height/2 : 0; } - inline int cornerRad() { return (g_settings.rounded_corners) ? CORNER_RADIUS_SMALL : 0; } - public: enum @@ -92,6 +89,7 @@ class CVolumeBar : public CComponentsForm // ~CVolumeBar(); inherited from CComponentsForm void repaintVolScale(); + void paint(bool do_save_bg = CC_SAVE_SCREEN_YES); }; diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index ee882f3dd..959e63c1a 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -1074,6 +1074,8 @@ void CMenuWidget::hide() header->kill(); if (info_box) info_box->kill(); + if (details_line) + details_line->hide(); frameBuffer->paintBackgroundBoxRel(x, y, full_width, full_height + fbutton_height); //paintHint(-1); } @@ -1254,6 +1256,8 @@ void CMenuWidget::paint() header->setCaptionColor(COL_MENUHEAD_TEXT); header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0); header->enableGradientBgCleanUp(savescreen); + if (header->isPainted()) + header->kill(header->getColorBody()); header->paint(CC_SAVE_SCREEN_NO); // paint body shadow diff --git a/src/gui/widget/msgbox.cpp b/src/gui/widget/msgbox.cpp index dc5b0b50c..25deb70f8 100644 --- a/src/gui/widget/msgbox.cpp +++ b/src/gui/widget/msgbox.cpp @@ -542,32 +542,32 @@ int ShowMsg( const std::string & Title, return (result); } -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int &Timeout , const int& Text_mode) { - ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, NO_TIMEOUT, false, Text_mode, COL_RED); + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, Timeout, false, Text_mode, COL_RED); } -void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int &Timeout , const int& Text_mode) { - ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, NO_TIMEOUT, false, Text_mode, COL_RED); + ShowMsg(caption, ErrorMsg, CMsgBox::mbrCancel, CMsgBox::mbBack, NEUTRINO_ICON_ERROR, 500, Timeout, false, Text_mode, COL_RED); } -void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode) +void DisplayErrorMessage(const char * const ErrorMsg, const int &Timeout, const int& Text_mode) { - DisplayErrorMessage(ErrorMsg, LOCALE_MESSAGEBOX_ERROR, Text_mode); + DisplayErrorMessage(ErrorMsg, LOCALE_MESSAGEBOX_ERROR, Timeout, Text_mode); } -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, NO_TIMEOUT, false, Text_mode, color_frame); + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, Timeout, false, Text_mode, color_frame); } -void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, NO_TIMEOUT, false, Text_mode, color_frame); + ShowMsg(caption, InfoMsg, CMsgBox::mbrBack, CMsgBox::mbOk, NEUTRINO_ICON_INFO, 500, Timeout, false, Text_mode, color_frame); } -void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode, fb_pixel_t color_frame) +void DisplayInfoMessage(const char * const InfoMsg, const int& Timeout, const int& Text_mode, fb_pixel_t color_frame) { - DisplayInfoMessage(InfoMsg, LOCALE_MESSAGEBOX_INFO, Text_mode, color_frame); + DisplayInfoMessage(InfoMsg, LOCALE_MESSAGEBOX_INFO, Timeout, Text_mode, color_frame); } diff --git a/src/gui/widget/msgbox.h b/src/gui/widget/msgbox.h index f15060973..dcca0b8a7 100644 --- a/src/gui/widget/msgbox.h +++ b/src/gui/widget/msgbox.h @@ -403,10 +403,10 @@ int ShowMsg( const std::string & Title, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = HINTBOX_DEFAULT_FRAME_COLOR); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 -void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const neutrino_locale_t& caption, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayErrorMessage(const char * const ErrorMsg, const std::string& caption, const int& Timeout = NO_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const neutrino_locale_t& caption, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 +void DisplayInfoMessage(const char * const InfoMsg, const std::string& caption, const int& Timeout = DEFAULT_TIMEOUT, const int& Text_mode = DEFAULT_MSGBOX_TEXT_MODE, fb_pixel_t color_frame = COL_DARK_GRAY); // UTF-8 #endif diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index e669687ae..54968c03c 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -159,6 +159,7 @@ void CTextBox::initVar(void) m_pcFontText = g_Font[SNeutrinoSettings::FONT_TYPE_EPG_INFO1]; m_nFontTextHeight = getFontTextHeight(); m_nMaxTextWidth = 0; + m_bg_painted = false; m_nNrOfPages = 1; m_nNrOfLines = 0; @@ -573,7 +574,6 @@ void CTextBox::reInitToCompareVar(int* x, int* y, int* dx, int* dy) m_old_nBgRadius = m_nBgRadius; m_old_nBgRadiusType = m_nBgRadiusType; m_old_nMode = m_nMode; - m_old_cText = m_cText; } void CTextBox::refreshText(void) @@ -601,12 +601,13 @@ void CTextBox::refreshText(void) bool has_changed = hasChanged(&ax, &ay, &dx, &dy); //clean up possible screen on any changes - if (has_changed && m_bgpixbuf){ + if (has_changed || m_bgpixbuf){ /*TODO/FIXME: in some cases could be required, that we must restore old saved screen. eg. if a text without bg was painted * and another text should be painted as next on the same position like current text, but new text will be overpaint and is * not visible. It's currently solvable only with appropriate order of text items */ - frameBuffer->RestoreScreen(m_old_x, m_old_y, m_old_dx, m_old_dy, m_bgpixbuf); + if (m_bgpixbuf) + frameBuffer->RestoreScreen(m_old_x, m_old_y, m_old_dx, m_old_dy, m_bgpixbuf); clearScreenBuffer(); } @@ -648,6 +649,7 @@ void CTextBox::refreshText(void) //TRACE("[CTextBox] %s paint bg %d\r\n", __FUNCTION__, __LINE__); //paint full background only on new text, otherwise paint required background frameBuffer->paintBoxRel(ax, ay, dx, dy, m_textBackgroundColor, m_nBgRadius, BgRadiusType); + m_bg_painted = true; } } else{ @@ -716,10 +718,11 @@ void CTextBox::refreshText(void) frameBuffer->paintBoxRel(tx, ty-th, tw, th, COL_RED, m_nBgRadius, m_nBgRadiusType); #endif //TRACE("[CTextBox] %s Line %d m_cFrame.iX %d m_cFrameTextRel.iX %d\r\n", __FUNCTION__, __LINE__, m_cFrame.iX, m_cFrameTextRel.iX); - m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, (m_renderMode | m_utf8_encoded) ? Font::IS_UTF8 : 0); - m_old_cText = m_cText; + if (m_bg_painted || m_old_cText != m_cText) + m_pcFontText->RenderString(tx, ty, tw, m_cLineArray[i].c_str(), m_textColor, 0, m_renderMode | ((m_utf8_encoded) ? Font::IS_UTF8 : 0)); y += m_nFontTextHeight; } + m_old_cText = m_cText; } void CTextBox::scrollPageDown(const int pages) @@ -786,23 +789,26 @@ void CTextBox::refresh(void) bool CTextBox::setText(const std::string* newText, int max_width, bool force_repaint) { //TRACE("[CTextBox]->SetText \r\n"); - bool result = false; m_nMaxTextWidth = max_width; //reset text to force repaint the text, managed in hasChanged() if (force_repaint) m_old_cText = ""; //printf("setText: _max_width %d max_width %d\n", _max_width, max_width); - if (newText != NULL) - { + if (newText){ m_cText = *newText; - //m_cText = *newText + "\n"; //FIXME test - reSizeMainFrameHeight(m_cFrame.iHeight); - //refresh text line array - refreshTextLineArray(); - refresh(); - result = true; - } - return(result); + if (m_old_cText != m_cText){ + //m_cText = *newText + "\n"; //FIXME test + reSizeMainFrameHeight(m_cFrame.iHeight); + //refresh text line array + refreshTextLineArray(); + refresh(); + return true; + } + return false; + }else + return false; + + return true; } void CTextBox::paint (void) diff --git a/src/gui/widget/textbox.h b/src/gui/widget/textbox.h index c38ea5ef1..afb4e3912 100644 --- a/src/gui/widget/textbox.h +++ b/src/gui/widget/textbox.h @@ -122,6 +122,7 @@ class CTextBox : public sigc::trackable fb_pixel_t m_old_textBackgroundColor, m_old_textColor; bool m_showTextFrame; + bool m_bg_painted; CBox m_cFrame; CBox m_cFrameTextRel; diff --git a/src/neutrino.cpp b/src/neutrino.cpp index 8cff8efa5..1798b1631 100644 --- a/src/neutrino.cpp +++ b/src/neutrino.cpp @@ -600,8 +600,6 @@ int CNeutrinoApp::loadSetup(const char * fname) for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++)//settings.h, settings.cpp g_settings.personalize[i] = configfile.getInt32( personalize_settings[i].personalize_settings_name, personalize_settings[i].personalize_default_val ); - g_settings.contrast_fonts = configfile.getInt32("contrast_fonts", 0); - //network for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { std::string i_str(to_string(i)); @@ -1222,7 +1220,6 @@ void CNeutrinoApp::saveSetup(const char * fname) for (int i = 0; i < SNeutrinoSettings::P_SETTINGS_MAX; i++) //settings.h, settings.cpp configfile.setInt32(personalize_settings[i].personalize_settings_name, g_settings.personalize[i]); - configfile.setInt32( "contrast_fonts", g_settings.contrast_fonts ); //network for(int i=0 ; i < NETWORK_NFS_NR_OF_ENTRIES ; i++) { sprintf(cfg_key, "network_nfs_ip_%d", i); diff --git a/src/system/locals.h b/src/system/locals.h index 18546341d..b74b90eb8 100644 --- a/src/system/locals.h +++ b/src/system/locals.h @@ -346,7 +346,6 @@ typedef enum LOCALE_COLORMENU_ADVANCED_MODE_ON, LOCALE_COLORMENU_BACKGROUND, LOCALE_COLORMENU_CLOCK_TEXTCOLOR, - LOCALE_COLORMENU_CONTRAST_FONTS, LOCALE_COLORMENU_FADE, LOCALE_COLORMENU_FONT, LOCALE_COLORMENU_FONT_TTX, @@ -1057,7 +1056,6 @@ typedef enum LOCALE_MENU_HINT_COLORS, LOCALE_MENU_HINT_CONTENT_BACK, LOCALE_MENU_HINT_CONTENT_TEXTCOLOR, - LOCALE_MENU_HINT_CONTRAST_FONTS, LOCALE_MENU_HINT_DBOXINFO, LOCALE_MENU_HINT_DELETE_CHANNELS, LOCALE_MENU_HINT_DELETE_REMOVED, diff --git a/src/system/locals_intern.h b/src/system/locals_intern.h index f2d76e08d..b3b18075b 100644 --- a/src/system/locals_intern.h +++ b/src/system/locals_intern.h @@ -346,7 +346,6 @@ const char * locale_real_names[] = "colormenu.advanced_mode_on", "colormenu.background", "colormenu.clock_textcolor", - "colormenu.contrast_fonts", "colormenu.fade", "colormenu.font", "colormenu.font_ttx", @@ -1057,7 +1056,6 @@ const char * locale_real_names[] = "menu.hint_colors", "menu.hint_content_back", "menu.hint_content_textcolor", - "menu.hint_contrast_fonts", "menu.hint_dboxinfo", "menu.hint_delete_channels", "menu.hint_delete_removed", diff --git a/src/system/settings.h b/src/system/settings.h index acd731503..b51e95fce 100644 --- a/src/system/settings.h +++ b/src/system/settings.h @@ -426,8 +426,6 @@ struct SNeutrinoSettings SNeutrinoTheme theme; bool osd_colorsettings_advanced_mode; - int contrast_fonts; - //network #define NETWORK_NFS_NR_OF_ENTRIES 8 struct { diff --git a/src/zapit/src/zapit.cpp b/src/zapit/src/zapit.cpp index 606515658..d6b260cf3 100644 --- a/src/zapit/src/zapit.cpp +++ b/src/zapit/src/zapit.cpp @@ -523,6 +523,11 @@ bool CZapit::ZapIt(const t_channel_id channel_id, bool forupdate, bool startplay if (IS_WEBTV(newchannel->getChannelID()) && !newchannel->getUrl().empty()) { dvbsub_stop(); + if (current_channel->getChannelID() == newchannel->getChannelID() && !newchannel->getScriptName().empty()){ + INFO("[zapit] stop rezap to channel %s id %" PRIx64 ")", newchannel->getName().c_str(), newchannel->getChannelID()); + return true; + } + if (!IS_WEBTV(live_channel_id)) CCamManager::getInstance()->Stop(live_channel_id, CCamManager::PLAY);