From 9b79662575b57616f1cf2a4fd43c6c5513b3e6e5 Mon Sep 17 00:00:00 2001 From: svenhoefer Date: Mon, 7 Nov 2016 21:11:13 +0100 Subject: [PATCH] - moviebrowser: use small offset in header to display channellogo --- src/gui/moviebrowser/mb.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/gui/moviebrowser/mb.cpp b/src/gui/moviebrowser/mb.cpp index 8fa87ef58..b7226229f 100644 --- a/src/gui/moviebrowser/mb.cpp +++ b/src/gui/moviebrowser/mb.cpp @@ -1282,6 +1282,7 @@ void CMovieBrowser::refreshChannelLogo(void) TRACE("[mb]->%s:%d\n", __func__, __LINE__); int w_logo_max = m_cBoxFrameTitleRel.iWidth / 4; + int h_logo_max = m_cBoxFrameTitleRel.iHeight - 2*OFFSET_INNER_MIN; short pb_hdd_offset = 100 + OFFSET_INNER_MID; if (show_mode == MB_SHOW_YT) @@ -1308,12 +1309,10 @@ void CMovieBrowser::refreshChannelLogo(void) { // scale image if required, TODO: move into an own handler, eg. header, so channel logo should be paint in header object int h_logo = m_channelLogo->getHeight(); - if (h_logo > m_cBoxFrameTitleRel.iHeight) + if (h_logo > h_logo_max) { - uint8_t ratio = m_cBoxFrameTitleRel.iHeight*100/h_logo; - m_channelLogo->setHeight(m_cBoxFrameTitleRel.iHeight); - int w_logo = ratio*m_channelLogo->getWidth()/100; - m_channelLogo->setWidth(min(w_logo, w_logo_max)); + m_channelLogo->setWidth(0); // force recalculation + m_channelLogo->setHeight(h_logo_max, true); } int x = m_cBoxFrame.iX + m_cBoxFrameTitleRel.iX + m_cBoxFrameTitleRel.iWidth - m_channelLogo->getWidth() - OFFSET_INNER_MID;