From 92d733f5239db60a09ed728651113db19053cc55 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Apr 2017 15:06:16 +0200 Subject: [PATCH 1/4] CChannelList/CUpnpBrowserGui: add missing reinit for corner modes Required eg. if corner settings has been changed by user on runtime. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/0943c467e2a88811374d3f980f0c2df4dccab139 Author: Thilo Graf Date: 2017-04-23 (Sun, 23 Apr 2017) --- src/gui/channellist.cpp | 1 + src/gui/upnpbrowser.cpp | 7 ++++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index 2e6ad72b1..ba3cb8941 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -2119,6 +2119,7 @@ void CChannelList::paintHead() } header->setDimensionsAll(x, y, full_width, theight); + header->setCorner(RADIUS_LARGE, CORNER_TOP); if (bouquet && bouquet->zapitBouquet && bouquet->zapitBouquet->bLocked != g_settings.parentallock_defaultlocked) header->setIcon(NEUTRINO_ICON_LOCK); diff --git a/src/gui/upnpbrowser.cpp b/src/gui/upnpbrowser.cpp index 5871a3ea2..b407d7924 100644 --- a/src/gui/upnpbrowser.cpp +++ b/src/gui/upnpbrowser.cpp @@ -941,6 +941,7 @@ void CUpnpBrowserGui::paintDeviceInfo() tmp += m_devices[m_selecteddevice].modelurl; topbox.setDimensionsAll(m_x, m_y, m_width, m_topbox_height); + topbox.setCorner(RADIUS_LARGE); topbox.setText(tmp, CTextBox::AUTO_WIDTH); topbox.paint0(); } @@ -991,7 +992,7 @@ void CUpnpBrowserGui::paintDevices() header.addContextButton(NEUTRINO_ICON_BUTTON_MUTE_SMALL); else header.removeContextButtons(); - //header.enableShadow(); + header.setCorner(RADIUS_LARGE, CORNER_TOP); header.paint(CC_SAVE_SCREEN_NO); // Items @@ -1012,6 +1013,7 @@ void CUpnpBrowserGui::paintDevices() m_frameBuffer->paintBoxRel(m_x + m_width, m_item_y + OFFSET_SHADOW, OFFSET_SHADOW, sb, COL_SHADOW_PLUS_0); // Foot + footer.setCorner(RADIUS_LARGE, CORNER_BOTTOM); footer.paintButtons(m_x, m_footer_y, m_width, m_footer_height, 1, &RescanButton, m_width/2); paintItem2DetailsLine(-1); // clear it @@ -1148,6 +1150,7 @@ void CUpnpBrowserGui::paintItemInfo(UPnPEntry *entry) } } + topbox.setCorner(RADIUS_LARGE); topbox.setText(tmp, CTextBox::AUTO_WIDTH); topbox.paint0(); } @@ -1197,7 +1200,9 @@ void CUpnpBrowserGui::paintDetails(UPnPEntry *entry, bool use_playing) char tmp_time[] = "000:00"; int timebox_width = timebox.getFont()->getRenderWidth(tmp_time) + OFFSET_INNER_MID*2; infobox.setDimensionsAll(m_x, m_infobox_y, m_width - OFFSET_SHADOW - OFFSET_INTER - timebox_width, m_infobox_height); + infobox.setCorner(RADIUS_LARGE); timebox.setDimensionsAll(m_x + m_width - timebox_width, infobox.getYPos(), timebox_width, m_infobox_height); + timebox.setCorner(RADIUS_LARGE); printf("paintDetails: use_playing %d shown %d\n", use_playing, m_playing_entry_is_shown); if ((!use_playing) && entry->isdir){ From e04455c5d50a90a17f5f8e4478c17f86862d0a05 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Apr 2017 16:45:03 +0200 Subject: [PATCH 2/4] CComponentsHeader: add fallback if title and logo are overlapping Logo is now general centered on screen, not as before between title and clock Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/1413f296ae1afb786a2a5b38edcf10f3123f59b4 Author: Thilo Graf Date: 2017-04-23 (Sun, 23 Apr 2017) --- src/gui/components/cc_frm_header.cpp | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index f053e94ec..9fef1dfba 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -307,8 +307,15 @@ void CComponentsHeader::initLogo() x_logo = x_logo_right; if (cch_logo.Align == CC_LOGO_LEFT) x_logo = x_logo_left; - if (cch_logo.Align == CC_LOGO_CENTER) - x_logo = x_logo_left + logo_space/2 - cch_logo_obj->getWidth()/2; + if (cch_logo.Align == CC_LOGO_CENTER){ + x_logo = width/2 - cch_logo_obj->getWidth()/2; + //fallback if previous item and logo are overlapping + 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; + } + } cch_logo_obj->setXPos(x_logo); cch_logo_obj->setYPos(height/2 - cch_logo_obj->getHeight()/2); From c9f16f1b30d9147dcf5370157368814b810c9d4f Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Apr 2017 16:56:41 +0200 Subject: [PATCH 3/4] CComponentsHeader: use previous offset to fit logo Was OFFSET_INNER_MIN in older versions, not OFFSET_INNER_SMALL. Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/330171c90bb02e94689529162df95fc5e855090a Author: Thilo Graf Date: 2017-04-23 (Sun, 23 Apr 2017) --- src/gui/components/cc_frm_header.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/gui/components/cc_frm_header.cpp b/src/gui/components/cc_frm_header.cpp index 9fef1dfba..9161a0fe3 100644 --- a/src/gui/components/cc_frm_header.cpp +++ b/src/gui/components/cc_frm_header.cpp @@ -274,7 +274,7 @@ void CComponentsHeader::initIcon() void CComponentsHeader::initLogo() { - cch_logo.dy_max = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_SMALL : cch_logo.dy_max; + cch_logo.dy_max = cch_logo.dy_max == -1 ? height - 2*OFFSET_INNER_MIN : cch_logo.dy_max; if(!cch_logo_obj) cch_logo_obj = new CComponentsChannelLogoScalable(width/2, height/2 - cch_logo.dy_max/2, cch_logo.Name, cch_logo.Id, this); From a9acc7f9750b325c17a9c923dbca50704cb97c61 Mon Sep 17 00:00:00 2001 From: Thilo Graf Date: Sun, 23 Apr 2017 13:42:50 +0200 Subject: [PATCH 4/4] CChannelList: remove unused logo object Not required since 100032e7d41989e3c66c6ddab25d0a3d6b00f320: add possibility to show channellogo Origin commit data ------------------ Commit: https://github.com/neutrino-images/ni-neutrino/commit/fbe8889fa9f63850b40247e6a33488b237a7178a Author: Thilo Graf Date: 2017-04-23 (Sun, 23 Apr 2017) --- src/gui/channellist.cpp | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/src/gui/channellist.cpp b/src/gui/channellist.cpp index ba3cb8941..680e09724 100644 --- a/src/gui/channellist.cpp +++ b/src/gui/channellist.cpp @@ -96,7 +96,6 @@ extern bool autoshift; static CComponentsPIP *cc_minitv = NULL; extern CBouquetManager *g_bouquetManager; extern int old_b_id; -static CComponentsChannelLogoScalable* CChannelLogo = NULL; static CComponentsHeader *header = NULL; extern bool timeset; @@ -126,7 +125,6 @@ CChannelList::CChannelList(const char * const pName, bool phistoryMode, bool _vl cc_minitv = NULL; logo_off = 0; minitv_is_active = false; - CChannelLogo = NULL; headerNew = true; bouquet = NULL; chanlist = &channels; @@ -955,11 +953,6 @@ void CChannelList::hide() } if(header) header->kill(); - if (CChannelLogo){ - CChannelLogo->kill(); - delete CChannelLogo; - CChannelLogo = NULL; - } frameBuffer->paintBackgroundBoxRel(x, y, full_width, height + OFFSET_INTER + info_height); clearItem2DetailsLine(); @@ -2130,11 +2123,6 @@ void CChannelList::paintHead() header->setCaption(header_txt, CTextBox::NO_AUTO_LINEBREAK, header_txt_col); - if (header->enableColBodyGradient(g_settings.theme.menu_Head_gradient, COL_MENUCONTENT_PLUS_0)){ - if (CChannelLogo) - CChannelLogo->clearFbData(); - } - if (timeset) { if(!edit_state){ if (header->getContextBtnObject()) @@ -2181,10 +2169,6 @@ void CChannelList::ResetModules() delete cc_minitv; cc_minitv = NULL; } - if (CChannelLogo) { - delete CChannelLogo; - CChannelLogo = NULL; - } } void CChannelList::paintBody()