From 1cc131bce9c870cecf8f83c6616417a041cb241e Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 10 Feb 2016 21:20:21 +0100 Subject: [PATCH 01/12] CTextBox: don't paint full background if max text width smaller than bg width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/2dd2fac37609c190c01312b919d58321c08d519d Author: Thilo Graf Date: 2016-02-10 (Wed, 10 Feb 2016) --- src/gui/widget/textbox.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/textbox.cpp b/src/gui/widget/textbox.cpp index e2daec4bd..0fc38b141 100644 --- a/src/gui/widget/textbox.cpp +++ b/src/gui/widget/textbox.cpp @@ -563,7 +563,7 @@ void CTextBox::refreshText(void) //bg variables int ax = m_cFrameTextRel.iX+m_cFrame.iX; int ay = m_cFrameTextRel.iY+m_cFrame.iY; - int dx = m_cFrameTextRel.iWidth; + int dx = m_old_cText != m_cText ? m_cFrameTextRel.iWidth : m_nMaxTextWidth; int dy = m_cFrameTextRel.iHeight; //find changes @@ -602,6 +602,7 @@ void CTextBox::refreshText(void) clearScreenBuffer(); if (allow_paint_bg){ //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, m_nBgRadiusType); } } From 5a6684ed94f5f02208f3f5a687aee62e1a646017 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 4 May 2016 17:42:51 +0200 Subject: [PATCH 02/12] CMenuWidget: avoid dangling pointer after delete Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/91729dc48a20ce9e2e004695a535d98f789731cc Author: Thilo Graf Date: 2016-05-04 (Wed, 04 May 2016) --- src/gui/widget/menue.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/gui/widget/menue.cpp b/src/gui/widget/menue.cpp index 64baaca59..4935cf5bf 100644 --- a/src/gui/widget/menue.cpp +++ b/src/gui/widget/menue.cpp @@ -677,8 +677,10 @@ void CMenuWidget::resetWidget(bool delete_items) { for(unsigned int count=0;countisStatic) + if (delete_items && !item->isStatic){ delete item; + item = NULL; + } } items.clear(); From 0df821d472def816c1669c56b1513ce95358f0cc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 26 Jun 2016 15:26:33 +0200 Subject: [PATCH 03/12] CComponentsFrmClock: disable non-essential debug output It was just important to see how the texts are fitted inside a parent element. It's just a debugging relic. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/8d3f70b11269b54be1b8604cb9443fa07e15886f Author: Thilo Graf Date: 2016-06-26 (Sun, 26 Jun 2016) --- src/gui/components/cc_frm_clock.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_clock.cpp b/src/gui/components/cc_frm_clock.cpp index 7a36db280..a6e0b773b 100644 --- a/src/gui/components/cc_frm_clock.cpp +++ b/src/gui/components/cc_frm_clock.cpp @@ -420,7 +420,7 @@ void CComponentsFrmClock::setHeight(const int& h) int f_height = cl_font->getHeight(); if (h != f_height){ - dprintf(DEBUG_NORMAL, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); + dprintf(DEBUG_DEBUG, "\033[33m[CComponentsFrmClock]\t[%s - %d], font height is different than current height [%d], using [%d] ...\033[0m\n", __func__, __LINE__, h, f_height); CCDraw::setHeight(f_height); }else CCDraw::setHeight(h); From 67e645be25a6896857814fcd273fb652a8bef0bc Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 24 Feb 2016 19:10:31 +0100 Subject: [PATCH 04/12] CComponentsWindow: ensure default disable background paint on window Only basic items should have enabled background paint as default. Should be better for performance. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0f64aff1dc931c13935862893c6d47ba56fdd126 Author: Thilo Graf Date: 2016-02-24 (Wed, 24 Feb 2016) --- src/gui/components/cc_frm_window.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index f964a7f06..e3481ac93 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -133,7 +133,7 @@ void CComponentsWindow::initVarWindow( const int& x_pos, const int& y_pos, const ccw_icon_name = iconname; dprintf(DEBUG_DEBUG, "[CComponentsWindow] [%s - %d] icon name = %s\n", __func__, __LINE__, ccw_icon_name.c_str()); - + paint_bg = false; shadow = shadow_mode; col_frame = color_frame; col_body = color_body; From de5cef653cbb5f6780aa8e6787a6bd6e45ef1d65 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 17 May 2016 15:42:03 +0200 Subject: [PATCH 05/12] CComponentsWindow: use only body as background Should provide more performance Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/775e5c73a4eee0bc9864291bdfe1d18370bbdc70 Author: Thilo Graf Date: 2016-05-17 (Tue, 17 May 2016) --- src/gui/components/cc_frm_window.cpp | 34 +++++++++++++++++++--------- 1 file changed, 23 insertions(+), 11 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index e3481ac93..388f7f6ac 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -215,12 +215,13 @@ void CComponentsWindow::initFooter() //add of footer item happens initCCWItems() //set footer properties if (ccw_footer){ - ccw_footer->setPos(0, CC_APPEND); + ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()/*- fr_thickness*/); ccw_footer->setWidth(width-2*fr_thickness); - ccw_footer->enableShadow(shadow); - ccw_footer->setCorner(corner_rad, CORNER_BOTTOM); + ccw_footer->enableShadow(false/*shadow*/); + ccw_footer->setCorner(corner_rad-fr_thickness/2, CORNER_BOTTOM); ccw_footer->setButtonFont(ccw_button_font); ccw_footer->setColorBody(ccw_col_footer); + ccw_footer->doPaintBg(true); } } @@ -240,7 +241,7 @@ void CComponentsWindow::initLeftSideBar() int h_sbar = height - h_header - h_footer - 2*fr_thickness; int w_sbar = ccw_w_sidebar; ccw_left_sidebar->setDimensionsAll(0, CC_APPEND, w_sbar, h_sbar); - ccw_left_sidebar->doPaintBg(false); + ccw_left_sidebar->doPaintBg(true); } } @@ -260,7 +261,7 @@ void CComponentsWindow::initRightSideBar() int h_sbar = height - h_header - h_footer - 2*fr_thickness; int w_sbar = ccw_w_sidebar; ccw_right_sidebar->setDimensionsAll(width - w_sbar, CC_APPEND, w_sbar, h_sbar); - ccw_right_sidebar->doPaintBg(false); + ccw_right_sidebar->doPaintBg(true); } } @@ -271,25 +272,36 @@ void CComponentsWindow::initBody() //add of body item happens initCCWItems() //set body properties if (ccw_body){ - ccw_body->setCornerType(0); + ccw_body->setCorner(corner_rad-fr_thickness/2, CORNER_NONE); int h_footer = 0; int h_header = 0; int w_l_sidebar = 0; int w_r_sidebar = 0; - if (ccw_footer) + if (ccw_footer){ h_footer = ccw_footer->getHeight(); - if (ccw_head) + } + if (ccw_head){ h_header = ccw_head->getHeight(); + } if (ccw_left_sidebar) w_l_sidebar = ccw_left_sidebar->getWidth(); if (ccw_right_sidebar) w_r_sidebar = ccw_right_sidebar->getWidth(); - int h_body = height - h_header - h_footer - 2*fr_thickness; + int h_body = height - h_header - h_footer/* - 2*fr_thickness*/; int x_body = w_l_sidebar; int w_body = width-2*fr_thickness - w_l_sidebar - w_r_sidebar; - ccw_body->setDimensionsAll(x_body, CC_APPEND, w_body, h_body); - ccw_body->doPaintBg(false); + ccw_body->setDimensionsAll(x_body, h_header, w_body, h_body); + ccw_body->doPaintBg(true); + + //handle corner behavior + if (!ccw_show_header) + ccw_body->setCornerType(CORNER_TOP); + if (!ccw_show_footer) + ccw_body->setCornerType(ccw_body->getCornerType() | CORNER_BOTTOM); + if (!ccw_show_header) + ccw_body->setCornerType(CORNER_TOP); + } } From cc71c0c923ed56aad373f6b7d79e440562795a09 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Wed, 6 Apr 2016 20:08:18 +0200 Subject: [PATCH 06/12] CCDraw: enable/disable frame if frame on changed frame width Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/a2f96948faf229bde107fe59a57558120a93c8f6 Author: Thilo Graf Date: 2016-04-06 (Wed, 06 Apr 2016) --- src/gui/components/cc_draw.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/gui/components/cc_draw.cpp b/src/gui/components/cc_draw.cpp index b5ef5bf0d..8934d66e4 100644 --- a/src/gui/components/cc_draw.cpp +++ b/src/gui/components/cc_draw.cpp @@ -224,6 +224,11 @@ void CCDraw::setFrameThickness(const int& thickness, const int& thickness_sel) if (fr_thickness_sel != thickness_sel) fr_thickness_sel = thickness_sel; + + //ensure enabled frame if frame width > 0 + cc_enable_frame = false; + if (fr_thickness) + cc_enable_frame = true; } bool CCDraw::enableColBodyGradient(const int& enable_mode, const fb_pixel_t& sec_color, const int& direction) From c9af09e064aabd9c857a6e54d0bb2e8962aac414 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 4 Mar 2016 23:26:58 +0100 Subject: [PATCH 07/12] CUpnpBrowserGui: fix paint image while scroll, use transparent background Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/145209aaa160801615f9c6148bf3aa72adf04a49 Author: Thilo Graf Date: 2016-03-04 (Fri, 04 Mar 2016) --- src/gui/upnpbrowser.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 5baa6df67..73ee2a79e 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -1096,6 +1096,8 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) int y_image = ibox.getYPos() + ibox.getHeight()/2 - h_image/2; if (!image){ image = new CComponentsPicture(100, y_image, tmpname, NULL, CC_SHADOW_OFF, COL_MENUCONTENTDARK_PLUS_0); + image->doPaintBg(false); + image->SetTransparent(CFrameBuffer::TM_BLACK); } image->setPicture(tmpname); image->setHeight(h_image, true); @@ -1185,9 +1187,9 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) text += "\n" + entry->album; ibox.setText(text, CTextBox::AUTO_WIDTH); ibox.paint0(); - if (image) - image->paint0(); } + if (image) + image->paint0(); timebox.paint0(); } } From 178163e2da164cf240150a583c133a8a3af3878a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sat, 16 Apr 2016 20:00:32 +0200 Subject: [PATCH 08/12] dvbsubtitle.cpp: fix wconversion compiler warnings Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/d9aab3ed812643f5547c35a83b457d7e83861395 Author: Thilo Graf Date: 2016-04-16 (Sat, 16 Apr 2016) --- lib/libdvbsub/dvbsubtitle.cpp | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/lib/libdvbsub/dvbsubtitle.cpp b/lib/libdvbsub/dvbsubtitle.cpp index d480f6299..0be467e10 100644 --- a/lib/libdvbsub/dvbsubtitle.cpp +++ b/lib/libdvbsub/dvbsubtitle.cpp @@ -119,7 +119,7 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) double xc = (double) CFrameBuffer::getInstance()->getScreenWidth(true)/(double) 720; double yc = (double) CFrameBuffer::getInstance()->getScreenHeight(true)/(double) 576; xc = yc; //FIXME should we scale also to full width ? - int xf = xc * (double) 720; + int xf = int(xc * (double) 720); for (i = 0; i < Count(); i++) { uint32_t * colors = (uint32_t *) sub.rects[i]->pict.data[1]; @@ -127,15 +127,15 @@ void cDvbSubtitleBitmaps::Draw(int &min_x, int &min_y, int &max_x, int &max_y) int height = sub.rects[i]->h; int xoff, yoff; - int nw = width == 1280 ? ((double) width / xc) : ((double) width * xc); - int nh = (double) height * yc; + int nw = int(width == 1280 ? ((double) width / xc) : ((double) width * xc)); + int nh = int((double) height * yc); int xdiff = (wd > xf) ? ((wd - xf) / 2) : 0; - xoff = sub.rects[i]->x*xc + xstart + xdiff; + xoff = int(sub.rects[i]->x*xc + xstart + xdiff); if(sub.rects[i]->y < 576/2) { - yoff = ystart + sub.rects[i]->y*yc; + yoff = int(ystart + sub.rects[i]->y*yc); } else { - yoff = yend - ((width == 1280 ? 704:576) - (double) (sub.rects[i]->y + height))*yc - nh; + yoff = int(yend - ((width == 1280 ? 704:576) - (double) (sub.rects[i]->y + height))*yc - nh); if(yoff < ystart) yoff = ystart; } @@ -343,7 +343,7 @@ int cDvbSubtitleConverter::Action(void) bitmaps->Del(sb, true); } else if (Delta < WaitMs) - WaitMs = (Delta > SHOW_DELTA) ? Delta - SHOW_DELTA : Delta; + WaitMs = int((Delta > SHOW_DELTA) ? Delta - SHOW_DELTA : Delta); } else bitmaps->Del(sb, true); From 338e29a3928da4f328f489d39fe33f44e291121a Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 16 May 2016 16:01:54 +0200 Subject: [PATCH 09/12] CComponentsWindow: try to fix reduce of item height on enabled frame The lower part of the window frame was always painted over. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0a1d687b3500b340afc7c010d2e118732115ab89 Author: Thilo Graf Date: 2016-05-16 (Mon, 16 May 2016) --- src/gui/components/cc_frm_window.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 388f7f6ac..27a190d6d 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -215,7 +215,7 @@ void CComponentsWindow::initFooter() //add of footer item happens initCCWItems() //set footer properties if (ccw_footer){ - ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()/*- fr_thickness*/); + ccw_footer->setPos(0, cc_yr + height - ccw_footer->getHeight()- fr_thickness); ccw_footer->setWidth(width-2*fr_thickness); ccw_footer->enableShadow(false/*shadow*/); ccw_footer->setCorner(corner_rad-fr_thickness/2, CORNER_BOTTOM); @@ -287,7 +287,7 @@ void CComponentsWindow::initBody() w_l_sidebar = ccw_left_sidebar->getWidth(); if (ccw_right_sidebar) w_r_sidebar = ccw_right_sidebar->getWidth(); - int h_body = height - h_header - h_footer/* - 2*fr_thickness*/; + int h_body = height - h_header - h_footer - fr_thickness; int x_body = w_l_sidebar; int w_body = width-2*fr_thickness - w_l_sidebar - w_r_sidebar; From b57cc261e00cd7b8066f918b088bb3d77bf57407 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Mon, 16 May 2016 15:59:14 +0200 Subject: [PATCH 10/12] CComponentsItem: ensure display of frame as last layer Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/711cb98754bf455e58f1a6ed751c717fb3466b47 Author: Thilo Graf Date: 2016-05-16 (Mon, 16 May 2016) --- src/gui/components/cc_item.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_item.cpp b/src/gui/components/cc_item.cpp index 2f36f262c..a1f30fc16 100644 --- a/src/gui/components/cc_item.cpp +++ b/src/gui/components/cc_item.cpp @@ -111,8 +111,8 @@ void CComponentsItem::paintInit(bool do_save_bg) {true, CC_FBDATA_TYPE_BGSCREEN, ix, iy, width+isw/2, height+isw/2, 0, 0, 0, 0, NULL, NULL, NULL, false}, //buffered bg {sh_r, CC_FBDATA_TYPE_SHADOW_BOX, ixsr, iy+isw/2, isw, height, col_shadow, corner_rad, corner_type & CORNER_RIGHT, 0, NULL, NULL, NULL, false}, //shadow right {sh_b, CC_FBDATA_TYPE_SHADOW_BOX, ix+isw/2, iysb, width, isw, col_shadow, corner_rad, corner_type & CORNER_BOTTOM, 0, NULL, NULL, NULL, false}, //shadow bottom - {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false}, //frame {true, CC_FBDATA_TYPE_BOX, ix+th, iy+th, width-2*th, height-2*th, col_body, rad, corner_type, 0, NULL, NULL, NULL, false}, //body + {true, CC_FBDATA_TYPE_FRAME, ix, iy, width, height, col_frame_cur, corner_rad, corner_type, th, NULL, NULL, NULL, false} //frame }; for(size_t i =0; i< (sizeof(fbdata) / sizeof(fbdata[0])) ;i++) { From 88622a07b480a626a4d97bba9e05799a9984cceb Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Tue, 21 Jun 2016 12:33:49 +0200 Subject: [PATCH 11/12] CComponentsWindow: change order of items Add header and footer items as first and body as last item. Render of items occurs in listed order. So it's better for performance while render of window. This is something more advantageously because all other items are contained inside body. So we avoid possible delay while rendering of base items. It looks better on screen. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/29d723a97b699f6ad3ffede29c94975f9a84db8a Author: Thilo Graf Date: 2016-06-21 (Tue, 21 Jun 2016) Origin message was: ------------------ CComponentsWindow: change order of items Add header and footer items as first and body as last item. Render of items occurs in listed order. So it's better for performance while render of window. This is something more advantageously because all other items are contained inside body. So we avoid possible delay while rendering of base items. It looks better on screen. --- src/gui/components/cc_frm_window.cpp | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/src/gui/components/cc_frm_window.cpp b/src/gui/components/cc_frm_window.cpp index 27a190d6d..67b3657a2 100644 --- a/src/gui/components/cc_frm_window.cpp +++ b/src/gui/components/cc_frm_window.cpp @@ -352,15 +352,19 @@ void CComponentsWindow::initCCWItems() //init window body core initBody(); - //add header, body and footer items only one time + /*Add header and footer items as first and body as last item. + Render of items occurs in listed order. So it's better for performance while render of window. + This is something more advantageously because all other items are contained inside body. + So we avoid possible delay while rendering of base items. It looks better on screen. + */ if (ccw_head) if (!ccw_head->isAdded()) addCCItem(ccw_head); - if (!ccw_body->isAdded()) - addCCItem(ccw_body); if (ccw_footer) if (!ccw_footer->isAdded()) addCCItem(ccw_footer); + if (!ccw_body->isAdded()) + addCCItem(ccw_body); } void CComponentsWindow::enableSidebar(const int& sidbar_type) From af85ced50c941885b110a9f8f2784dd1a227d7d8 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Fri, 15 Apr 2016 22:07:04 +0200 Subject: [PATCH 12/12] CMessageBox: ignore mute button for message boxes In some constellations it's possible that mute button is passed. For example see deleting functionality in moviebrowser. This should avoid unintended passing. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/62861c5f969066e17ede59fa6b922dcfda9082f4 Author: Thilo Graf Date: 2016-04-15 (Fri, 15 Apr 2016) --- src/gui/widget/messagebox.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/widget/messagebox.cpp b/src/gui/widget/messagebox.cpp index 429d55a41..f5d6aa117 100644 --- a/src/gui/widget/messagebox.cpp +++ b/src/gui/widget/messagebox.cpp @@ -271,7 +271,7 @@ int CMessageBox::exec(int timeout) { loop = false; } - else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www) || (msg == CRCInput::RC_spkr) ) + else if((msg == CRCInput::RC_sat) || (msg == CRCInput::RC_favorites) || (msg == CRCInput::RC_www) || (msg == CRCInput::RC_spkr)) { } else if (CNeutrinoApp::getInstance()->handleMsg(msg, data) & messages_return::cancel_all)